# tut03sol - CSCI 3130 Formal Languages and Automata Theory...

• Notes
• 3

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

CSCI 3130 Formal Languages and Automata Theory Fall 2015 Week 3 Tutorial Session Solution 1. (a) Write down a regular expression for the following NFA. For this problem, you do not have to go through the procedure described in class. (b) Convert the following NFA into a DFA. A B C D 0 , 1 0 0 1 1 0 , 1 Solution: (a) By inspection, the NFA accepts all strings that contain 00 or 11 somewhere. A corresponding regular expression is ( 0 + 1 ) * ( 00 + 11 )( 0 + 1 ) * (b) One can check that the set of active states of the NFA changes as follows: inputs 0 1 { A } { A, B } { A, C } { A, B } { A, B, D } { A, C } { A, C } { A, B } { A, C, D } { A, B, D } { A, B, D } { A, C, D } { A, C, D } { A, B, D } { A, C, D } Here is the corresponding DFA. { A } { A, B } { A, C } { A, B, D } { A, C, D } 0 1 0 1 1 0 0 1 1 0 2. (a) Write down the definition of regular expressions over an alphabet Σ. (b) Given a string w , define w R as the string w in reverse order. That is, if w = w 1 w 2 . . . w n , then w R = w n w n - 1 . . . w 1 . For example, if w = live , then w R = evil . Given a language L , define its reversal L R as the set of strings in L in reverse. More precisely, L R = { w R | w L } . For example, if L = { live , raw , level } , then L R = { evil , war , level } . If L is a regular language, prove that L R as also regular. Solution: (a) A regular expression E is defined recursively as follows: 1

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

The “atomic” expressions , ε , and a (for any symbol a Σ) are all regular expressions If an expression E can be written as E = R + S or E = RS or E = R * for some regular expression, then E is also a regular expression (b) Proof 1
This is the end of the preview. Sign up to access the rest of the document.
• Fall '15
• SIUON
• Formal language, Regular expression, Regular language, Automata theory

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern