0% found this document useful (0 votes)
54 views7 pages

Automata Theory Exam Answers 2020

Uploaded by

Rameez Fazal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views7 pages

Automata Theory Exam Answers 2020

Uploaded by

Rameez Fazal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sir Syed University of Engineering & Technology

ANSWER SCRIPT

Date: 09-NOV-2020
Roll Number: 2019-SE-213
Section: E
Name: Muhammad Rameez
Course Name: SWE-202 Automata Theory & Formal Language
Degree Program: BS Software Engineering
Total number of pages
7
being submitted:

Answer 1:

a) Roll-No: 2019-SE-213
Last 2 digit of my roll no: 13
Binary of 13 = 1101.
Q = No of states.
E = Finist set of symbols
ϕ = Past state to present state.
Q0 = initial
Q1 = start with 1
Q2 = start with 11
Q3 = start with 110
Q4 = start with 1101
State 0 1
E Q0 E0 E1
1 Q1 10 11
11 Q2 110 111
110 Q3 1100 1101
1101 Q4 11010 11011

0
1
1
Q0 Q1 1 Q2
0
0 1
0

Q3

1
0
Q4

Page 1 of 7
b) Build an FA
i. FA that accepts the string that ends with ‘a’.

a, b

Q0 a Q1

ii. FA that accept odd numbers of b’s.


a
Q0 Q1
a
b b
b b
a
Q2 Q3
a

iii. FA that accept double letter.


a

a
Q0 Q1 Q2 Q3
b

b a, b
b a

Page 2 of 7
Answer 2:
a) I used javapoint and lectures and slides while studying ATFL. Lectures teached by
our teachers were very helpful. They were very expresive and teachers elaborated the
lecture in a very esay to understand manner.

b) I learn from which the teachers have taught, and a bit self leaning from internet
sources using examples etc.

c) My goals were to able to understand how to define languages; construct finite


automata for problems wheater a string is in a language or not. Yes, I have almost
achieved what I wanted to learn in this course.

d) We can improve it by using it what we learn to solve our problems in computer


science.

e) Yes, I though it mind be a dull subject, but in reality it tells us how the machine
works.

Page 3 of 7
Answer 3:

a) Roll-No: 2019-SE-213.
First Digit of my roll no = 2
Binary of 2 = 10.
Expression: (Q, ∑, δ, Q0, F)
Q = (Q0, Q1, Q2)
∑ = {10}
δ = Q x E - 2n
Q0 = Q0
F = Q2
Q0 = Initial
Q1 = 1
Q2 = 10

States 0 1
Q0 Q1 [Q1, Q2]
Q1 Q1 Q2
Q2 Q3 Q2
Q3 Q1 Q2

0 1
0, 1 0
Q0 Q1 1 Q2 Q3
1

Page 4 of 7
b)
NFA DFA
NFA stands for Nondeterministic finite DFA stands for Deterministic finite
automation. automation.
No need to specify how the NFA reacts There is only one state transition for
according to some symbol. each transition for each symbolic
representation of alphabet.
Can use empty string transition. Cannot use empty string transition.
Easier and require less space. Difficult and require more space
All NFA are nor DFA All DFA are NFA

I prefer NFA because DFA is just a special case of NFA that happens not to have any
null transition or multiple transition on the same symbol. Therefore, DFA are not
more powerful than NFAs.

Example:
0, 1
i. NFA
0
A B

ii. DFA
0, 1

0
A B

0, 1
C

Page 5 of 7
Answer 4:

a) Name = Rameez (ra)


RE = (a +b)* ra (a+b)*
b) Name = Rameez (ra)
RE = a * r
c) RE = (1 + a) (ba) * (1 + b)
d) (a + b) [(a +b) (a + b)]*
e) RE = (1 + a) (ba) * (1 + b)

Page 6 of 7
Answer 5:

a) Roll-No: 2019-SE-213
Binary of 213 = 11010101
Last four binary = 0101
Q = {Q0, Q1, Q2, Q3, Q4}
E = {0, 1}
∆ = {a, b}

0 1 Output
E Q0 Q0 Q1
0 Q1 Q1 Q2 b
01 Q2 Q1 Q2 a
010 Q3 Q3 Q4 b
0101 Q4 Q0 Q3 a

Page 7 of 7

You might also like