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

Practice Questions Set 6

1. The question asks about the minimal DFA and NFA for the regular expression (0 + 1)*(00 + 11). The answer is that the minimal DFA would have 5 states while the minimal NFA would have either 4 or 5 states. 2. The question asks about the number of states in the minimal DFA that accepts the language (a + aaa)* over the alphabet {a,b}. The answer is that the minimal DFA would have 2 states. 3. The first statement is true - there does not exist a FA for every context-free language (CFL). The second statement provides an example of a language (L) that is context-free but not regular.

Uploaded by

Parth Ranjan Jha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Practice Questions Set 6

1. The question asks about the minimal DFA and NFA for the regular expression (0 + 1)*(00 + 11). The answer is that the minimal DFA would have 5 states while the minimal NFA would have either 4 or 5 states. 2. The question asks about the number of states in the minimal DFA that accepts the language (a + aaa)* over the alphabet {a,b}. The answer is that the minimal DFA would have 2 states. 3. The first statement is true - there does not exist a FA for every context-free language (CFL). The second statement provides an example of a language (L) that is context-free but not regular.

Uploaded by

Parth Ranjan Jha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

THEORY OF COMPUTATION

1. Consider this R.E. = (0 + 1)* (00 + 11)


What will be the number of states in minimal DFA and NFA?

(a) DFA – 5, NFA – 5 (b) DFA – 5, NFA – 4


(c) DFA – 4, NFA – 4 (d) None

2. Number of states in minimal DFA to accept the language (a + aaa)* over Ʃ = {a, b} ?

(a) 1 (b) 2
(c) 3 (d) None

3. Consider 2 statements:

S1: There doesn’t exist FA for every CFL.


S2: Let Ʃ = {a, b} and L = {an w an | n ≥ 1, w ∈ Ʃ*}

L is not regular but context free.

(a) Both are True (b) Both are False


(c) S1 → True, S2 → False (d) S1 → False, S2 →True

4. Consider this:

S1: r1 = (ԑ + a + b)100 represents strings of length strictly less than 100.


S2: r2 = (00 + 11 + 01 + 10)* (0 + 1) represents all odd length strings.

(a) Both are True (b) Both are False


(c) S1 → True, S2 → False (d) S1 → False, S2 →True

5. r1 = (01 + 1)* (ԑ + 0)
r2 = (0 + ԑ) (10 + 1)*

(a) Both represent same language

(b) r1 represents strings with no consecutive 00 and


r2 represents strings with no consecutive 11.

1
(c) r1 represents strings with no consecutive 11 and
r2 represents strings with no consecutive 00.

(d) None of above.

6. What will be number of states in DFA to represent r1 above?

(a) 2 (b) 3
(c) 4 (d) 5

7. S1: A non-deterministic TM can decide languages that a standard TM cannot decide.


S2: L be a context free language. 𝐿̅ is turing-decidable.

(a) Both are True (b) Both are False


(c) S1 → True, S2 → False (d) S1 → False, S2 →True

8. L = {ai bj ck dm} | i+j+k+m is multiple of 13}

L is ?

(a) Regular (b) Context-free


(c) Turing-decidable (d) Turing-Recognizable

9. Language L = {an bn w | n ≥ 0, w ∈ {c, d}*, |w| = n} is

(a) Regular (b) DCFL


(c) NCFL (d) Not context-free

10. Which of the following is true for i/p alphabet Ʃ and tape alphabet Γ of a standard TM?

(a) It is possible for Ʃ and Γ to be equal


(b) Γ is always a strict superset of Ʃ
(c) It is possible for Ʃ and Γ to be disjoint
(d) None

2
11. If L1 and L2 are Turing-Recognizable then L1 ∪ L2 will be

(a) Decidable
(b) Turing-recognizable but may not be decidable
(c) May not be Turing recognizable
(d) None of above

12.

Consider u = abbaba
v = bab
w = aabb

(a) It accepts u, v but not w (b) It accepts all


(c) It rejects all (d) It rejects u only

13. Consider the CFG:


S → aSa | bSb | a | b | ∈

Which of following strings is NOT guaranteed by grammar?

(a) aaaa (b) baba


(c) abba (d) babaaabab

14. R.E. best describing this below NFA?

(a) (a + b)* a (a + b) b (b) (a + b)+ a (a + b) b

3
(c) (a + b)* a (a + b) b(a + b)* (d) (a + b)*

15. Let L be CFL and M a regular language. Language L ⋂ M is always

(a) always regular (b) never regular


(c) always DCFL (d) always context free language

16. Which of the following is accepted by NPDA but Not by DPDA?

(a) {an bn cn | n ≥ 0} (b) {an bn | n ≥ 0}


(c) {an bm | m, n ≥ 0} (d) {al bm cn | l ≠ m or m ≠ n}

17. Which of the following statements about regular languages is Not true?

(a) Every language has a regular subset


(b) Every language has a regular superset
(c) Every subset of regular language is regular
(d) Every subset of finite language is regular

18. Consider the CFG below:

S → aSAb | ԑ
A → bA | ԑ

Grammar generates:

(a) (a + b)* · b (b) am bn | m ≤ n


(c) am bn | m = n (d) a* b*

19. Consider regular grammar:


S → bS | aA | ԑ
A → aS | bA

Myhill-Nerode equivalence classes for language generated by grammar are

(a) {w ∈ (a + b)* | #a (w) is even} and {w ∈ (a + b)* | #a (w) is odd}


(b) {w ∈ (a + b)* | #b (w) is even} and {w ∈ (a + b)* | #b (w) is odd}

4
(c) {w ∈ (a + b)* | #a (w) = #b (w)} and {w ∈ (a + b)* | #a (u) ≠ #b (w)}
(d) {ԑ}, {wa | w ∈ (a + b)* and wb | w ∈ (a + b)*}

20. L ⊆ Ʃ*, Ʃ = {a, b}

True?

(a) L = {x | x has equal a’s and b’s} is regular


(b) L = {an bn | n ≥ 1} is regular
(c) L = {x | x has more a’s than b’s} is regular
(d) L = { am bn, m,n ≥ 1} is regular

21. Which of the following R.E. are equivalent?

i. (00)* (ԑ + 0)
ii. (00)*
iii. 0*
iv. 0(00)*

(a) i and ii (b) ii and iii


(c) i and iii (d) iii and iv

22. Define init (L) = {set of all prefixes of L}


Let L = {w | w has equal number of 0’s and 1’s}

init (L) is:

(a) all binary strings with unequal number of 0’s and 1’s
(b) all binary strings with ԑ-string
(c) all binary strings with exactly | more 0 than the number of 1’s
or one more | than number of 0’s
(d) None of above

You might also like