Sie sind auf Seite 1von 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 ________________________________________________________________________________


ANSWER ANY FOUR QUESTIONS

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 DFAs equivalent to the following NFA using the Direct method. Give the reduced table.

A D

F
0

(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

1/N

B C

0/N 1/N

0/Y

1/N 0/Y

4# (a) Derive the equivalent Regular Expression for the given Finite Automata.
A

0 1

(b) Construct deterministic finite automata equivalent to the following regular expressions; (i) 00 + ( 10 + 1 ) 0* + 1 (ii) ( 0 0* + 1 )*

5#

(a) Design Turing machine which calculate the value ( x + 2 ). Construct the reduced table. (b) For each of the following languages, give a deterministic finite automaton which accept the language over the alphabet {0,1}. (i) The set of all strings ending with 10. (ii) The set of all strings of length 2 or more.

6#

(a) Give a Right and Left linear grammars equivalent to;.


A

a a

(b) Consider the grammar : S aB A bAA S bA Bb A a B bS A aS B aBB For the strings abbaba, give the leftmost derivation, rightmost derivation, and the parse trees.

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, output A; if the input ends in 00, output B; if the input ends in 000 output C; otherwise output D. (b) Covert the above design to the equivalent Mealy machine.

2#

(a)

Give a Context Free Grammar generating the following language, L = { 0i 1i 2j / i 0 , j 1}

(b) Consider the grammar G =( V, T, P, S) , S aB A bAA S bA Bb A a B bS A aS B aBB For the strings aaabaaa, give the Left_Most Derivation, Right_Most Derivation, and the Parse trees.

3# (a) Construct a Deterministic Finite Automata DFA equivalent to the following regular expressions; (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* , (ii) (01)* 00

4# (a) Derive the equivalent Regular Expression for the given Finite Automata.

A
1

B
1

C
0

(b) Give the equivalent Right linear regular grammar for the following DFA.

A 0 E 0

5# (a) Design Turing machine to find 2s complement of a given binary number. (b) Draw a NFA, 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.

a/0 b/1

a/1

A
b/1

B
b/0

a/0

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

Das könnte Ihnen auch gefallen