Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

am

15CS54

20
USN

9:
Fifth Semester B.E. Degree Examination, Feb./Mar. 2022

:4
Automata Theory and Computability

F
08
Time: 3 hrs. Max. Marks: 80

-S
Note: Answer any FIVE full questions, choosing ONE full question from each module.

2
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

F
02
Module-1

-S
1 a. Define the following with example: (i) Alphabet (ii) String (iii) Language (06 Marks)
-2
b. Draw a DFA to accept string of a’s and b’s ending with ab or ba. (04 Marks)
c. Draw a DFA to accept strings of a’s and b’s such that:

F
03
(i) Language has even number of a’s and odd number of b’s.

-S
(ii) Language has not more than three a’s. (06 Marks)
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

8-

F OR
-0

a. Define different types of finite state machines.


-S
2 (04 Marks)
U

b. Minimize the following Finite state machine.


 0 1
VT

A B E
am
-S

B C F
C D H

F
35

D E H
F

E F I -S
-S

6:

F G B
G H B
F
:0

I C
F

H
-S

(06 Marks)
09

A E
-S

I
c. Convert the following  - NFA to its equivalent DFA.
F
22
F

-S
-S

20

F
SF

-S
3-
-0

Fig.Q2(c) (06 Marks)


F
08

-S

Module-2
3 a. Define Regular expression and write R.E for the following language:
i) L = {a2n b 2m | n  0, m  0} (ii) L = {an b m | m  1, n  1, nm  3}
F

(04 Marks)
b. Explain different types of grammars. (06 Marks)
-S

c. Obtain a FSM from the following grammar:


S  aT
F

T  bT
-S

T  aW
W
W  aT
F

and obtain the equivalent regular expression. (06 Marks)


-S

1 of 2
SF
15CS54

am
OR
4 a. Define a Regular grammar. Design regular grammars for the following languages:

20
(i) Strings of a’s and b’s ending with ab.
(ii) Strings of a’s and b’s having a substring aab. (06 Marks)

9:
b. State and prove pumping lemma for regulars languages. (06 Marks)
c. Show that L = {WWR | W ( 0 +1)} is not regular using pumping lemma. (04 Marks)

:4
Module-3

F
08
5 a. Define context free grammar. Write a context free grammar for the language

-S
L = {an+2 bm | n  0 and m > n} (06 Marks)

2
b. Define ambiguity of a grammar. Check whether the following grammar is ambiguous or not.

F
02
S  aS|X

-S
X  aX|a (04 Marks)
-2
c. Simplify the following grammar:
S  aA|a|Bb|cC

F
03
A  aB

-S
B a|Aa
8-

C  cCD
D  ddd F
-0

(06 Marks)
-S
U

OR
6 a. Define PDA. Obtain a PDA to accept L = {WWR|W{a, b}}. Write the transition diagram.
VT

am (08 Marks)
-S

b. Convert the following grammar into equivalent PDA.


EE+T

F
35

ET
F

TTF -S
-S

6:

TF
F  (E)
F
:0

F  id
F

(08 Marks)
-S
09
-S

Module-4
7 a. State pumping lemma for context free languages. Show that L = {anbncn | n  0} is not
F
2

context free. (08 Marks)


F

-S

b. What is a Turing machine? Explain different ways of representing Turing machines.


02
-S

(08 Marks)
F
-2

OR
SF

-S

8 a. What is an ID of a Turing Machine? Define the language accepted by a Turing Machine.


3

(04 Marks)
-0

b. Design a TM to accept the language L = {anb n | n  1} (06 Marks)


F

c. Explain Turing Machine Model. (06 Marks)


08

-S

Module-5
9 a. What are the various techniques for TM construction? (06 Marks)
F

b. Derive the following: (i) Recursively enumerable language (ii) Decidable language.
-S

(04 Marks)
c. What is post correspondence problem? (06 Marks)

OR
F

10 a. What is halting problem? Explain.


-S

(04 Marks)
b. Define the following: (i) Quantum computer (ii) Class NP (04 Marks)
c. Explain Church Turing Hypothesis. (08 Marks)
F

*****
-S

2 of 2
SF
pm
15CS/IS54

2
USN

:5
Fifth Semester B.E. Degree Examination, Aug./Sept. 2020

9
:0
Automata Theory and Computability

F
01
Time: 3 hrs. Max. Marks: 80

-S
Note: Answer any FIVE full questions, choosing ONE full question from each module.

0
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

F
02
Module-1

-S
1 a. Define the following with examples :
-2
i) String ii) Language (04 Marks)

F
09
b. Explain various functions on languages. (02 Marks)

-S
c. Draw the deterministic Finite State Machine for the following :
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

i) To accept decimal string divisible by 3 over the alphabet ∑= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}


3-

ii) To accept odd number of a’s and even number of b’s over alphabet. ∑= {a,b}
F
-2

(10 Marks)
-S
U

OR
VT

2 a. Write an algorithm for deterministic FSM simulator. (04 Marks)


F

m
b. Convert the following Non – deterministic FSM to Deterministic FSM using subset
-S

construction method. (Ref. Fig Q2(b)) (08 Marks)


