39084_quiz1sols.pdf - CS 273 Intro to Theory of Computation...

This preview shows page 1 - 2 out of 8 pages.

CS 273: Intro to Theory of Computation, Spring 2008 Quiz 1 Solutions Here is a literal solution to the 9/10am version of the quiz. After it, are solutions to variations of these questions from other versions of the quiz. 1. (2 points) To formally define a DFA, what five components do you need to specify? Solution: The set of states, Q ; input alphabet, Σ; transition function, δ ; initial state, q 0 ; and set of final states, F . 2. (3 points) Suppose that A = { aa, bb } and B = { 1 , 2 } . List the members of B × P ( A ). Solution: B × P ( A ) = n (1 , ) , (1 , { aa } ) , (1 , { bb } ) , (1 , { aa, bb } ) , (2 , ) , (2 , { aa } ) , (2 , { bb } ) , (2 , { aa, bb } ) o 3. (2 points) Is the following a valid state diagram for a DFA? Explain your answer. Solution: No, because state C does not have output arrow for 0 (and also for 1). A B C D 0 1 1 0 1 0 1
Image of page 1

Subscribe to view the full document.

4. (6 points) Here is the state diagram for an NFA. Q0 Q1 Q2 Q3 Q4 Q5 a a a b b Suppose the transition function is named δ . Fill in the following output values for the transition function: (a) δ ( Q 0 , a ) = { Q1 , Q4 } (b) δ ( Q 4 , a ) = (c) δ ( Q 4 , ) = { Q2 } 5. (5 points) Give the state diagram of an NFA which recognizes the language represented
Image of page 2
You've reached the end of this preview.
  • Spring '17
  • adam

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern