CS547T SPRING 2007

ASSIGNMENT 2

COLLABORATE ALL YOU WANT:

(50 points)
1.  Give the definitions as precisely, formally, and tersely as possible.  Style points may be
	given or taken away.

	a.  (5 points) Define  Lambda.gif(S),the lambda closure of a set of states S in an NFA- Lambda.gif

	
	for  delta.gif  a relation (as in class),
	Lambda.gif(S) = mu.gif { q | q in.gif S or  exists.gif p in.gif Lambda.gif(S), <<p,lambda.gif>,q> in.gif delta.gif  }

	for  delta.gif  a function onto powerset (as in book),
	Lambda.gif(S) = mu.gif { q | q in.gif S or  exists.gif p in.gif Lambda.gif(S), q in.gif delta.gif(p,lambda.gif) }

	or, 
	Lambda.gif(S) is the smallest set s.t.
		S subset.gif Lambda.gif(S)
		forall.gif p in.gif Lambda.gif(S), delta.gif(p,lambda.gif) subset.gif Lambda.gif(S)
	

	b.  (5 points) If <Q,Sigma.gif,q_0,A,delta.gif> is a NFA- Lambda.gif, define the NFA that reduces it;
		i.e., give Q' in terms of Q, give A' in terms of A, etc. for the NFA that accepts the same language

	c.  (5 points) Define the equivalence class of x, [x], 
		under an equivalence relation R, where x is in the domain of R

	
	[x] = { y | xRy }
	

	d.  (5 points) Define distinguishability w.r.t. L

	
	x D_0_L y iff (exists.gif w in.gif Sigma.gif^^*^^^, xw in.gif L and not(yw in.gif L))

	x D_L y iff (x D_0_L y or y D_0_L x)
	

	e.  (5 points) Given FSM's M_1 and M_2, specify M s.t. L(M) = L(M_1)^^*^^^L(M_2);
		i.e., give Q in terms of Q_1 and Q_2 and any new states, etc.

	f.  (5 points) Define the minimal DFA of a language L, in terms of equivalence classes of strings under I_L

	
	<{[x] | x in.gif Sigma.gif^^*^^^},
	  Sigma.gif,
	 [lambda.gif],
	 {[x] | x in.gif L },
	 {<<[x],a>,[xa]> | x in.gif Sigma.gif^^*^^^, a in.gif Sigma.gif }
	>

	

	g.  (5 points) Define the reachable states in a DFA, Q' subset.gif Q, 
		(a state is reachable iff there is at least one string that can get to the state)

	
	remember  delta.gif  in a DFA is a function:
	Q' = { q |  exists.gif x in.gif Sigma.gif^^*^^^, q= delta.gif^^*^^^(q_0,x) }
	

	h.  (15 points) Suppose an NFA- Lambda.gif, M, defined (as in class) so that  delta.gif  is a relation on Q times.gif Sigma.gif  → Q;
		define a computation of M on input x to be a sequence of states that M could follow while processing x 
		(each sequence starts at q_0);

		AND

		define  Omega.gif__M,x___ the set of all such possible computations of M on x

		You will need some method for specifying sequences:
		i suggest either using a function or a concatenation operation;
		you can use <q_1, q_2, ..., q_n>, but you may lose style points
		for using "...". 

		You may refer to the i-th character in x as x_i.

	

	C: naturals.gif_0^k imply.gif Q times.gif (Sigma.gif union.gif {lambda.gif})^^*^^^, is a sequence of configurations of M on x iff
	  C(0) = <q_0, x>
	  forall.gif i<k,  
	    exists.gif a in.gif (Sigma.gif union.gif {lambda.gif}), y in.gif Sigma.gif^^*^^^, q, q' in.gif Q,
	      C(i) = <q,ay>, C(i+1) = <q',y>, and <<q,a>,q'> in.gif delta.gif
	  exists.gif q in.gif Q, C(k) = <q,lambda.gif>

	f: naturals.gif_0^k imply.gif Q, representing a sequence of states of length k+1,
	is a computation of M on x iff
	  exists.gif C a sequence of configurations of M on x,
	    forall.gif i leq.gif k, exists.gif y in.gif Sigma.gif^^*^^^,
	      C(i) = <f(i),y> 

	Omega.gif__M,x___ is the smallest set containing all computations of M on x

	

	or perhaps

	

	Omega.gif__M,x___ = { C | exists.gif x' in.gif E(x),
	    C  in.gif  Q^^|x'|+1^^^, i.e. C is a sequence of states of length |x'|+1,
	    C_0 = q_0, 
	    forall.gif i<k, 
	      <<C_i,x'_i>,C__i+1___> in.gif delta.gif
	      }

	where E(x) is the set of sequences of characters over  Sigma.gif union.gif {lambda.gif}
	whose string concatenations equal x:
	E(x) = { Y | exists y in.gif (Sigma.gif union.gif {lambda.gif})^^*^^^, Y_i = y_i, and (in the sense of strings) y = x }

	

	or perhaps

	

	Let C.tail be the last element in a sequence C
	(<a>.tail = a; <A,b>.tail = b):

	Omega.gif__M,lambda.gif,0___ = { <q_0> }
	forall.gif a in.gif (Sigma.gif union.gif {lambda.gif}),
	  Omega.gif__M,ay,k___ = { <C,q> | C in.gif Omega.gif__M,y,k-1___, <<C.tail,a>,q> in.gif delta.gif  } 

	Omega.gif__M,x___ =  union.gif__k in.gif naturals.gif___  Omega.gif__M,x,k___
	

	or perhaps

	

	Omega.gif__M,lambda.gif___ = { <<>,q_0> }
	forall.gif a in.gif (Sigma.gif union.gif {lambda.gif}),
	  Omega.gif__M,ay___ = { <<C,p>,q> | <C,p> in.gif Omega.gif__M,y___, <<p,a>,q> in.gif delta.gif  } 

	


