Automata Revision Ans
Automata Revision Ans
Automata Revision Ans
Question 2. Let’s consider Σ = {a, b, c} and L = {a, aab, bbc, ba}. Which string does not belong to L4 ?
A aababbc B baaaaab C abaaabba D abbcaab
Questions from 3–9, consider the language L determined by finite automata on {a, b} as follows.
a
b
0 1
a, b b
a
3 a 2 b
Question 8. When using determinisation algorithm to convert NFA into DFA, how many states are there in the
new DFA?
A 6 B 7
C 10 D None of the others.
Question 9. How many states are there in the minimized/optimized DFA (which is equivalent to the above NFA)
?
A 6 B 7
C 10 D None of the others.
Question 11. Are two regular expressions E1 = (a + b)∗ and E2 = (aa + ab + ba + bb)∗ are equivalent? If not, give
a counter-example.
A They present the same language
B E1 ⊆ E2
C They are not equivalent, the counter-example is a
D They are not equivalent, the counter-example is aa
Question 12. Do two regular expression E3 = ((a + b)∗ (ac)∗ )∗ and E4 = (a + aa + ba + b + c)∗ present the same
language? If not, give a counter-example.
A They present the same language
B E4 ⊆ E3
C They are not equivalent, the counter-example is cc.
D They are not equivalent, the counter-example is aa.
Question 13. Do the following automata and regular expression E = ((aa)∗ + bb∗ a(aa)∗ b(ab)∗ )∗ present the same
language? If not, give a counter-example.
q0
b
a a
q1 q2
a
b
A They present the same language.
B They are not equivalent, the counter-example is baa.
C They are not equivalent, the counter-example is ε.
D They are not equivalent, the counter-example is bab.
Question 14. Which the method is used to determine the equivalent property of two given finite automatas (FA)?
A Compare the number of states between two FAs.
B Compare transition table of two new FAs that have been minimized from two given FAs.
C Verify all posible cases based on transition table of two FAs.
D Check through equivalent regular expressions.
b ε
0 1 2
b a
5 a, ε 4 a 3 b
A X = a∗ ba∗ , Y = b∗ ab∗ a, Z = X(Y (a + b)X)∗ + XY ((a + b)XY )∗
B X=a∗ ba∗ b∗ a, Y = b∗ a, Z = X(Y (ab + b)X)∗ + XY ((ab + b)XY )∗
C X=a∗ b, Y = a∗ b∗ ab∗ a, Z = X(Y (ab + b)X)∗ + XY ((ab + b)XY )∗
D X = a∗ b, Y = a∗ + a∗ b∗ ab∗ a, Z = X(Y (ab + b)X)∗ + XY ((ab + b)XY )∗
E X = a∗ ba∗ , Y = b∗ ab∗ a, Z = X(Y (ab + b)X)∗ + XY ((ab + b)XY )∗
Question 17. Which of the following strings can not be in L∗ with L is the following automata?
b
a a
A B C D
b a b a b
E F G
b
A aababba B bbaaaa C aaaabb D abaababab
Question 18. Which of the following is a counter-example that shows that the two automata below are not
equivalent?
a
A B E a F
b
a
a b a b b a a
a
a
D C H G
a
b b
A abaab B baaab C babb D abbaa
Question 20. Let S and T be languages over Σ = {a, b} represented by the regular expressions (a + b∗ )∗ and
(a + b)∗ respectively. Which of the following is true?
A S⊂L B S=T C T ⊂S D S∩T
1 0 0, 1
0
0 1
Let S denote the set of seven bit binary strings in which the first, the fourth, and the last bits are
1. The number of strings inS that are accepted by M is
A 8 B 5 C 7 D 10
1
0
Let the language accepted by M be L. Let L1 be the language accepted by the NFA M1 , obtained
by changing the accepting state of M to a non-accepting state and by changing the non-accepting
state of M to accepting states.
Which of the following statements is true?
∗
A L1 = {0, 1} \L B L1 ⊆ L C L1 = L D L1 = {0, 1}∗
Question 23. The following finite state machine accepts all those binary strings in which the number of 1’s and
0’s are respectively.
1
1 1
0 0 0 0 0 0
1 1
1
A divisible by 3 and 2. B odd and even.
C even and odd. D divisible by 2 and 3.
Question 24. Consider the languages L1 = ∅ and L2 = {a}. Which one of the following represents L1 L∗2 ∪ L∗1 ?
A ∅ B {ε} C {a∗ } D {a, ε}
ε
a ε
A ∅ B {ε} C {a∗ } D {a, ε}
Question 26. Match the following NFAs with the regular expressions they correspond to:
1.ε + 0(01∗ 1 + 00)∗ 01∗ 2. ε + 0(10∗ 1 + 10)∗ 1
∗ ∗
3.ε + 0(10 1 + 00) 0 4. ε + 0(10∗ 1 + 10)∗ 10∗
1 1
1 0
0 1
0 0 1 0
P R
1 1
0 0
1 1
0 0 1 0
Q S
A P − 2, Q − 1, R − 3, S − 4 B P − 1, Q − 3, R − 2, S − 4
C P − 3, Q − 2, R − 1, S − 4 D P − 1, Q − 2, R − 3, S − 4
Question 28. What can be said about a regular language L over {a} whose minimal finite state automaton has
two states?
A L = {an |n is odd}
B L = {an |n is even}
C L = {an |n ≥ 0}
D Either L = {an |n is odd}, or L = {an |n is even}
Question 29. How many minimum states are required in a DFA to find whether a given binary string has odd
number of 0’s or not, there can be any number of 1’s.
A 1
B 2
C 3
D 4
b b
a, b
a a
a, b a, b
Which of the following finite state machines is a valid minimal DFA which accepts the same language
as D?
a, b
a b
a, b a, b
A B
b
a b
a
a, b a, b
a, b
a, b b
b
b a
a
a, b a, b
C D