Chapter 23
2.
accept(T1) = any string with a b that is not
the first character of the string
loop(T1) = Æ
reject(T1) = string of all a's, or string
with initial b
3.
accept(T2) = aa(a + b)*
loop(T2) = Æ
reject(T2) = any string not starting with 2 a's
4. This would be: a(a+b)*b(a+b)* + aa(a
+ b)*
a. create the FA for this language (chapter 7) = any string of length
> 2 with initial a
b. now create the TM corresponding to the above FA :
| Start | a | a | R | 2 |
| 2 | a | a | R | Halt |
| 2 | b | b | R | Halt |
6. All FA either accept or reject (never loop). A FA can be simulated by a TM, which will be a TM that never loops. Thus (by definition of recursive) any regular language is recursive
Chapter 24
2. (Hint)
(1) Look at how a's and b's get introduced into a sentence (by prod
4 and 5, of course)
(2) but how do the A's and B's of prod 4 and 5 get introduced? (by
prod 1 only)
(3) and how many A's and B's get introduced by each application of
prod. 1?
6. (Hint) along the same lines as #2
12. (Hint)
(1) prod 1demands that your first sentential form be aXYba
(2) then you can apply prod 2, say n times. What
does the sentential form look like then?
(3) now you can apply prod 3 repeatedly to get what sentential
form?
(4) now apply prod 4 repeatedly to get what? (the final
form of the sentential form)
I will be satisfied with your answer if you can show (as above) that
the grammar will produce the final form described in step 4. Of course,
the proof is only complete if you prove that no sentences other than
those described in step 4 can be produced by the grammar.
You may skip that part.