i2
3
{*2
m way. an
Theory of Computation, Homework 1
1-4 9-)
Let M1 recognize-s L] = {m Inn has even length}, where M1 = (Q1, {a, b}, in, q], F1 = q1)
, and M2 recognizes lg i {0) | to has oz odd number ofas} ,where M2 = (Q2, {a, b}, 52, qz, F2).
Farley Lai, 00764474
Theory of Computation, Homework 2
2 .4 e .)
2 .6 b .)
Let L be the complement of the language
following two languages,
which could be the union of the
1.
2. an arbitrary string of a and b with ba as in between:
CFG for L1,
CFG for L2,
Theory of Computation, Homework 3 Sample Solution
3.8
b.) The following machine M will do:
M = "On input string :
1. Scan the tape and mark the first 1 which has not been marked. If no unmarked 1 is
found, go to step 5. Otherwise, move the head back to th
Theory of Computation, Homework 4
5.1
is decidable and there exists a decider
deciding it. That is,
Assume
constructing a TM
to decide
is possible as follows.
=On input CFG
generating all possible strings
1. derive a CFG
2. run
to decide whether
3. accept
Farley Lai,00764474
TheoryofComputation,Homework5
7.6
i.)union
Withoutlos s ofgenerality ,let M 1 and M 2 betheTMs thatdec idetwolanguages L1 and L2 in
P.Thenwec ons truc taTM M thatdec ides theunionof L1 and L2 inpoly nomialtime.
M = oninput w
1. Run M 1