You are on page 1of 2

COMSATS University Islamabad, Wah Campus

Terminal Examinations Spring 2021


Department of Computer Science

Program/Class:BS(CS)-6A,B,C,D,MCS 2____ Date: __07/07/2021_________________________


Subject: _Automata Theory_____________________ Instructor:_Waheed A.Khan _________________
Total Time Allowed: ____3.5 hours_____________ Maximum Marks: ______50____________________
Student Name: _______________________________ Registration#: _______________________________

Attempts all questions. (marks=50)


Q.NO.1. (C2) (9)
a. Build the FA for language which does not start and end in double letter (aa or bb).
b. Build FA for language which starts and ends in same letters and containing substring aaa or bbb.
c. Build an FA that accepts only those words that have fewer than or equal to four letters over alphabets 0’s
and 1’s.
Q.NO.2. Suppose we have the machine FA1, which accepts the language of all words over the alphabet = {a, b} that
do not have a double a or double b somewhere in them, and the machine FA2, which accepts all words that have
both an even number of total a's and an even number of total b's (this is the language EVEN-EVEN). Find FA3 that
accepts the language defined by the regular expression (FA1 Ո FA2), (FA2. FA1), (FA1)*.

(C2) (3+3+3= 9)

Q.NO.3. convert the given DFA into Regular Expression using Kleene’s Theorem part 2

(C2) (4)

II) Draw Mealy Machine which take binary number from user and count how many times substrings
1101 . (C2) (3)
Q.NO.4. (C3) (15)
a. i) Design CFG of the language that start and end with the double letters (aa 0r bb), then convert that CFG in
its equivalent FA.

1
ii) Build an FA that accepts only those words in which letter a occurs in multiple of 4 and also convert that FA
to CFG.

b. Convert The Following CFG( context Free Language) into CNF (Chomsky Normal Form)
S  ASA|BSB|aB|D

A  B|S
D a
B  b|

Q.NO.5. . (C4) (10)


a. Define Turing Machine Draw an example of Turing machine.
Define PDA and draw PDA (Pushdown Automata) of following Language
i J k
L= { 0 1 2 | i,j,k > 0 and i= j or i = k}

You might also like