1p

F
F

-S
:0
-S

37

Fig Q2(b)
F
F

c. Describe standard bar code reader and write its Finite State Machine diagram.
-S

(04 Marks)
:
01
-S

Module-2
F

3 a. What is Regular expression? And mention the applications of regular expression. (03 Marks)
20
F

-S

b. Find the regular expression for the following Languages :


-S

i) To accept strings of 0’s and 1’s having no two consecutive 0’s


20

ii) L = {anbm | m ≥ 1, n ≥ 1, nm ≥ 3} (06 Marks)


F

c. Obtain a regular expression using Kleene’s theorem for the finite automata shown below in
SF

-S
9-

Fig Q3(c)
-0

F
23

-S

Fig Q3(c) (07 Marks)


F
-S

OR
4 a. State and prove pumping lemma theorem for Regular language. (07 Marks)
b. Prove that the regular languages are closed under complement, intersection, difference,
F

reverse and letter substitution. (05 Marks)


-S

c. State and prove : “The Regular languages are closure under union, concatenation and
Kleene’s Star”. (04 Marks)
F
-S

1 of 2
SF
2pm
15CS/IS54

9 :5
:0
Module-3

F
a. Define Context – Free Grammar (CFG). Design CFG for the following language.

01
5

-S
i) To generate the strings of balanced parentheses
ii) L = {0m 1 m 2n | m ≥ 1 and n ≥ 0} (08 Marks)

F
02
b. What is ambiguous grammar? Show that the following grammar is ambiguous.

-S
E → E + E | E * E | (E) | id
-2
Write the left most derivation for the string “id + (id * id)” (08 Marks)

F
09
OR

-S
6 a. Define Deterministic PDA with example. (04 Marks)
3-

b. Obtain PDA to accept the language.


L = {WCWR | W  (a + b)* } where WR is reverse of W by a final state. (07 Marks)
F
-2

c. Convert the following CFG to an equivalent PDA.


-S
S → aABB | aAA
U

A → aBB | a
VT

B → bBB | A
m
-S

C→a (05 Marks)


1p

F
Module-4
F

-S
:0

7 a. Prove that “The Context – Free Language properly contain the Regular languages”.
-S

(04 Marks)
37

n n n
b. Show that the language L = {a b c | n ≥ 0}is not context free. (08 Marks)
F
c. Prove that “Context – Free Language are non closure under intersection”. (04 Marks)
F

-S
:
01
-S

OR
8 a. Define Turing Machine. Explain the working of a Turning machine model. (06 Marks)
F

b. Design a turning machine that accepts L = {0n 1 n | n ≥ 1}. Write the transition diagram for
20
F

-S

the same and also indicate the moves made by the turning machine for the input ‘0011’.
-S

(10 Marks)
20

Module-5
SF

-S
9-

9 a. Write short notes on :


i) Multitape Turning Machine
-0

ii) Model of Linear Bounded Automation. (10 Marks)


F
23

b. Prove that “HALTTM = {(M, W) | The Turning machine M halts on input W is undecidable”.
-S

(06 Marks)

OR
F

10 a. Prove that “The growth rate of any exponential functional is greater than that of any
-S

polynomial”. (08 Marks)


b. Write short note on :
i) Quantum Computers
F

ii) Church Turning Thesis. (08 Marks)


-S

*****
F
-S

2 of 2
SF
pm
15CS54

6
USN

:0
Fifth Semester B.E. Degree Examination, Jan./Feb. 2021

8
:5
Automata Theory and Computability

F
12
Time: 3 hrs. Max. Marks: 80

-S
1
Note: Answer any FIVE full questions, choosing ONE full question from each module.
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

F
02

-S
Module-1
1 a. Define the following terms with example:
-2
(i) Length of a string (ii) Reversal (iii) Proper substring

F
02
(iv) Language (v) Power of an alphabet (05 Marks)

-S
b. Design a FSM to accept set of all strings that either begins or ends or both with substring ab.
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

(05 Marks)
8-

c. Convert the given NDFSM to DFSM. (Refer Fig.Q1(c))


F
-1

-S
U
VT

m
-S

4p

F
Fig.Q1(c) (06 Marks)
F

-S
:2
-S

33

OR
F
2 a. Construct a minimized DFSM for the following: (08 Marks)
F

-S

* * *
:


A B C D E G H
01

F I
-S

0 B C D E F G H I A
F
21

1 E F H H I B B C E
F

-S

b. Define NDFSM and construct NDFSM for the following languages:


-S

20

(i) To recognize the following set of strings abc, abd and aacd
(ii) L = {w|w ababn or aban where n  0}
F
SF

-S
2-

(iii) L = {w|w = aba or |w| is even} (08 Marks)


-0

Module-2
F

3 a. Define Regular expression. Obtain a regular expression for the following languages:
18

-S

(i) L = {w : |w| is even}


(ii) L = {w : in w the 5th character from right is a and either character is b}
(iii) L = {w : w contains both aa and aba as sub string} (06 Marks)
F

b. Construct FSM for the following RE:


-S

