wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

flat-UNIT 1

Total questions: 10

Worksheet time: 50mins

Name
Class
Date
1.

Language of finite automata is.

a)

Type 0

b)

Type 1

c)

Type 2

d)

Type 3

2.

Correct hierarchical relationship among context- free, right-linear, and context-sensitive language is

a)

context-free ⊂ right-linear ⊂ context-sensitive

b)

context-free ⊂ context-sensitive ⊂ right-linear

c)

context-sensitive ⊂ right-inear ⊂context-free

d)

right-linear ⊂context-free ⊂context-sensitive

3.

Which of the following statements is correct?

a)

A = { If an bn | n = 0,1, 2, 3 ..} is regular language

b)

Set B of all strings of equal number of a's and b's deines a regular language

c)

L (A* B*)∩ B gives the set A

d)

None of these

4.

Following context free grammar

S —> aB | bA

A —>b | aS | bAA

B —> b | bS | aBB

generates strings of terminals that have

a)

equal number of a's and b's

b)

odd number of a's and odd number b's

c)

even number of a's and even number of b's

d)

odd number of a's and even number of a's

5.

Consider the grammar :

S —> ABCc | Abc

BA —> AB

Bb —> bb

Ab —> ab

Aa —> aa

Which of the following sentences can be derived by this grammar

a)

abc

b)

aab

c)

abcc

d)

abbb

6.

The language of all words with at least 2 a's can be described by the regular expression

a)

(ab)*a and a (ba)*

b)

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

c)

b* ab* a (a + b)*

d)

all of these

7.

Any string of terminals that can be generated by the following CFG is

S-> XY

X--> aX | bX | a

Y-> Ya | Yb | a

a)

has atleast one 'b'

b)

should end in a 'a'

c)

has no consecutive a's or b's

d)

has atleast two a's

8.

Which of the following statement is correct?

a)

All languages can not be generated by CFG

b)

Any regular language has an equivalent CFG

c)

Some non regular languages can't be generated by CFG

d)

both (b) and (c)

9.

Consider a grammar with the following productions


S--> aab | bac | aB

S --> α S | b

S --> α b b | ab

Sα --> bdb | b


The above grammar is

a)

Context free

b)

regular

c)

context sensitive

d)

LR ( k )

10.

The grammars G = ( { s }, { 0, 1 }, p , s)

where p = (s —> 0S1, S —> OS, S —> S1, S —>0} is a

a)

recursively enumerable language

b)

regular language

c)

context-sensitive language

d)

context-free language