381hw6solns

381hw6solns - CS 381 Homework 6 Solutions 1 L = L0 L1 =...

• Homework Help
• 501844684_ch
• 5

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

CS 381 Homework 6 Solutions 1. L = L0 L1 = { w#w(0 + 1)# | w (0 + 1) * } Describe the set L * 0#L*(0+1) * : L * 0#L * (0+1) * is the set { 0 # w 0 # w 1 # w 2 # … # w 2n # , where w 0 = 0(0+1), w n = w n-1 (0+1), and n>=0 } This is another alternating blocks problem. Each block forces the next block to equal w(0+1), and the string must start with 0# due to the right side of the intersection. Modify the set so that it has an odd number of blocks: L * (0 + 1) * # 0#L * Since each instance of L has 2 blocks, this set is guarenteed to have an odd number of blocks.

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

CS381, Homework #6 Solutions Question 4.1.1 Prove that the language of balanced parenthesis is not regular Proof by the Pumping Lemma: Suppose we select w from L such that w = ( n ) n where n is the n from the pumping lemma. Now we know that xy can only contain opening parenthesis since | xy | ≤ n . When we pump on this string its easy to see that we will only increase the number of open- ing parenthesis, and since the pumped string contains a different number of opening and closing parenthesis, they cannot possibly be balanced.
This is the end of the preview. Sign up to access the rest of the document.
• Fall '05
• HOPCROFT
• Formal languages, Regular expression, Regular language, Pumping lemma for regular languages

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