YOU CAN HELP EACH OTHER, BUT DO NOT GIVE ANSWERS:

(30 points)
2.  Give these as required

	a.  (5 points)

		Give the minimal DFA for the language (0+01)0^^*^^^1

	b.  (5 points)

		Give an NFA for the language (1+11)(110)*11

	c.  (5 points)

		Give the DFA that reduces the NFA above using the Q' = 2^Q construction

	d.  (5 points)

		Number your states in question 2a, starting with q_0 receiving number 1

	e.  (5 points)

		Give L(p,q,2) for all p,q, pairs for your machine in question 2a
		with numbering in question 2d

	f.  (5 points)

		Give an inductive definition of an NFA- Lambda.gif, where  delta.gif
		is a relation on Q times.gif Sigma.gif  → Q (as in class);
		starting with the simplest machine, <{q_0}, {}, q_0, {}, {}>

	
	<{q_0}, {}, q_0, {}, {}>  in.gif  NFA- Lambda.gif

	forall.gif <Q,Sigma.gif,q_0,A,delta.gif>  in.gif  NFA- Lambda.gif
	  <Q union.gif {q},Sigma.gif,q_0,A,delta.gif>  in.gif  NFA- Lambda.gif
	  <Q,Sigma.gif union.gif {a},q_0,A,delta.gif>  in.gif  NFA- Lambda.gif
	  if p in.gif Q, <Q,Sigma.gif,q_0,A union.gif {p},delta.gif>  in.gif  NFA- Lambda.gif
	  if p,q in.gif Q, a in.gif (Sigma.gif union.gif {lambda.gif}), <Q,Sigma.gif,q_0,A,delta.gif union.gif {<<q,a>,p>}>  in.gif  NFA- Lambda.gif
	

NO TALKY TALKY

