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

ToC Test Questions

Uploaded by

Lalitha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

ToC Test Questions

Uploaded by

Lalitha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Regular expression for the language L = { w ∈ {0, 1}* | w has no pair of consecutive

zeros} is *
2 points

(A) (1 + 010)*
(B) (01 + 10)*
(C) (1 + 010)* (0 + λ)
(D) (1 + 01)* (0 + λ)

The language L = {an bn am bm | n ≥ 0, m ≥ 0} is


Context free but not linear
(B) Context free and linear
(C) Not Context free and not linear
(D) Not Context free but linear

TOC Test 1
* Required

Email address *

1. Consider the following language families:L1 = The context – free languagesL2 =


The context – sensitive languagesL3 = The recursively enumerable languagesL4 =
The recursive languagesWhich one of the following options is correct? *
2 points

(1) L1 ⊆ L2 ⊆ L3 ⊆ L4
(2) (2) L2 ⊆ L1 ⊆ L3 ⊆ L4
(3) L1 ⊆ L2 ⊆ L4 ⊆ L3
(4) (4) L2 ⊆ L1 ⊆ L4 ⊆ L3

2. Consider Σ={w,x} and T={x,y,z}. Define homomorphism h by:h(x)=xzyh(w)=zxyyIf


L is the regular language denoted by r = (w + x*)(ww)*, then the regular language
h(L) is given by *
2 points

(1) (zxyy + xzy)(zxyy)


