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

Assignment 2

This document contains an assignment on finite automata with 45 questions. The questions ask students to design deterministic finite automata (DFAs) and non-deterministic finite automata (NFAs) that accept specific languages over various alphabets. They also ask students to convert NFAs to equivalent DFAs and vice versa. The questions cover basic concepts in finite automata theory like DFAs, NFAs, languages, strings, and regular expressions.

Uploaded by

Sujan Thapaliya
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)
47 views

Assignment 2

This document contains an assignment on finite automata with 45 questions. The questions ask students to design deterministic finite automata (DFAs) and non-deterministic finite automata (NFAs) that accept specific languages over various alphabets. They also ask students to convert NFAs to equivalent DFAs and vice versa. The questions cover basic concepts in finite automata theory like DFAs, NFAs, languages, strings, and regular expressions.

Uploaded by

Sujan Thapaliya
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/ 6

Theory of Computation

By: Assistant Professor Lok Nath Regmi

Assignment -2

Finite Automata

1. Differentiate between DFA and NFA? Design a DFA that accepts the language given by L=
{w ϵ {0, 1} *: w has neither ‘00’ nor ‘11’ as substring}. Hence test your design for 01011010.
2. 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.
3. Design a DFA and also NFA that accepts the language given by L= {w ϵ {0,1}*: w contains
‘0110’ or ‘1001’ as substring. Hence test your design for 01011100 and 1010011.
4. Design a DFA that accepts a language given by L = {w ϵ {a,b}* : w has no. of ‘a’ multiple of
3}
5. Design a NFA over {a,b} that accepts strings containing occurrence of pattern ‘bb’ or ‘bab’ .
6. What is the significance of finite automata? Design a DFA that accepts the strings over an
alphabet that either start with 01 or end 01. Hence test your design for any two strings.
7. Explain finite automata and their application. Design a DFA that accepts the Language L= {w
ϵ {a, b}: w 'must have either aaa or bbb as a substring.
8. Construct a NFA for the language (ab*a U b*aa). Provide any two accepted strings and two
rejected strings.
9. Why is NDFA important although it is equivalent to a DFA? Design NDFA which such that
W contains either two consecutive a's or two consecutive b's.
10. Design a DFA accepting strings over the alphabet {0,1} defined by {0 0} * {11} *.
11. Construct a DFA over {a, b} accepting strings having even number of 'a' and odd number of
b.
12. Design a DFA that accepts the language given by L = {w {0, 1} *: w begins with 0 and ends
with 01. Your design should accept strings like 010, 01110, 000010, 0101 1010 and should
not accept strings like 1010, 0011, 01011.
13. Design a Deterministic Finite Automata (DFA) for the regular expression (a(ab)*b)*. your
design by taking one accepted and one rejected string.
14. Design an NDFA for a language defined as (baUb)* U(bbUa*). Give two strings that are,
accepted by this NIDFA and two rejected strings.
15. Construct DFA, which accepts set of all strings over {0, 1} which interpreted as binary
number is divisible by 3.
16. Construct DFA, which accepts set of all strings over {0, 1} which interpreted as binary
number is divisible by 2.
17. Construct DFA, which accepts set of all strings over {0, 1} which interpreted as binary
number is divisible by 4.
18. Design a DFA over w ∈ {a,b}* such that number of a = 2 and there is no restriction over
length of b
19. Design a DFA in which number of a’s are divisible by 2. And input alphabet is {a,b}.
20. Design a DFA such a way that Let string is w, Number of a(w) mod 2 = 0 and Number of
b(w) mod 2 = 0. This means number of a should be divisible by 2 as well as number of b
should also be divisible by 2.
21. Design a DFA in which every 'a' should be followed by 'b'.
22. Design a DFA such that: L = {anbm | n,m ≥ 1} Given: Input alphabet, Σ={a, b}.
23. Design a DFA such that: L = {anbm | n,m ≥ 0} Given: Input alphabet, Σ={a, b}.
24. Design a DFA such that: L = {anbmcl | n,m,l ≥ 1} Given: Input alphabet, Σ={a, b, c}.
25. Design a DFA such that:L = {anbmcl | n,m,l ≥ 0} Given: Input alphabet, Σ={a, b, c}.
26. Design a NFA of all binary strings in which 2nd last bit is 1.
27. Design an NFA with ∑ = {0, 1} accepts all string ending with 01.
28. Construct an NFA with ∑ = {0, 1} in which a substring “double ‘ ’ is followed by
single ‘ ’” must exist.
29. Construct an NFA in which all the strings contain a substring 1101.
30. Convert the following Non-Deterministic Finite Automata (NFA) to Deterministic Finite
Automata (DFA)

31. Convert the following Non-Deterministic Finite Automata (NFA) to Deterministic Finite
Automata (DFA)

32. Convert the following Non-Deterministic Finite Automata (NFA) to Deterministic Finite
Automata (DFA)
33. Consider a Non-deterministic finite automata (NFA) and convert that NFA into equivalent
Deterministic Finite Automata (DFA).

34. Convert the following NFA into it's equivalent DFA.

35. Convert the following NDFA to its DFA.


36. Convert the following NFA into it's equivalent DFA.

37. Convert epsilon-NFA to NFA

38. Convert the NFA with ε into its equivalent DFA.


39. Convert the NFA with ε into its equivalent NFA.

40. Convert the following ε-NFA to its equivalent NFA.

41. Convert the following ε-NFA to its equivalent NFA.


42. Compare FA, NFA and NFA-^ with illustration.
43. Prove that for any given NFA N accepting a language L there exists a DFA D such that L(N) = L(D).

44. Prove that any regular language can be accepted by a finite automata with all details.

45. Design a constructive method to prove that the complement of the language accepted by an NFA is
accepted by a DFA.

You might also like