(i) ab (ii) b + (ab) (iii) (b + (ab))* (iv) (babb* + a)* (v) (b + ) (ab)* (a + )
(10 Marks)
F

OR
-S

4 a. Show that for every RE there is an equivalent FSM. (05 Marks)


b. Prove that the regular languages are closed under intersection and difference. (06 Marks)
F

1 of 2
-S
SF
15CS54

pm
c. Obtain RE from the following FSM. (Refer Fig.Q4(c))

6
8 :0
:5
Fig.Q4(c)

F
(05 Marks)

12

-S
Module-3

1
5 a. Define context free grammar and write CFG for the following languages:

F
(i) L = {ai b j ck : i + j = k, i  0, j  0}

02

-S
(ii) L = {an b m ck : n +2m = k} (06 Marks)
b. Consider the grammar G, with productions:
-2
S AbB

F
02
A  aA|

-S
B  aB|bB|
8-

Give the left most derivation, rightmost derivation and parse tree for the string aaabab.
(06 Marks)
F
-1

c. What is agbigous grammar? Prove that the following grammar is ambiqous on the string aab.
-S
G: S aS|aSbS| (04 Marks)
U
VT

OR
m
-S

6 a. Build a PDA to accept delimiters or balanced paranthesis having paranthesis {, ( , ) , }.


4p
(08 Marks)

F
b. Explain the following terms: (i) Pushdown Automata (PDA) (ii) Languages of a PDA
F

-S (04 Marks)
:2

c. Obtain a CFG for PDA M with the transitions:


-S

33

(q0, a, Z) = (q0, AZ)


F
(q0, b, A) = (q0, AA)
F

-S
:

(q0, a, A) = (q1, ) (04 Marks)


01
-S

Module-4
F

7 a. State and prove pumping Lemma for context free languages.


21

(06 Marks)
F

-S

b. Prove that L = {w  {a, b, c}* where na(w) = nb(w) = n c(w)} is not context free. (04 Marks)
-S

c. Prove that the Context Free Languages are closed under, union and concatenation. (06 Marks)
20

OR
SF

-S
2-

8 a. With a neat diagram, explain the working of a basic TM. (06 Marks)
b. Design a TM to accept the following language L = {0 n 1n 2 n | n 1}
-0

(10 Marks)
F
18

-S

Module-5
9 Write short notes on:
a. Multi Tape TM
F

b. Non Deterministic TM
-S

c. Post Correspondence Problem (16 Marks)

OR
F

10 a. Prove that every Language accepted by a multitape TM is accepted by standard TM with


-S

single tape. (06 Marks)


b. Write note on: (i) Linear Bounded Automata (ii) Recursive Language (10 Marks)
F

*****
-S

2 of 2
SF
15CS/IS54

pm
USN

1
Fifth Semester B.E. Degree Examination, July/August 2021

:4
Automata Theory and Computability

9
Time: 3 hrs. Max. Marks: 80

:0
Note: Answer any FIVE full questions.

F
01

-S
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

1 a. Design a DFSM to accept L = {w {0, 1}* : w contains even 0’s and even 1’s}. Show that
the string 101011 is accepted. (05 Marks)

1
b. Construct equivalent DFSM for the given NDFSM in Fig.Q.1(b). (05 Marks)

F
02

-S
-2
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

F
09
Fig.Q.1(b)

-S
1-

F
-0

c. Obtain the minimal (minimized) DFSM for the given existing DFSM in Fig.Q.1(c).
-S
(06 Marks)
U
VT

m
-S

Fig.Q.1(c)
7p

F
F

-S
:3
-S

34

2 a. Construct DFSM to accept L = {w {a, b}* : w does not contain substring aab}. (05 Marks)
F
b. Obtain the minimal DFSM from the existing DFSM in Fig.Q.2(b). (08 Marks)
F

-S
:
01
-S

F
21
F

-S

Fig.Q.2(b)
-S

20

F
SF

-S
9-

c. Let L1 = {peach, apple, cherry} and L2 = {pie, cobbler, ). List all the elements of L1L2 in
-0

lexicographic order. (03 Marks)


F
01

-S

3 a. Define Regular Expression (RE) and write RE for L = {w {0, 1}* : W contains odd number
of 0’s}. (04 Marks)
*
b. Build a FSM for the RE (ab)  abb. (03 Marks)
F

c. Build a RE for the given FSM in Fig.Q.3(c). (06 Marks)


-S
F

Fig.Q.3(c)
-S

d. Show that regular languages are closed under intersection. (03 Marks)
1 of 2
F
-S
SF
15CS/IS54

pm
4 a. State and prove pumping theorem for regular languages. (06 Marks)
b. Construct regular grammar G for L = {w {a, b}* : w ends with the pattern aaaa}. Also
generate FSM M that accepts L(G). (05 Marks)

1
n n
c. Show that L = {a b : n  0} is not regular. (05 Marks)

