You are on page 1of 4

# ‫سم اهلل الرحمن الرحيم‬ ‫ب‬ University of Aden Faculty of Engineering Odd Semester Final Examination (2008-2009

) Subject: Automata & Computation Date: / 2 /2009 Class: B3CS/B3CSE Time: 2 hours ________________________________________________________________________________

1#

(a) Consider the Right linear grammar A 1A A  00 B B  1 Construct an equivalent Deterministic Finite Automata, for this grammar. (b) Give a Context Free Grammar that can generate the following language, L = { ax bx / x ≥0}

2#

(a) Construct DFA’s equivalent to the following NFA using the Direct method. Give the reduced table.

ε A ε D ε

B

1

C ε ε

ε F
0

E ε

0

G

H

(b)

Construct Regular Expression for the language with all words that do not end in a double letters

3# (a) Design a Mealy machine for the following process, “ For input from (0+1)*, if the input ends in 11, output “TWO”; if the input ends in 000, output “THREE”; otherwise output “OK” . (b) Convert the machine into an equivalent MOORE machine.
0/Y 1/Y

A

1/N

B C

0/N 1/N

D

0/Y

1/N 0/Y

. (i) 00 + ( 10 + 1 ) 0* + 1 (ii) ( 0 0* + 1 )* 5# (a) Design Turing machine which calculate the value ( x + 2 ). A a a B b C b 1 E (b) Consider the grammar : S  aB A  bAA S  bA Bb A a B  bS A  aS B  aBB For the strings abbaba. (i) The set of all strings ending with 10. rightmost derivation.1}. (ii) The set of all strings of length 2 or more. Construct the reduced table.4# (a) Derive the equivalent Regular Expression for the given Finite Automata. ‫تمنياتي لكم بالتوفيق‬ . give the leftmost derivation. (b) For each of the following languages. give a deterministic finite automaton which accept the language over the alphabet {0. 6# (a) Give a Right and Left linear grammars equivalent to. A 0 1 B 0 C 1 1 0 E (b) Construct deterministic finite automata equivalent to the following regular expressions. and the parse trees.

S  aB A  bAA S  bA Bb A a B  bS A  aS B  aBB For the strings aaabaaa.‫سم هللا الرحمن الرحيم‬ ‫ب‬ University of Aden Faculty of Engineering Odd Semester Final Re_examination (2008-2009) Subject: Automata & Computation Date: / /2009 Class: B3CS/B3CSE Time: 2 hours -------------------------------------------------------------------------ANSWER ANY FOUR QUESTIONS 1# (a) Design a Moore machine for the following process: if the input ends in 0. T. output A. if the input ends in 00. and the Parse trees. 2# (a) Give a Context Free Grammar generating the following language. otherwise output D. (a b c) + (( a + b* + c ) a*) (b) Find the Right and the Left Linear Regular Grammars for the following Regular Expressions: (i) ( a + b) a* . 3# (a) Construct a Deterministic Finite Automata DFA equivalent to the following regular expressions.” (b) Covert the above design to the equivalent Mealy machine. Right_Most Derivation. give the Left_Most Derivation. P. S) . output B. j ≥ 1} (b) Consider the grammar G =( V. (ii) (01)* 00 . L = { 0i 1i 2j / i ≥ 0 . if the input ends in 000 output C.

which accepts the languages defined by the following Regular Expressions: a (i) ( a b b a* )* (ii) (ii) (001) + (( 1 + 0* + 1 ) 1*) 6# (a) Convert the following machine to MOORE machine. (b) Draw a NFA. a/0 b/1 a/1 A b/1 B b/0 C a/0 (b) Construct Regular Expression for the language with all words that do end in a double letters ‫تمنياتي لكم بالتوفيق‬ . 0 0 0 A 1 B 1 C 0 D (b) Give the equivalent Right linear regular grammar for the following DFA. A 0 E 0 1 B 1 C 1 5# (a) Design Turing machine to find 2’s complement of a given binary number.4# (a) Derive the equivalent Regular Expression for the given Finite Automata.