(20 points)
3.  Give required proofs or disproofs.

	a.  (5 points)  

		I_L is an equivalence relation

		
		I_L is reflexive, x I_L x:
		  forall.gif w, xw in.gif L iff xw in.gif L
		I_L is symmetric, if x I_L y then y I_L x:
		  forall.gif w, xw in.gif L iff yw in.gif L
		  thus, forall.gif w, yw in.gif L iff xw in.gif L
		I_L is transitive, if x I_L y and y I_L z then x I_L z:
		  forall.gif w, xw in.gif L iff yw in.gif L
		  forall.gif w, yw in.gif L iff zw in.gif L
		  thus, forall.gif w, xq in.gif L iff zw in.gif L

		So I_L is an equivalence relation
		

	b.  (5 points)  

		{ x c y | x in.gif {a,b}^^*^^^, x neq.gif y^r } is regular

		
		S = { a^i c | i in.gif naturals.gif  } 
		is an infinite set of mutually distinguishable strings w.r.t this language, L,
		because for i neq.gif j, (a^i c a^j) in.gif L but (a^i c a^i) is not.
		Therefore the language is not regular.

		

		or this

		
		Suppose L, the language, were regular.  
		Since  (a+b)^^*^^^ c (a+b)^^*^^^ is also regular, there would be a machine accepting
		(a+b)^^*^^^ c (a+b)^^*^^^ - L.
		But this difference is cpal, which is not regular.  
		Contradiction.
		

		or this

		
		(From L. Keys)
		Suppose this language, L, were regular.  
		Then by the pumping lemma,  exists.gif n,
		  for a^n c a^^n!+n^^^, which is in L,
		  exists.gif u,v,w, k>0,
		    v = a^k,
		    forall.gif m, a^^n+mk^^^ c a^^n!+n^^^ in.gif L
		  But since k is an integer less than n, n!/k is an integer,
		  and there is some m s.t. mk = n!.
		  For this m, a^^n+mk^^^ c a^^n+mk^^^ in.gif L 
		  contradicts the definition of L.
		Thus, L is not regular.
		

	c.  (5 points) 

		For a set of computations,  Omega.gif__M,x___, defined in question 2h above,
		there is always a finite subset  Omega.gif'__M,x___ subset.gif   Omega.gif__M,x___
		that contains an accepting computation iff
		the original set contains an accepting computation

		
		Omega.gif  contains an infinite set of accepting computations
		(each a sequence of finite length),
		whenever there is a loop in an accepting computation.
		From an infinite set, the axiom of choice guarantees a
		subset containing a single element, {c} subset.gif Omega.gif
		whenever c in.gif Omega.gif.  This singleton set is finite.
		

		or perhaps

		
		Let Q be the states of M.
		For any  Omega.gif, 
		the subset  Omega.gif' = { C in.gif Omega.gif  s.t. |C| leq.gif |Q|+1 } is a finite subset, and 
		since an accepting computation has at most length |Q| before it loops,
		Omega.gif  contains an accepting computation iff  Omega.gif' does.
		

	d.  (5 points) 

		Given two regular expressions, R_1 and R_2, there is a test
		for the equivalence of their denotations that always terminates in
		finite time

		
		Convert R_1 to a DFA, M_1 in finite time, 
		first by converting it to an NFA- Lambda.gif  according to Kleene,
		then converting the NFA- Lambda.gif  to an NFA using Lambda closures
		  (each closure bounded by |Q| on a finite  delta.gif,
		  and determination of  lambda.gif in.gif L is finite-time),
		then converting the NFA to a DFA with exponential Q.
		Each step takes finite time.

		Do the same for R_2 into DFA, M_2.
		The tests for L(M_1) - L(M_2) and L(M_2) - L(M_1)
		are finite.

		(Or, minimize both DFA's and compare, subject to
		possible renumbering of the states; argue that this
		can be done in finite time; be careful not to suggest
		that equivalence classes can be compared without
		referring to a bound on the length of strings that need
		to be tested.)

		(Or, minimize both DFA's, take the smaller size |Q|,
		Test for all strings in order, from
		length 0 to 2|Q| to see if both machines accept the
		same strings in this range of lengths.  If so, then
		argue that there could be no disagreement on longer
		strings.)
		


mean = 63.7
stdev = 16.3
median = 66
missing papers >= 4

a2	a1	avg
88	87	87.5
87	86	86.5
82	89	85.5
82	77	79.5
82	75	78.5
81	90	85.5
81	82	81.5
81	80	80.5
80	85	82.5
80	76	78
79	67	73
78	72	75
75	84	79.5
74	84	79
73	57	65
73	69	71
71	67	69
71	68	69.5
68	79	73.5
68	76	72
67	67	67
66	62	64
65	75	70
63	88	75.5
63	70	66.5
60	69	64.5
60	63	61.5
59	73	66
57	72	64.5
57	60	58.5
56	85	70.5
56	75	65.5
56	62	59
55	62	58.5
55	50	52.5
53	71	62
52	71	61.5
49	65	57
48	72	60
38	51	44.5
38	48	43
30	75	52.5
29	66	47.5
18	58	38