9 :4
5 a. Define Context Free Grammar (CFG). Design CFG for L = {w {a, b}* : #a(w) = #b(w)}

:0
(04 Marks)
b. Is the balanced parenthesis grammar (BAL) S  SS (S)  is ambiguous. If so, obtain

F
01

-S
unambiguous grammar. (07 Marks)
R *
c. Design a PDA for L = {wCw : w {0, 1} }. (05 Marks)

F
02
6 a. Convert the grammar to Chomsky Normal Form (CNF).

-S
S  aACa
A  Ba
-2

F
09
B  Cc

-S
C  cC  (06 Marks)
1-

R *
b. Design PDA for L = {ww : w {a, b} }. (05 Marks)
F
-0

c. Obtain LMD, RMD and parse tree for the string “+  - xyxy” using the rules:
-S
E   EE  EE  EE x y (05 Marks)
U
VT

7 m
a. Show that L  {0 n1n 2 n : n  0} is not context free. (05 Marks)
-S

n n
7p
b. Design a Turing machine to accept L  {0 1 : n  1} show moves for string 0011. (07 Marks)

F
c. Prove that context free languages are closed under union. (04 Marks)
F

-S
:3
-S

8 a. State and prove pumping theorem for context free language. (05 Marks)
34

b. Design a Turing machine which can multiple two positive integers (m, n). (07 Marks)
F
c. Define deterministic context free language and show that deterministic CFL are not closed
F

-S
:

under intersection.
01

(04 Marks)
-S

9 a. Define Post Correspondence Problem (PCP). Does the PCP with two lists.
F
21

X = {b, bab3, ba) and


F

-S

Y = (b3, ba, a) have a solution.


-S

(06 Marks)
20

b. If L is recursive language over , show that L is also recursive. (06 Marks)


F

c. Let f(n) = 4n3 + 5n2 + 7n + 3 prove that f(n) = O(n3). (04 Marks)
SF

-S
9-

10 a. Prove that the Turing machine M that halts on input w is undecidable. (05 Marks)
-0

b. Explain the model of Linear Bounded Automata (LBA), with a neat diagram. (05 Marks)
F
01

c. Write short notes on:


-S

i) Quantum computers
ii) Church Turing thesis. (06 Marks)
F
-S

*****
F
-S

2 of 2
F
-S
SF
pm
17CS54

8
USN

:3
Fifth Semester B.E. Degree Examination, Jan./Feb. 2021

0
:0
Automata Theory and Computability

F
01
Time: 3 hrs. Max. Marks: 100

-S
Note: Answer any FIVE full questions, choosing ONE full question from each module.

1
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

F
Module-1

02

-S
1 a. Define Language, Grammer and Automata with examples. (04 Marks)
-2
b. Define DFSM. Draw a DFSM to accept the Language.
i) L = {awa : w  (a, b)*}. Verify for the string aabaa.

F
02
ii) Set of an string having a substring abb over ∑ = {a, b}. Verify for the string aabba.

-S
(08 Marks)
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

c. Convert the following NDFSM to its equivalent DFSM (Refer Fig Q1(c))
6-

F
-2

-S
U

Fig Q1(c) (08 Marks)


VT

OR m
-S

2 a. Constant an NDFSM for multiple keywords


4p
L = {w  (a, b)* : x , y {a , b}* where

F
F

-S
:5

((w = x abbaay)  (w = xbabay))} (04 Marks)


-S

b. Minimize the following Finite State Machine using partition method. (Refer Fig Q2(b))
30

F
F

-S
:
01
-S

F
21
F

-S
-S

Fig Q2(b) (08 Marks)


20

c. Differentiate between DFSM, NDFSM and  - NDFSM with examples. (08 Marks)
F
SF

-S
2-

Module-2
3 a. Define Regular expression? Obtain the Regular expression for the following languages.
-0

i) L = {a2n b2n+1 ; n ≥ 0, m ≥ 0}
F

ii) L = {anb m ; n ≥ 4, m  3}
26

-S

iii) Set of string of 0’s and 1’s whose 10th symbol from the right end side is 1. Justify the
answers. (08 Marks)
b. State and prove pumping Lemma for regular languages. (08 Marks)
F

c. Define Regular Grammer. Obtain Regular grammer for the language


-S

L = {w  (a, b)* ; w ends with the pattern aaaa}. (04 Marks)


OR
F

4 a. Prove that for every regular defined by regular expression is also defined by Finite State
-S

Machine. (08 Marks)


b. Prove that the following Language is not regular
L = {wwR ; w  (0+1)* is not regular} (08 Marks)
F

c. Construct an NFSM which accepts the regular expression (a+b)*abb. (04 Marks)
-S

1 of 2
SF
17CS54

pm
Module-3

8
5 a. Define Context Free Grammer. Obtain the Context Free Grammer for the following :
i) L = {wwR : w  (a, b)*}

:3
ii) Write a CFG to generate balanced parenthesis

0
Where Bal = {w  { ), ( }* ; parenthesis are balanced}.

:0
Justify the answers. (08 Marks)
b. Define Leftmost and rightmost derivations with examples.

F
(04 Marks)

01
c. What is ambiguous grammer? Show that the following grammer is ambiguous for the string

-S
id + id * id. E → E + E | E – E | E * E | E / E| id (08 Marks)

1
OR

F
02
6 a. Define PDA, and Instantaneous description of PDA. Obtain a PDA to accept the language.

