CS403/SE307/CS355 - Theory of Computation
Test 2A
Tuesday 30 November 2004, 10:00, Lab 4
T Naughton, CS NUIM
Remove everything from your desk except pens/pencils. Paper will be provided. Turn off all computer monitors. Answer all questions. Remember to be mathematically precise in all of your answers. You have until 10:50. You can leave whenever you are finished.
Name......................................... Student number.........................
Course/year...................................
Q1 The finite automaton Ma is written formally as Ma = {Q, ,
, q0, F} = {{00, 99}, {0, 1}, {((00, 0), 00), ((00, 1), 00), ((99, 0), 00), ((99, 1), 00)}, 00, {99}}. How many words does Ma accept? [1 mark]
Q2 The finite automaton Mb is written formally as Mb = {Q, ,
, q0, F} = {{00, 99}, {0, 1}, {((00, 0), 99), ((00, 1), 00), ((99, 0), 00), ((99, 1), 00)}, 00, {99}}. How many words does Mb accept? [1 mark]
Q3 Let L = {0i1j : i >= j}. Construct a context-free grammar that generates L. [3 marks]
Q4 Construct a pushdown automaton that accepts (recognises) L. [3 marks]