university ofthepunjab ,roll no. infig ¥ . fifth semester

3
UNIVERSITY OF THE PUNJAB Fifth Semester - 2019 Examination: B.S. 4 Years Program , " Roll No. in Fig ¥ . , , " Roll No. in Words . , , , PAPER: Theory of Automata (IT) Course Code: IT-301 Part-I (Compulsory) Q.l. Encirclethe right answer, cutting and overwriting is not allowed. (lxl0=10) 1) Which on~ is not t;ue? a.l\a==l\al\. b. {}=={I\} c. 1\ == 1\ 1\ 1\ d. None of above 2) Minimum number of states in a FAare: a. a b1 c. 2 d. 3 3) There is one and only one FAfor a languag~: a.. True . b. False C. d. May and may no None of these 4) Which one is true? a. {I\}* == {}* b. {I\ V == { 1\ }* c. Both a & b d. None of the above 5) Regular expression for all strings starting with "ab" and ending with "bba" is: a. aba*b*bba b. ab ( ab )*bba c. ab (a + b)*bba d. All ofthe above 6) Forl=={a,b}andL-allstringsconta" "aba" S bstr: . - .' mmg d a as u strrng. DIfference of transactions made in constructIng DFA & an equivalent NFA? 2. 2 b. 3 c. 4 d. Can't be determined P.T.O.

Upload: others

Post on 07-Apr-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: UNIVERSITY OFTHEPUNJAB ,Roll No. inFig ¥ . Fifth Semester

UNIVERSITY OF THE PUNJABFifth Semester - 2019

Examination: B.S. 4 Years Program

," Roll No. in Fig ¥ .,,

" Roll No. in Words .,,,

PAPER: Theory of Automata (IT)Course Code: IT-301 Part-I (Compulsory)

Q.l. Encirclethe right answer, cutting and overwriting is not allowed. (lxl0=10)

1) Which on~ is not t;ue?a.l\a==l\al\.

b. {}=={I\}

c. 1\ == 1\ 1\ 1\

d. None of above

2) Minimum number of states in a FAare:a. ab 1c. 2d. 3

3) There is one and only one FAfor a languag~:a.. True .b. False C.

d.May and may noNone of these

4) Which one is true?a. {I\}* == {}*b. {I\ V == { 1\ }*c. Both a & bd. None of the above

5) Regular expression for all strings starting with "ab" and ending with "bba" is:a. aba*b*bbab. ab ( ab )*bbac. ab (a + b)*bbad. All ofthe above

6) Forl=={a,b}andL-allstringsconta" "aba" S bstr: . -.' mmg d a as u strrng.DIfference of transactions made inconstructIng DFA & an equivalent NFA?

2. 2b. 3c. 4

d. Can't be determined

P.T.O.

Page 2: UNIVERSITY OFTHEPUNJAB ,Roll No. inFig ¥ . Fifth Semester

7) Valid strings for a language are:a. Which are over given Lb. Follow the rules of thatspecifit languag~.c. Both a & bd. None of above.

8) For a string "aaa~aa" What is the smallest valid length? If l:={a, aa, aaa]a. 6b. 2c. 3d. 0

9) If S::: {ab, bb} then S* will not containa. abbbabb. bbbac. bbbbabd. ababbb

to) Which one is true?a. All FA's are also NFAb. All NFA's are also FAc. Both are trued. None of them

Page 3: UNIVERSITY OFTHEPUNJAB ,Roll No. inFig ¥ . Fifth Semester

UNIVERSITY OF THE PUNJABFifth Semester - 2019

Examination: B.S. 4 Years Program

~ ..•.•................. ~• •• •: Roll No. ••••.. .••..• ••...•• :~ ~

PAPER: Theory of Automata (IT)Course Code: IT -301 Part -II

MAX. TIME: 2 Hrs. 45 Min.MAX. MARKS: 50

ATTEMPT TIDS (SUBJECTIVE) ON THE SEPARATE ANSWER SHEET PROVIDED

Q.2. Questions with short answers. (5 x4 = 20)

a) Give Recursive definition of Regular Expressions

b) Give the definition of CNFand also describe its advantages.

c) Define ambiguity, give an ambiguous grammar and also prove it.

d) Give comparison among the power of FA,NFA,PDA, NPDA,and Turing Machine.

c) Discuss the difference between the input tapes of Turing Machine and Post Machine.

Q.3. Questions with long answers. (6 x 5 = 30)

a) Construct a Turing Machine which will double every 'b' in all inputted string over L = {a,b}

b) Construct PDA for the language PALINDROME over {c, d}.

c) Construct MOORE machine (an FA with output) which can subtract any two inputted binary

strings.

d) Give the Regular Expression and FA for the language ODD-EVEN.

e) Write the CFGfor the Language a"bmdmc"; m, n ~o

f) Write the Context Sensitive Grammar for language c"a"bn; n ~o