-S
L = {wcwR : w  (a, b)*}. Draw the transition diagram of PDA, show the moves by this PDA
-2
for the string abbcbba. (10 Marks)
b. What is CNF and GNF? Convert the grammer in CNF

F
02
S  ABa

-S
A  aab
6-

B  Ac (05 Marks)
c. For the following CFG F
-2

-S
S  asbb/aab
U

Obtain the corresponding PDA. (05 Marks)


VT

Module-4
m
-S

7 a. State the prove Pumping Lemma theorem for Context Free Languages. (08 Marks)
4p
b. Show that L = {annncn | n ≥ 0} is not context free. (08 Marks)

F
c. Remove all unit production from the grammer
F

-S
:5

S  AB
-S

Aa
30

B  C|b
F

CD
F

-S
:
01

D  E|bc
-S

E  d|Ab (04 Marks)


F
21

OR
F

-S

8 a. Explain with neat diagram, the working of a Turing Machine Model. (06 Marks)
-S

n n n
b. Design a Turing Machine to accept the language L = {0 1 2 | n ≥ 1}. Draw the transition
20

diagram. Show that moves made by this machine for the string 001122. (10 Marks)
F

c. Briefly explain the techniques for Turing Machine construction.


SF

(04 Marks)
-S
2-
-0

Module-5
a. Design a Turing Machine to accept the language L = {0n1 n| n ≥ 1}. Draw the transition
F

9
26

-S

diagram show the moves made by this machine for the string 000111. (10 Marks)
b. Explain the following :
i) Multitape Turing machine
F

ii) Post correspondence problem. (10 Marks)


-S

OR
10 Write short notes on :
F

a. Non Deterministic Turing Machine


-S

b. Halting Problem of Turing Machine


c. Quantum Computation with example
d. Model of linear bounded automation. (20 Marks)
F

* * 2 of 2 * * *
-S
SF
pm
17CS54

3
USN

:4
Fifth Semester B.E. Degree Examination, July/August 2021

9
:0
Automata Theory and Computability

F
01
Time: 3 hrs. Max. Marks: 100

-S
1
Note: Answer any FIVE full questions.
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

F
02

-S
1 a. Define the following terms with examples:
(i) Alphabet -2 (ii) Strings (iii) Kleene’s closure
(iv) Languages (v) Concatenation (05 Marks)

F
09
b. Draw a DFA to accept the following languages.

-S
(i) L = {w  {a – z}*, all five vowels a, e, i, o and u occur in w in alphabetical order}
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

1-

(ii) L = {w  {a, b}*, set of all strings containing the substring “aab”} (06 Marks)
c. Convert the following -NFA to its equivalent DFA. [Refer Fig.Q1(c)]
F
-0

-S
U
VT

m
-S

3p

F
F

-S
:4
-S

34

F
Fig.Q1(c) (09 Marks)
F

-S
:
01
-S

2 a. Obtain a DFA to accept the following language.


L = {w  {a, b}*, Na(w) mod 5 = 0 and Nb(w) mod 3 = 0} (06 Marks)
F

b. Give the differences between DFA, NFA and -NFA. (05 Marks)
21
F

-S

c. Minimize the following DFSM. [Refer Fig.Q2(c)]


-S

20

F
SF

-S
9-
-0

F
01

-S
F

Fig.Q2(c) (09 Marks)


-S

3 a. Obtain a regular expression for each of the following languages:


(i) L = {w|w{a, b}* with atleast three consecutive zero’s}
F

(03 Marks)
(ii) L = {w{a, b}* set of all strings starting with a and ending with b}
-S

(03 Marks)
(iii) L = {w|w{a, b}* whose second symbol from the right end is ‘a’} (04 Marks)
F

1 of 3
-S
SF
pm
17CS54

3
b. Obtain the regular expression for the following FSM using Kleene’s theorem.

9 :4
:0

F
01

-S
Fig.Q3(b) (10 Marks)

F
02
4 a. Show that the following languages are not regular:

-S
(i) L = {anb n | n  0} (ii) L = {1 p | p is prime} (08 Marks)
-2
b. Simplify the following regular expression ((a* )*aa) (bbb)* b* ((ab)*b*ab)*
(06 Marks)

F
09
*
c. If L1 and L2 are regular languages, then prove that L1L2, L1L2 and L are regular

-S
1
languages. (06 Marks)
1-

F
-0

5 a. Obtain a grammar to generate each of the following languages:


-S
(i) L = {anb 2n : n  0}
U

(ii) L = {wwR where w{a, b}*} (05 Marks)


VT

b. If the following grammar ambiguous?


F

S  aS|X m
-S

X  aX|a
3p
(05 Marks)
c. Convert the following grammar to Chomsky Normal Form (CNF).

F
F

S  aACa -S
:4
-S

AB|a
34

BC|c
F
C  cC |  (10 Marks)
F

-S
:
01
-S

6 a. Define PDA and obtain a PDA to accept a string of balanced parenthesis. (04 Marks)
b. Construct a PDA to accept the language L = {wcwR | w {a, b}*}. Draw the graphical
F
21
F

-S

representation of this PDA. Show the moves made by this PDA for the string “abCba”
-S

