0% found this document useful (0 votes)
65 views6 pages

Toc Assignment 2 Part 1

This document contains a series of theory questions and practical exercises related to regular expressions and finite automata in the field of computer science. It covers topics such as applications of regular expressions, properties of regular languages, and the design of deterministic finite automata (DFA). Additionally, it includes specific tasks for writing regular expressions and designing DFAs for various languages and conditions.

Uploaded by

simantakasaju
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)
65 views6 pages

Toc Assignment 2 Part 1

This document contains a series of theory questions and practical exercises related to regular expressions and finite automata in the field of computer science. It covers topics such as applications of regular expressions, properties of regular languages, and the design of deterministic finite automata (DFA). Additionally, it includes specific tasks for writing regular expressions and designing DFAs for various languages and conditions.

Uploaded by

simantakasaju
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

Chapter 2

Theory Question
1. What are the applications of regular expression?
2. What are the properties of regular language?
3. Regular languages are closed under union, concatenation,
difference, complementation, and Kleene star operation.
4. Discuss the importance of finite automation in the field of
computer science.
5. Explain all the theories related to TOC (Automata,
computability, complexity).
6. DFA is a language recognizer prove it.
7. Write short notes on
a. Computational Complexity
b. Regular expression vs regular language
c. Alphabet and Language

Write regular expressions for the following problems:


1. The language that contains the set of all strings accepting either ab or ba over
the alphabet Σ=(a,b).
2. The language that contains the set of all strings starting with “01” over the
alphabet Σ=(0,1).
3. L ={w 𝛜 (0 , 1)* , w ends with “01”}.
4. L ={w 𝛜 (0 , 1)* , w either starts with “01” or ends with “01”}.
5. L ={w 𝛜 (0 , 1)* , w starts and ends with “01” }.
6. Write the regular expression for the language starting with a but not having
consecutive b's.
7. Write the regular expression for the language accepting all the strings in which
any number of a's is followed by any number of b's is followed by any number
of c's.
8. Write the regular expression for the language L over ∑ = {0, 1} such that all
the strings do not contain the substring 01.

1
Prepared by: Er. Simanta kasaju
9. Write the regular expression for the language containing the string in which
every 0 is immediately followed by 11.
10.Divisible by 5
11.9th symbol from RHS is a
12.The 22th symbol from LHS is b
13.Contains exactly 3 a’s or na(w)=3
14.At most 4 a’s or na(w)<=4
15.At least 3b’s or nb(w)>=4
16.Even no. of b
17.|w|>=2
18.|w|<=2
19.|w| mod 4=0
20.|w| mod 2=1
21.Even no. of a and even no. of b.
22.Even no. of a or even no. of b.
23.All words that contain at least 2 a’s or 2 b’s.
24.All words that don’t end at ba.
25.All words that contain exactly one 1 or exactly 1 b.
26.The number of a and number of b should be the same.
27. No 2 a’s should come together.
28.L={a2nb2m+1 | n>=0 ,m>=0}
29.L={a2n+1 | n>0}
30.L={a,bb,aa,abb,ba,bbb}
31.L={b2 , b5 , b8 , ….. }
32.L={w∈(0 , 1)*| w has no pair of consecutive zeros}
33.L={01,10,0101,101010}
34.String that doesn’t have aab as its substring over an alphabet.
35.L={anbm :n>=1 ,m>=1,nm>=3}
36.

Design of DFA and minimization


(For the Design of DFA just make a state diagram)
1. Design a DFA that accepts the set of all strings that consist of exactly one ‘a’.
OR

2
Prepared by: Er. Simanta kasaju
Design a DFA for the language, L={w : na=1,w ∈(a , b)*}
2. Design a DFA that accepts the set of all strings that consist of at least one ‘a’.
OR
Design a DFA for the language, L={w : na(w)≥1,w ∈(a , b)*}
3. Design a DFA that accepts the set of all strings that consist of at most three
no of a’s.
OR
Design a DFA for the language, L={w : na(w)≤3,w ∈(a , b)*}
4. Design a DFA that accepts the set of all strings that consist of odd no of a’s
and any no of b’s.
5. Design a DFA that accepts the set of all strings that consist of any no of a’s
and odd no of b’s.
6. Design a DFA that accepts the set of all strings that consist of even no of a’s
and any no of b’s.
7. Design a DFA that accepts the set of all strings that consist of any no of a’s
and even no of b’s.
8. Design a DFA and also NFA that accepts the language given by L= {wϵ{0,1} : *

w does not contain four consecutive 0’s}. Hence test your design for 0100001
and 0101111.
9. Design a DFA over alphabet {a,b} that has the set of all strings which contains
the substring aba.
10.Construct deterministic finite automata accepting each of the following
languages. {w є {a, b} : each a in w is immediately preceded and immediately
followed by a "b" }.
11.{w є {a, b} : w has abab as a substring}
12.{w є {a, b} : w has both ab and ba as substrings}.
13.Design a DFA that accepts the language L= { x ∈ {0,1}* : the third bit from
the left is 1 in x}.
14.Design a DFA that accepts the language L= { x ∈ {0,1}* : 0110 does not
occurs as a substring in x}
15.Design a DFA that accepts the language L= { x ∈ {0,1}* : 0110 occurs as
a substring in x}
16.Given ∑= {a, b}, construct a DFA that shall recognize the language L ={b mabn
:m, n ≥0}.

3
Prepared by: Er. Simanta kasaju
17.Design a DFA, the language recognized by the Automaton being L ={anb:n ≥
0}
18.Obtain the DFA that accepts/recognizes the language L(M) = {w | w = {a, b,
c}* and w contains the pattern abac}
19.Given ∑={a, b}, construct a DFA which recognize the language L ={ambn :m, n ≥0}.
20.Design a DFA that accepts the string given by L={ w є {a, b}*: w has the number of
a divisible by 3 and the number of b divisible by 2. }
21.Convert the following Regular Expression to equivalent Finite automata
a. ((a+b)(a+b))*
b. (a*bab*ba)* U (b*ab)
22.From the model question
a. 2023 fall 1(b),2(a)
b. 2023 spring 2(a,b)
c. 2022 fall 2(a,b)
d. 2021 spring 1(b)
e. 2021 fall 1(a)
f. 2020 fall 1(b) ,2(a)
g. 2019 spring 1(a,b)
h. 2019 fall 1(a)
i. 2018 spring 1(b),2(a)
j. 2017 spring 1(a,b)
k. 2017 fall 1(a,b)
l. 2016 fall 1(a)
23. Minimize following DFA
a.

4
Prepared by: Er. Simanta kasaju
b.

5
Prepared by: Er. Simanta kasaju
c.

6
Prepared by: Er. Simanta kasaju

You might also like