CS 390 Solutions to Test 1
1. Prove
Let y be an arbitrary element of tex2html_wrap_inline20 .
Then there is an element x in tex2html_wrap_inline24 and y = f(x).
Hence tex2html_wrap_inline28 and tex2html_wrap_inline30 .
Hence tex2html_wrap_inline32 and tex2html_wrap_inline34 , that is tex2html_wrap_inline36 . Hence tex2html_wrap_inline38 .

2. For any set A, tex2html_wrap_inline42 . Hence R is reflexive.
For two set A and B tex2html_wrap_inline48 does not necessarily imply tex2html_wrap_inline50 . Hence R is not symmetric.
For any three sets A,B, and C if tex2html_wrap_inline48 and tex2html_wrap_inline60 then tex2html_wrap_inline62 . Hence R is transitive.

3.(a) tex2html_wrap_inline66 .
(b) tex2html_wrap_inline68
(c) tex2html_wrap_inline70 or
tex2html_wrap_inline72 .

4. L is the set of strings consisting of a's and b's but containing at least one a.
Since the seed is a, any element of L is genmerated from a by applying (2) an appropriate number of times. Since both a and b can be appended any number of times any time during the generation and b can also be added in front any time any number of times, any string containing at least one a can be generated by (1) and (2).

5. The statement to be proven is as follows.
Any string in L starts with an a followed by any number of a's and then any number of b's.
Proof.
Basis Step:
Since the seed is a, we prove the statement for string a.
Obviously a starts with a and is followed by zero a's and zero b's.
Hence the statement holds for the basis case.
Induction Step:
Let x be a string in L.
Then we need to show that for any string produced from x by (2) of the definition, the statement holds.
(2) produces strings ax and xb from x.
For ax, since x starts with a and is followed by a's then b's, obviously ax still starts with a and is followed by a's and b's.
For xb, since x starts with a and is followed by a's and then b's, xb still starts with a, is followed by a's and then b's.
Hence the statement holds for all strings of L.


S. Toida
Tue Jan 14 11:14:21 EST 1997

Back to 1994 Test 1 Questions

Back to CS390 1994 Test 1

Back to CS390 Past Tests