(10 Marks)
20

c. Convert the following grammar into equivalent PDA.


F

EE+T
SF

-S
9-

ET
T T F
-0

TF
F

F  (E)
01

-S

F  id (06 Marks)
F

7 a. If L1 and L2 are Context Free Languages (CFL’s), then prove L1  L2, L1  L2 and L*1 are
-S

context free languages. (05 Marks)


b. State and prove pumping lemma for context free languages and show that L ={anb ncn | n  0}
is not context free.
F

(10 Marks)
c. Explain with neat diagram the working of turing machine model.
-S

(05 Marks)
F

2 of 3
-S
SF
pm
17CS54

3
8 a. Explain with neat diagram, the model of Linear Bounded Automata (LBA). (06 Marks)

:4
b. Design a TM (Turing Machine) that accepts L = {0n1 n | n  1}. (06 Marks)
c. Consider the turing description given in the following table. Draw the computation sequence

9
of the input string “00”. (08 Marks)

:0
Present State Tape symbols

F
01
b 0 1

-S
q1 1 L q 2 0 R q 1
q2 b R q 3 0 L q2 1 L q 2

1
q3 - b R q4 b R q 5

F
02
q4 0 R q 5 0 R q4 1 R q 4

-S
q5 0 L q2
-2
9 a. M is a turing machine represented by the transition diagram. Obtain the computation

F
09
sequence of M for processing the input string “0011”. {Refer Fig.Q9(a)]

-S
1-

F
-0

-S
U
VT

m
-S

3p

F
F

-S
:4
-S

Fig.Q9(a)
34

(06 Marks)
b. Design a Turing Machine (TM) to recognize all strings consisting of an even number of 1’s.
F
F

(04 Marks)
-S
:

c. Design a Turing Machine (TM) to recognize the language. L = {1n2n3 n | n  1}


01
-S

(10 Marks)
F

10 Write short notes on:


21
F

-S

a. Decidable and undecidable languages (05 Marks)


-S

b. Halting problem of TM (05 Marks)


20

c. Post-correspondence problem (05 Marks)


F

d. Church-Turing thesis (05 Marks)


SF

-S
9-

*****
-0

F
01

-S
F
-S
F
-S
F

3 of 3
-S
SF
am
18CS54

37
USN

5:
Fifth Semester B.E. Degree Examination, Feb./Mar. 2022

:4
Automata Theory and Computability

F
08
Time: 3 hrs. Max. Marks: 100

-S
Note: Answer any FIVE full questions, choosing ONE full question from each module.

2
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

F
Module-1

02

-S
1 a. Define the following terms with examples :
i) Alphabet -2 ii) String
v) Power of an Alphabet.
iii) Language iv) Concatenation at Languages
(10 Marks)

F
03
b. Define DFSM. Design DFSM

-S
i) To accept strings having Even number of a’s and even number b’s
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

4-

ii) To accept binary numbers divisible by 5. (10 Marks)

F
-0

OR
-S
2 a. Convert the following NDFSM of DFSM. [Refer Fig Q2(a)].
U
VT

am
-S

F
40

Fig Q2(a) (08 Marks)


F

b. Minimize the following DFSM by indentifying -S


Distinguishable and Non-distinguishable
-S

2:

states.
 0 1
F
:0

→ A B F
F

-S
09

B G C
-S

* C A C
F

D C G
22
F

-S

E H F
-S

F C G
20

G G F
F

H G C
SF

-S
3-

(12 Marks)
-0

Module-2
F

3 a. Define Regular Expression. Write RE for the following Languages. (10 Marks)
04

-S

i) Strings of 0’s and 1’s ending with three consecutive zeroes.


ii) Strings of a’s and b’s having substring aa.
b. Write DFSM to accept intersection of Languages L1 = (a + b)*a and L2 = (a + b)*b (10 Marks)
F
-S

OR
4 a. Using Kleen’s theorem, prove that for any Regular Expression R, their exits a finite
automata M = (Q, Σ, δ, q0, F) which accepts L(R).
F

(10 Marks)
b. State and prove pumping Lemma for Regular Languages. Show that the Language
-S

L = {wwr : w  (0, 1)*} is not regular. (10 Marks)


F
-S

1 of 2
SF
am
18CS54
Module-3

37
5 a. Define Context Free Grammar. Design CFG for the following Languages.
i) L1= {w : |w| Mod 3 = 0} over Σ = {a}
ii) L2 = {anb mck : m = n + k } over Σ = {a, b, c}

5:
(10 Marks)
b. Define Ambiguity. Consider the grammar

:4
E → E + E | E * E | (E) | id
Find Leftmost and Rightmost derivations and parse tree for the string id + id * id, show that

F
08
the grammar is ambiguous. (10 Marks)

-S
2
OR

F
02
6 a. What is Chomsky Normal Form of CFG? Convert the following grammar to CNF.

-S
S  ABC |BaB
A  aA | BaC | aaa-2
B  bBb |a| D

F
03
C  CA | AC

-S
D→ 
4-

Eliminate  - productions, Unit productions and useless symbols if any before conversion.
(10 Marks)
F
-0

