CS547T SPRING 2007

ASSIGNMENT 1

COLLABORATE ALL YOU WANT:

(60 points)
1.  Find the following on the internet and summarize the idea in a single
	sentence (I am using wiki, but you do not have to):

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

(20 points)
2.  Write out the following sets of strings (you may use "..." for an infinite set):

	a.  (5 points)

		{ "aa", "aaa" }^^+^^^
		

		=

		{"aa", "aaa", "aaaa", "aaaaa", "aaaaaa", ... } = { a^i | i geq.gif 2 }
		


	b.  (5 points)

		{ "", "a", "b" }^5
		

		= { "", "a", "b", "aa", "bb", "ab", "bb",
		  "aaa", "aab", "aba", "abb", "baa", "bab", "bba", "bbb",
		  "aaaa", "aaab", "aaba", "aabb", "abaa", "abab", "abba", "abbb",
		  "baaa", "baab", "baba", "babb", "bbaa", "bbab", "bbba", "bbbb",
		  "aaaaa", "aaaab", "aaaba", "aaabb", "aabaa", "aabab", "aabba", "aabbb",
		  "abaaa", "abaab", "ababa", "ababb", "abbaa", "abbab", "abbba", "abbbb",
		  "baaaa", "baaab", "baaba", "baabb", "babaa", "babab", "babba", "babbb",
		  "bbaaa", "bbaab", "bbaba", "bbabb", "bbbaa", "bbbab", "bbbba", "bbbbb" }

		  (cardinality 1+2+4+8+16+32 = 63)
		

	c .  (5 points)

		{ "a" } { "" } { "aa", "b" }^2 { "b" } 
		

		= { "aaaaab", "aaabb", "abaab", "abbb" }
		

	d.  (5 points)

		( U__i=0,1,2,3,4___ { "a" }^i ) - {} - { "aa" }^^*^^^
		

		= { "a", "aaa" }
		


NO TALKY TALKY

(20 points)
3.  Say whether true or not true.  

For a and c:
If true, try a proof (you choose your style -- more points for better style).  
If not true, give a counterexample.  

For b and d:
If not true, give a proof.  If true, give the required sets.

	a.  (5 points)  For all S, a set of strings, 
		(S^^+^^^)^^+^^^ = S^^+^^^.
		

		True.  
		Pf.  

		1.  S^^+^^^ subset.gif (S^^+^^^)^1 = S^^+^^^,
		hence S^^+^^^ subset.gif (S^^+^^^)^^+^^^.

		2a.  (S^^+^^^)^1 subset.gif S^^+^^^ from above (equality implies  subset.gif).
		2b.  Assume for some k, (S^^+^^^)^k subset.gif S^^+^^^.  Show (S^^+^^^)^^k+1^^^ subset.gif S^^+^^^.
			xy in.gif (S^^+^^^)^^k+1^^^ iff x in.gif (S^^+^^^)^k, y in.gif S.
			So x in.gif S^^+^^^ (ind. hyp.).  So  exists.gif i in.gif naturals.gif, x in.gif S^i.
			So xy in.gif S^^i+1^^^, xy in.gif S^^+^^^.

		2c.  By induction, for all i in.gif naturals.gif^^+^^^, (S^^+^^^)^i subset.gif S^^+^^^.
		2d. By defn of ^^+^^^, (S^^+^^^)^^+^^^ = U__i in.gif ^^+^^^___(S^i), and 2c, (S^^+^^^)^^+^^^ subset.gif  S^^+^^^. 

		3.  Because of 1 and 2d, (S^^+^^^)^^+^^^ = S^^+^^^.
		

	b.  (5 points)  Consider the set of strings T:
		T = { x  in.gif  {a,b}^^*^^^ | x does not have "bb" as a substring }.
		There is an S such that S^^*^^^ = T
		

		False.  Suppose such an S.
		"b" in.gif T because "b" does not have "bb" as substring.
		So "b" in.gif S^^*^^^ because T = S^^*^^^.
		So "b" in.gif S, since there is no other way for "b" to be in S^^*^^^.
		So "bb" in.gif S^^*^^^, "bb" in T.  
		Contradiction, since "bb" has "bb" as a substring, so cannot be in T.
		

	c.  (5 points) For all sets of strings S and T,
		if ( S^^*^^^ = T^^*^^^ ) and ( S^2 = T^3 )
		then  S = T.
		

		False.  Consider S = {"", "a", "aa", "aaa"}, T = {"", "a", "aa" }
		Then S^2 = T^3 = { "", "a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa" }
		and S^^*^^^ = T^^*^^^ = {"a"}^^*^^^.  But S neq.gif T.
		

		Also works:  S = {"a"}^^*^^^, T = S - {"aa"}.
		Also works:  S = {"a"}^^*^^^ - {"aa"}, T = S - {"aaa"}.
		...many others...

	d.  (5 points) There exists a finite set R s.t.
		for all infinite sets of strings S and T,
		R S R = R T R.
		

		True.  R = {}.  
		For all S, RS = {}S = {}.  {}{} = {}.
		For all T, RT = {}T = {}.  {}{} = {}.
		


Total Scores:

86-90	5
81-85	4
76-80	6
71-75	11
66-70	9
61-65	4
56-60	3
55-	3


90 89 88 87 86 85 85 84 84 80 79 78 77 76 76 75 75 75 75 73 73 72
72 72 71 71 70 69 69 68 68 67 67 67 66 65 63 62 62 60 58 57 51 48 37

gawk '{ for (i=1;$i;i++) s+=$i; c+=NF } END {print s/c}'
gawk '{ for (i=1;$i;i++) s+=$i*$i; c+=NF } END {print sqrt(s/c-71.6^2)}'

median = 72
mean = 71.6
stdev = 11.0119