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

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

View Full Document Right Arrow Icon
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.
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
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.
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