b. What is NPDA? Design NPDA for Language L = {anbn | n ≥ 1}. Draw transition diagram.
-S
Write sequence of moves made by NPDA to accept the string aaabbb. (10 Marks)
U
VT

Module-4 am
7 a. Design TM for WCWR over Σ = {0, 1}. Write transition diagram, and ID for w = 101C101
-S

(14 Marks)
b. Explain : i) Multitape ii) Non-deterministic TM

F
40

(06 Marks)
F

-S
-S

OR
2:

8 a. Define Turning Machine. Explain the working of Turning Machine. (06 Marks)
F
:0

b. Design Turning machine to accept the Language L  {0 1 2 n  0} . Draw the transition


n n n
F

-S

diagram. Write sequence of moves made by TM for string 001122.


09

(14 Marks)
-S

Module-5
F
2

9 a. Explain Halting problem in Turning machine.


F

(07 Marks)
-S
02

b. Write applications of Turning Machine. (06 Marks)


-S

c. Explain Recursively Enumerable Languages. (07 Marks)


F
-2
SF

-S
3

OR
-0

10 a. Explain Quantum Computers. (07 Marks)


F

b. Explain P and NP classes. (07 Marks)


04

-S

c. Explain Church Turning Thesis. (06 Marks)

*****
F
-S
F
-S

2 of 2
F
-S
SF
18CS54

pm
USN

5
Fifth Semester B.E. Degree Examination, July/August 2021

:4
Automata Theory and Computability

9
Time: 3 hrs. Max. Marks: 100

:0

F
01
Note: Answer any FIVE full questions.

-S
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

1 a. Define the following terms with examples alphabet, powers of an alphabet string,

1
string concatenation and languages.

F
(10 Marks)

02
b. Define DFSM. Design a DFSM to accept each of the following languages:

-S
i) L = {W {0.1} : W is ending with 011}
-2
ii) L = {W {0.1} : W has odd numbers of a’s and even numbers of b’s} (10 Marks)
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

F
09

-S
2 a. Convert the following NDFSM to DFSM:
1-

  a b c
p  {p} {q} {r}
F
-0

q {p} {q} {r} 


-S
U

r {q} {r}  {p}


(10 Marks)
VT

m
b. Define distinguishable and Indistinguishable states. Minimize the following DFSM.
-S

 a b
8p
A B F

F
B G C
F

-S
:4

C A C
-S

34

D C G
F
E H F
F

-S
:

F C G
01
-S

G G E
H G C
F
21

(10 Marks)
F

-S
-S

3 a. Define Regular expression. Write the regular expression for the following languages:
20

i) To accept strings of a’s and b’s such that third symbol from the right is ‘a’ and fourth
F
SF

symbol from the right is ‘b’.


-S
9-

ii) L = {anbm; n  4, m  3} (10 Marks)


-0

b. Build a regular expression from the following FSM (Finite State Machine). (06 Marks)
F
01

-S
F
-S

Fig.Q.3(b)
F

c. Write an equivalent NDFSM for the following regular expression a(a* + b*)*b. (04 Marks)
-S

1 of 2
F
-S
SF
18CS54

pm
4 a. Show that regular languages are closed under complement and intersection. (10 Marks)
b. State and prove pumping lemma theorem for regular languages. And show that the language
L = {WWR : W {0, 1}* is not regular}. (10 Marks)

5
:4
5 a. Define CFG (Context Free Grammar). Design CFG for the languages.
L  O 2 n 1m n  0, m  0

9
i)

:0
ii) L  O i 1j2 k i  j or j  k (10 Marks)

F
01
b. Define Ambiguity. Is the following grammar ambiguous? Give reason.

-S
S  iCts iCtSeS a

1
Cb (10 Marks)

F
02

-S
6 a. Define CNF (Chomsky Normal Form). Convert the following CFG to CNF.
-2
S  aACa, A  B a , B  C c , C  cC  (10 Marks)

F
09
b. Define PDA (Push Down Automata). Design a PDA to accept the following language,

-S
L = {anbn : n > = 0}. Draw the transition diagram for the constructed PDA. Show the ID’s
1-

for the string aaabbb. (10 Marks)

F
-0

7 a. Define a Turing Machine. Explain the working of a Turing Machine. (08 Marks)
-S
b. Design a Turing Machine to accept L  {0 1 2 n  0} . Draw the transition diagram. Show
n n n
U

the moves made for string 001122. (12 Marks)


VT

m
-S

8 a. Design a TM for addition of 2 numbers (2 + 3) with transition diagram and ID for the same.
8p
(14 Marks)

F
b. Define and differentiate DTM and NDTM. (06 Marks)
F

-S
:4
-S

9 a. Explain post correspondence problem. (08 Marks)


34

b. Explain Halting problem in Turing Machine. (08 Marks)


F

c. Write a note on Church Turing Hypothesis.


F

(04 Marks)
-S
:
01
-S

10 a. Explain three variants of Turing Machine. (12 Marks)


F

b. Write a note on Quantum Computation. (08 Marks)


21
F

-S
-S

*****
20

F
SF

-S
9-
-0

F
01