(2) (2) (zxyy + (xzy)*)(zxyy zxyy)*
(3) (zxyy + xzy)(zxyy)*
(4) (4) (zxyy + (xzy)* (zxyy zxyy)

3. Consider the following grammars:G1: S→aSb | bSa | aaG2: S→aSb | bSa | SS |


λG3: S→aSb | bSa | SS | aG4: S→aSb | bSa | SS | SSS | λWhich of the following is
correct w.r.t. the above grammars? *
2 points
(1) G1 and G3 are equivalent
(2) G2 and G3 are equivalent
(3) G2 and G4 are equivalent
(4) G3 and G4 are equivalent

4. Consider the following statements with respect to the language L = {anbn | n ≥ 0}


Which one of the following is correct? *
2 points

(1) only S1 and S2


(2) (2) only S1 and S3
(3) only S2 and S3
(4) S1, S2 and S3

5. Match List-I with List-II:where L1 : Regular languageL2 : Context-free


languageL3 : Recursive languageL4 : Recursively enumerable language *
2 points

(a) A-2, B-1, C-3


(b) (b) A-2, B-3, C-1
(c) A-3, B-1, C-2
(d) A-1, B-2, C-3

6. let r = a(a + b)*, s = aa*b and t = a*b be three regular expressions.Consider the
following:(i) L(s) ⊆ L(r) and L(s) ⊆ L(t)(ii) L(r) ⊆ L(s) and L(s) ⊆ L(t)Choose the
correct answer from the code given below:Code: *
2 points

(1) Only (i) is correct


(2) Only (ii) is correct
(3) Both (i) and (ii) are correct
(4) Neither (i) nor (ii) is correct

7. Consider the language L given byL = {2nk ∣ k>0, and n is non-negative integer
number}The minimum number of states of finite automaton which accepts the
language L is *
2 points

(1) n
(2) n+1
(3) n(n+1)/2
(4) 2n

8. Consider the following two languages:L1 = {x ∣ for some y with ∣y∣ = 2∣x∣,xy ∈ L
and L is regular language}L2 = {x ∣ for some y such that ∣x∣ = ∣y∣, xy ∈ L and L is
regular language}Which one of the following is correct? *
2 points

(1) Only L1 is regular language


(2) Only L2 is regular language
(3) Both L1 and L2 are regular languages
(4) Both L1 and L2 are not regular languages

9. The finite state machine given in figure below recognizes: *


2 points

(1) any string of odd number of a’s


(2) any string of odd number of b’s
(3) any string of even number of a’s and odd number of b’s
(4) any string of odd number of a’s and odd number of b’s

10.Which of the following regular expressions, each describing a language of


binary numbers (MSB to LSB) that represents non-negative decimal values, does
not include even values?Where {+, *} are quantification characters. *
2 points

(1) 0*1+0*1*
(2) 0*1*0+1*
(3) 0*1*0*1+
(4) 0+1*0*1*

11. Pumping lemma for regular language is generally used for proving: *
2 points

(1) whether two given regular expressions are equivalent


(2) a given grammar is ambiguous
(3) a given grammar is regular
(4) a given grammar is not regular
12.Which of the following strings would match the regular expression: p+[3-
5]*[xyz]? I. p443y Il. p6y III. 3xyz IV. p35z V. p353535x Vl. ppp5 *
2 points

(1) I, III and Vl only


(2) IV, V and VI only
(3) II, IV and V only
(4) I, IV and V only

13. Which of the following are not regular?(A) Strings of even number of a’s.(B)
Strings of a’s, whose length is a prime number.(C) Set of all palindromes made up
of a’s and b’s.(D) Strings of a’s whose length is a perfect square. *
2 points

(1) (A) and (B) only


(2) (A), (B) and (C) only
(3) (B), (C) and (D) only
(4) (B) and (D) only

14. Consider the languages L1 = ϕ, and L2 = {1}. Which one of the following
representsL1* U L2* L1* ? *
2 points

(1) {ε}
(2) {ε,1}
(3) ϕ
(4) 1*

15.The number of strings of length 4 that are generated by the regular expression
(0+1+|2+3+)*, where | is an alternation character and {+, *} are quantification
characters, is: *
2 points

(A) 08
(B) 09
(C) 10
(D) 12

16. Given the following two languages:L1 = {uwwRn | u, v, w ϵ {a, b}+}L2 = {uwwRn
| u, v, w ϵ {a, b}+, |u| ≥ |v|}Which of the following is correct ? *
2 points

(A) L1 is regular language and L2 is not regular language.


(B) L1 is not regular language and L2 is regular language.
(C) Both L1 and L2 are regular languages.
(D) Both L1 and L2 are not regular languages.

17. The number of strings of length 4 that are generated by the regular expression
(0|∈) 1+2* (3|∈), where | is an alternation character, {+, *} are quantification
characters, and ∈ is the null string, is: *
2 points

(A) 08
(B) 10
(C) 11
(D) 12

18. Minimal deterministic finite automaton for the language L={ 0n | n≥0, n≠4 } will
have: *
2 points

(A) 1 final state among 5 states


(B) 4 final states among 5 states
(C) 1 final state among 6 states
(D) 5 final states among 6 states

19. The regular expression corresponding to the language L whereL={x∈{0,1}* | x


ends with 1 and does not contain substring 00 } is: *
2 points

(A) (1 + 01)* (10 + 01)


(B) (1 + 01)* 01
(C) (1 + 01)* (1 + 01)
(D) (10 + 01)* 01

20. Given the following two languages:

L1 = {a^nb^n|n≥0, n≠100}
L2 = {w ϵ {a,b,c}*| na(w) = nb(w) = nc(w)}

Which of the following options is correct? *


2 points

a.Both L1 and L2 are not context free language


b.Both L1 and L2 are context free language
c.L1 is context free language, L2 is not context free language
d.L1 is not context free language, L2 is context free language

21. The regular expression corresponding to the language L where L = { x ∈{0, 1}* |
x ends with 1 and does not contain substring 00 } is : *
2 points

a.(1 + 01)* (10 + 01)


b.(1 + 01)* 01
c.(1 + 01)* (1 + 01)
d.(10 + 01)* 01

22.The language L = {an bn am bm | n ≥ 0, m ≥ 0} is *


2 points

(A) Context free but not linear


(B) Context free and linear
(C) Not Context free and not linear
(D) Not Context free but linear

23.Regular expression for the language L = { w ∈ {0, 1}* | w has no pair of


consecutive zeros} is *
2 points

(A) (1 + 010)*
(B) (01 + 10)*
(C) (1 + 010)* (0 + λ)
(D) (1 + 01)* (0 + λ)

24. The word 'formal' in formal languages means *


2 points

A.the symbols used have well-defined meaning


B.they are unnecessary, in reality
C.only form of the string of symbols is significant
D.Both (a) and (b)

25.Finite state machine can recognize *


2 points

A.any grammar
B.only context-free grammar
C.Both (a) and (b)
D.only regular grammar

Submit
Page 1 of 1
This content is neither created nor endorsed by Google. Report Abuse - Terms of
Service - Privacy Policy

Forms

You might also like