0% found this document useful (0 votes)
55 views

Assignment 2

This document contains an assignment on theory of automata. It asks the student to write regular expressions and draw deterministic finite automata (DFAs) for 5 languages over different alphabets. The languages are: (a) strings not ending in "aa", (b) strings with an even number of b's, (c) strings not containing the substring "ba", (d) strings where every odd position is 0, and (e) strings where the length is divisible by 3 or ends in "00". The student provides the requested regular expressions and sketches of the corresponding DFAs for each language.
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)
55 views

Assignment 2

This document contains an assignment on theory of automata. It asks the student to write regular expressions and draw deterministic finite automata (DFAs) for 5 languages over different alphabets. The languages are: (a) strings not ending in "aa", (b) strings with an even number of b's, (c) strings not containing the substring "ba", (d) strings where every odd position is 0, and (e) strings where the length is divisible by 3 or ends in "00". The student provides the requested regular expressions and sketches of the corresponding DFAs for each language.
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
You are on page 1/ 5

Assignment #02

Theory of Automata

5-C

BY: Syed Mohammad Ali – 70066816.


To: Sir Naveed Ahmed Khan
Due date: 16 December, 2020.
Question#01: Write Regular Expressions & then make DFA’s for the following
languages (Over the alphabet Σ = {a, b} for first three parts (a), (b), (c) and Σ = {0,
1} for last two parts (d), and (e).

(a) All strings that do not end with aa.

R.E:  + a + b + ( a + b )* ( ab + ba + bb)

b a
𝑞0 𝑞1

a
b

𝑞2
a
(b) All strings that contain an even number of b’s

R.E: a* (ba* ba* )*

a
b
a
𝑞0 𝑞1

(c) All strings which do not contain the substring ba.

R.E: a*b*

b
a
b a,b
𝑞0 𝑞1
𝑞2
a
(d) {w| every odd position of w is a 0} (the first position is always position 0,
similar to an array).

R.E: (0(1 + 0))* (0 + )

0,1
1 0,1
𝑞0
𝑞1 𝑞𝑇
0
(e) {w| |w| is divisible by 3 or it ends in 00}.

0
𝑞0 0 0
𝑞1 1
𝑞2 𝑞3
v
1
0

1
0
1
𝑞4 𝑞5
0
1

0 1

0
𝑞6
𝑞7

You might also like