-S
F
-S
F
-S

2 of 2
F
-S
SF
am
18CS54

43
USN

8:
Fifth Semester B.E. Degree Examination, July/August 2022

:3
Automata theory and Computability

F
08
Time: 3 hrs. Max. Marks: 100

-S
Note: Answer any FIVE full questions, choosing ONE full question from each module.

2
2. Any revealing of identification, appeal to evaluator and /or equations written eg, 42+8 = 50, will be treated as malpractice.

F
Module-1

02

-S
1 a. Define the following terms with an example i) Alphabet ii) Power of an alphabet
-2
iii) String iv) String concatenation v) language.
b. Explain the hierarchy of language classes in automata theory with diagram.
(05 Marks)
(05 Marks)

F
08
c. Design DFSM for each of the following language.

-S
i) L = {  {0,1}* :  does not end in 01}
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.

8-

ii) L = {   {a, b}* : every a in  is immediately preceded and followed by b}.


F
-1

(10 Marks)
-S
U

OR
2 a. Use MiNDFSM algorithm to minimize M given in Fig Q2(a).
VT

am
-S

F
53
F

-S
-S

3:

F
:1
F

-S
09
-S

Fig Q2(a) (08 Marks)


22
F

-S

b. Convert the following NDFSM given in Fig Q2(b) to its equivalent DFSM.
-S

20

F
SF

-S
8-
-0

F
18

-S

Fig Q2(b) (08 Marks)


c. Design a mealy machine that takes binary number as input and produces 2’s complement of
F

the number as output. (04 Marks)


-S

Module-2
3 a. Define Regular expression. Write regular expression for the following language.
F

i) L = {0n 1 m | m  1, n  1, mn ≥ 3}
-S

ii) L = {   {a, b}* : string with atmost one pair of consecutive a’s} (08 Marks)
b. Obtain NDFSM for the regular expression (a*  ab) (a  b)*. (05 Marks)
F
-S

1 of 3
SF
am
18CS54
c. Build a regular expression for the given FSM in Fig Q3(c).

43
8:
:3

F
08

-S
2
Fig Q3(c)

F
(07 Marks)

02

-S
-2 OR

F
08
4 a. State and prove pumping Lemma theorem for regular language. (08 Marks)

-S
b. Prove that regular languages are closed under complement. (05 Marks)
c. Write regular expression, regular grammer and FSM for the languages
8-

L = {   {a, b} * : w ends with pattern aaaa}. (07 Marks)


F
-1

-S
U

Module-3
VT

5 a. Define Context Free Grammer (CFG). Write CFG for the following languages
F

L = {0 m 1 m 2n : m ≥ 1, n ≥ 0}.
am (05 Marks)
-S

b. What is ambiguity in a grammar? Eliminate ambiguity from balanced parenthesis grammar?


(08 Marks)

F
53

c. Simplify the grammar by removing productive and unreachable symbols


F

S → AB|AC -S
-S

3:

A → aA b|
B → bA
F
:1

C → bCa
F

-S
09

D → AB (07 Marks)
-S

F
22

OR
F

-S

6 a. Define PDA and design PDA to accept the language by final state method. (07 Marks)
-S

L(M) = {  C  R |   (a  b)* and  R is reverse of  }


20

b. Convert the following grammar to CNF


SF

-S
8-

S → ASB|
A → a AS|a
-0

B → SbS|A|bb (08 Marks)


F

c. Consider the grammar


18

-S

E → E + E|E * E|(E)|id
Construct LMD, RMD and parse tree for the string (id + id * id). (05 Marks)
F
-S

Module-4
7 a. Define Turing Machine (TM). Design a TM for language
L = {0 n 1 n | n ≥ 1}. Show that the string 0011 is accepted by ID. (10 Marks)
F

b. Explain multiple TM with a neat diagram. (05 Marks)


-S

c. Explain any two techniques for TM construction. (05 Marks)


F
-S

2 of 3
SF
am
18CS54

43
OR
a. Design a TM for the language L = {1 2 n 3 n | n ≥ 1} show that the string 11 22 33 is accepted
n

8:
8
by ID. (12 Marks)

:3
b. Demonstrate the model of Linear Bounded Automata (LBA) with a neat diagram. (08 Marks)

F
08

-S
Module-5

2
9 a. Show that ADFA is decidable. (05 Marks)
b. Define Post Correspondence Problem (PCP). Does the PCP with two list x = (b, bab 3, ba)

F
02
y = (b3, ba, b) have a solution.

-S
(08 Marks)
c. Explain quantum computation.
-2 (07 Marks)

F
08

-S
OR
8-

10 a. Prove the ATM is undecidable. (05 Marks)


b. Does the PCP with two list x = (0, 01000, 01) y = (000, 01, 1) have a solution. (05 Marks)
F
-1

c. State and explain Church Turning Thesis in detail. (10 Marks)


-S
U
VT

*****
F

am
-S

F
53
F

-S
-S

3:

F
:1
F

-S
09
-S

F
22
F

-S
-S

20

F
SF

-S
8-
-0

F
18

-S
F
-S

3 of 3
F
-S
F
-S
SF

You might also like