CSc 318 Exam 1
Friday
30 September 1994
(1) (15 pts) Assume that for , in * |=|+|. Prove by induction that |n| = n | for n = 0, 1, 2,. (2) (15 pts) For = {a} prove that #* = #{0, 1, 2,.}. (3) (15 pts) For sets A, B, and C prove that A B => AxC B
CSc 318 Test 3 Wednesday 1 December 1999.
TEST 3 SUGGESTED ANSWERS
1. (10 pts) Prove that the grammar below is ambiguous. S A B AA | BAB aa | Sa a | abS
The trees for the following two derivations of aaaa differ. S S SS /\/|\ AABAB /\|\|/\| aaaaaaa
CSc 318 Final Examination Saturday 16 December 2000 8 AM >SUGGESTED ANSWERS< 1. Consider the set of DFA's which can be constructed over some alphabet . Prove that equivalence of DFA's is an equivalence relation on this set. I show that the relation i
CSc 318 Test 3 Wednesday 29 November 2000 >SUGGESTED ANSWERS< 1. (15 pts) Let L be the language of the DFA M=(Q, , s, F, ). Find an -NFA for the language LL. Assume Q={q1, q2 , ., qn }, s= q1. Let Q'={q'1, q'2 , ., q'n }, s'=q'1, such that Q Q'= . M'
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 e
CSc 318 Final Examination 14 December 1999 1. (20 pts) Prove that for sets A and B, ~(A x ~(A x ~A B) ~B x A B B) = ~A ~B.
x A and x B
x ~A and x ~B)
2. (15 pts) For the sets A={1,2}, B={a}, find a. b. c. d. e. 2A B 2{1,2,a} = { , {1}, {2}, {a}, (
CSc 318 Test 2 Wednesday 3 November 1999 SUGGESTED ANSWERS. 1. (15 pts) Let A={aab, ba}, B={b, bb}, C={baba, ab, a} be languages over ={a,b}. Find a. (AB-BC)={aab,ba}{b,bb}-{b,bb}{baba,ab,a} ={aabb,aabbb,bab,babb}-{bbaba,bab,ba,bbbaba,bbab,bba} ={aab
CSc 318 Test 1 Wednesday 29 September 1999 SUGGESTED ANSWERS Closed book. Closed notes. 1. a. b. c. d. e. f. 1. ( 12 pts) Let A={1,2,3}, B={3,4}, C={5,6}. Find (A B) C {3} C = {(3,5),(3,6)} (A B) C N A B {(1,3),(1,4),(2,3),(2,4),(3,3),(3,4)} C (a-b)
CSc 318 Final Examination Monday 12 December 1994 7 PM (Below ^ denotes a suprescript, e.g., 2^n denotes 2 raised to the nth power) 1. (10 pts) Find a CFG which is not left-recursive and which is equivalent to the grammar S-> Ax|By|c A->Sy|By B->a|b
CSc 318 Exam 2
Friday
28 October 1994
(1) (10 pts) Find a complete DFA equivalent to the DFA M = ({s,1,2}, {a,b}, {(s,a,1), (1,b,1), (1,a,2), (2,a,2)}. s, {2}). Write your answer in formal form, i.e., as a 5-tuple. (2) (15 pts) Find a complete DFA
CSc 318 Test #1 Wednesday, 27 September 2000 >SUGGESTED ANSWERS< 1. Prove A B A A B B. A B 1-1, onto f:A B. Define 1-1, onto g: A A B B by g(x,y) = (f(x), f(y). g is 1-1, because g(x,y)=g(u,v) (f(x),f(y)=(f(u),f(v) f(x)=f(u) and f(y)=f(v) x=u and y=v