cfl-a3s.pdf - CS2333 Assignment 3 Due Monday February 5...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS2333 Assignment 3 Due: Monday February 5, 2018, by 5pm. Sample Solution (/32) 1. (4 marks) Draw an NFA for the language { w ∈ { 0 , 1 } | w contains the substring 1001 } 1 0 0 1 0 , 1 0 , 1 2. (4 marks) Draw the state diagram for an NFA that accepts the language represented by the regular expression ((01 0 )(11 0)) . 0 ε 1 ε 0 ε 1 1 0 ε 3. (4 marks) For the language { w | w contains an odd number of 1s or contains exactly two 0s } , draw a state diagram for an NFA that has exactly 6 states. ε ε 1 1 0 0 0 0 1 1 1 1
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4. (5 marks) Give a formal construction to show that, if there is a DFA M A = ( Q, Σ , δ, q, F ) for a regular language L ( M A ) over Σ, then there is an NFA for L = { w 0 : w L ( M A ) } , where 0 Σ. Construct M = ( Q , Σ , δ , q 0 , F ) to recognize L as follows: Let q A be a new state. Let Q = Q ∪ { q A } . Let F = { q A } . Let δ : Q × Σ ε → P ( Q ) where δ ( q, a ) = if a = ε if q = q A { δ ( q, a ) } if q Q - F , a Σ { δ ( q, a ) } if q F , a Σ - { 0 } { δ ( q, a ) , q A } if q F , a = 0 5. (5 marks) We showed that the regular languages are closed under complement by, for a DFA
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ 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