wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

TOC Unit-4

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Inorder to simplify a context free grammar, we can skip the following operation:

a)

Removal of null production

b)

Removal of useless symbols

c)

Removal of unit productions

d)

None of the mentioned

2.

In context to the process of removing useless symbols, which of the following is correct?

a)

We remove the Nullable variables

b)

We eliminate the unit productions

c)

We eliminate products which yield no terminals

d)

All of the mentioned

3.

Given grammar G:

S->aS|A|C

A->a

B->aa

C->aCb

Find the set of variables that can produce strings only with the set of terminals.

a)

{C}

b)

{A,B}

c)

{A,B,S}

d)

None of the mentioned

4.

Suppose A->xBz and B->y, then the simplified grammar would be:

a)

a) A->xyz

b)

b) A->xBz|xyz

c)

c) A->xBz|B|y

d)

d) none of the mentioned

5.

The variable which produces an epsilon is called:

a)

a) empty variable

b)

b) nullable

c)

c) terminal

d)

d) all of the mentioned

6.

Which among the following is the format of unit production?

a)

a) A->B

b)

b) A->b

c)

c) B->Aa

d)

d) None of the mentioned

7.

Given grammar:

S->aA

A->a

A->B

B-> A

B->bb

Which of the following is the production of B after simplification by removal of unit productions?

a)

a) A

b)

b) bb

c)

c) aA

d)

d) A| bb

8.

Which of the production rule can be accepted by Chomsky grammar?

a)

a) A->BC

b)

b) A->a

c)

c) S->e

d)

d) All of the mentioned

9.

Let G be a grammar: S->AB|e, A->a, B->b

Is the given grammar in CNF?

a)

a) Yes

b)

b) No

10.

The format: A->aB refers to which of the following?

a)

a) Chomsky Normal Form

b)

b) Greibach Normal Form

c)

c) Backus Naur Form

d)

d) None of the mentioned

11.

The pumping lemma is often used to prove that a language is:

a)

a) Context free

b)

b) Not context free

c)

c) Regular

d)

d) None of the mentioned

12.

Which of the expressions correctly is an requirement of the pumping lemma for the context free languages?

a)

a) uvnwxny

b)

b) uvnwnxny

c)

c) uv2nwx2ny

d)

d) All of the mentioned

13.

The context free languages are closed under:

a)

a) Intersection

b)

b) Complement

c)

c) Kleene

d)

d) None of the mentioned

14.

Which of the following does not obey pumping lemma for context free languages ?

a)

a) Finite languages

b)

b) Context free languages

c)

c) Unrestricted languages

d)

d) None of the mentioned

15.

Which of the following grammars are in Chomsky Normal Form:

a)

a) S->AB|BC|CD, A->0, B->1, C->2, D->3

b)

b) S->AB, S->BCA|0|1|2|3

c)

c) S->ABa, A->aab, B->Ac

d)

d) All of the mentioned