c318f00t2 - CSc 318 Test 2 Wednesday 25 October 2000...

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

View Full Document Right Arrow Icon
CSc 318 Test 2 Wednesday 25 October 2000 >>>>>>>>>>SUGGESTED ANSWERS<<<<<<<<<<<<<< 1. (15 pts) Prove the following theorem. Theorem. Given DFA’s M=(Q, Σ , s, F, δ ) and N=(Q, Σ , s, F’, δ ). If F F’ then L(M) L(N). x L(M) δ (s,x) F δ (s,x) F’ x L(N) 2. (20 pts) Let A be the regular expression given by A=(a a*)(ab) and let M be the NFA ({s,1,2}, {a,b}, s, {2}, {(s,a,1), (1,a,1), (1,b,2), (2,b,2)}). a. Give the language expression for L(A). >>> ({a} {a}*){a}{b} b. Prove that L(A) L(M) >>>First I note that (clearly) L(A)={a k b: k>0}. For a k b, ({s}, a k b) = ({1}, a k-1 b) =… ({1}, b) = {2} a k b L(M). c. Find some x L(M) - L(A), that is an x in the language of the NFA but not in L(A). >>>> abb L(M) - L(A), 3. (25 pts) Prove that {a, b, c}* is countable. Define the 1-1 (no onto, which is unnecessary) f:{a,b,c}* {0, 1, 2, …} by f( ε )=0, f(a)=1, f(b)=2, f(c)=3. In general, f( α 1 α 2 …. α n )= α 1 + 4 α 2 + 4 2 α 3 + … +4 n-1 α n Now, to show that f is 1-1, suppose that f( α 1 α 2 …. α n )= f( β 1 β 2 …. β m ), then α 1 + 4 α 2 + 4 2 α 3 + … +4 n-1 α n = β 1 + 4 β 2 + 4 2 β 3 + … +4 n-1 β m . Taking the remainder of both sides after division by 4 gives
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
Image of page 2
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