MIDTERM FOR MATH 4805 / COMP 4805 / MATH 5605
THURSDAY, NOVEMBER 11TH
Instructions: There are six questions and each question is worth 10 marks. Midterms will
be marked out of 50 based on your top ve answers from (1)-(6). Time limit is 90 minutes.
(1) (10
ASSIGNMENT THREE SOLUTIONS
MATH 4805 / COMP 4805 / MATH 5605
(1) (a) A transition diagram appears below for the TM specied by the 7-tuple M =
(cfw_q, q0 , q1 , q2 , q01 , q02 , q12 , q012 , r, f, z , cfw_0, 1, cfw_0, 1, B, X , , q, B, cfw_f ). (Note that
ASSIGNMENT TWO SOLUTIONS
MATH 4805 / COMP 4805 / MATH 5605
(1) (a) The following PDA accepts L1 = cfw_w cfw_0, 1 | w = 0i 1j such that j = 2i or i =
2j by empty stack.
(b) The following PDA accepts L2 = cfw_w cfw_0, 1 | w contains more 1s than 0s by
nal
ASSIGNMENT ONE SOLUTIONS
MATH 4805 / COMP 4805 / MATH 5605
(1) (a) (0 + 1) 010 (nite automata below).
(b) First observe that the following regular expression generates the binary strings
with an even number of 0s and an odd number of 1s
r = (00 + 11 + (01