wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Regular expression Session 2020-21

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

1. Regular expressions are used to represent which language

a)

Recursive language

b)

Context free language

c)

Regular language

d)

All of these

2.

Which of the following operation can be applied on regular expressions?

a)

Union

b)

Concatenation

c)

Closure

d)

All of these

3.

The set of all strings over ∑ = {0,1} in which all strings that beings and ends with 0 is

a)

0(0+1)0

b)

00

c)

00(0+1)0

d)

All of these

4.

The set of all strings over ∑ = {a,b} in which all strings having bbbb as substring is

a)

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

b)

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

c)

bbbb (a+b)*

d)

bb (a+b)*

5.

The set of all strings over ∑ ={a,b} in which a single a is followed by any number of b’s a single b followed by any number of a’s is:

a)

ab* + ba*

b)

ab*ba*

c)

a*b + b*a

d)

None

6.

The set of all strings over ∑ = {a,b} in which all strings of a’s and b’s ending in bb is

a)

ab

b)

a*bbb

c)

(a+b)* bb

d)

All of these

7.

Which of the following identity is wrong?

a)

R + R = R

b)

(R*)* = R*

c)

ɛR = Rɛ = R

d)

ØR = RØ = RR*

8.

Which of the following statement is true?

a)

Every language that is defined by regular expression can also be defined by finite automata

b)

Every language defined by finite automata can also be defined by regular expression

c)

We can convert regular expressions into finite automata

d)

All of these

9.

If P, Q, R are three regular expressions and if P does not contain a then the equation R = R + RP has a unique solution given by

a)

R = QP*

b)

R = P*Q

c)

R = RP

d)

None

10.

If P, Q, R are three regular expressions and if P does not contain ____________ then the equation ___________ has a unique solution given by R=QP*

a)

One, R=Q+PQ

b)

Null, R=Q+RP

c)

Null, R=Q+QP*

d)

Null, R=QP*

11.

How many strings of length less than 4 contains the language described by the regular expression (x+y)*y(a+ab)*?

a)

7

b)

10

c)

12

d)

11

12.

Which of the following is true?

a)

(01)*0 = 0(10)*

b)

(0+1)*01(0+1)*+1*0* = (0+1)*

c)

(0+1)*0(0+1)*1(0+1) = (0+1)*01(0+1)*

d)

All of above

13.

Which of the following is true?

a)

Every subset of a regular set is regular

b)

Every finite subset of non-regular set is regular

c)

The union of two non regular set is not regular

d)

Infinite union of finite set is regular

14.

Consider the following two statements:

S1: { 0^2n |n >= l} is a regular language

S2: { 0^m 0^n 0^(m+n) l m >= 1 and n >= 2} is a regular language

Which of the following statements is correct?

a)

Only S1 is correct

b)

Only S2 is correct

c)

Both S1 and S2 are correct

d)

None of S1 and S2 is correct

15.

Which of the following statements in true? (GATE CS 2001)

a)

If a language is context free it can always be accepted by a deterministic push-down automaton

b)

The union of two context free languages is context free

c)

The intersection of two context free languages is context free

d)

The complement of a context free language is context free

16.

Let M= (Q, Σ, δ, S, F) and M’= (Q, Σ, δ, S, Q – F) where M accepts L and M’ accepts L1 and M is NFA, which among the following is the relation between L and L’ ?

a)

L and L’ are complement to each other

b)

L and L’ are similar to each other

c)

L and L’ relation cannot be predicted

d)

None of the above

17.

Grammar has _______tuple in which S represents_________.

a)

3, production rules

b)

5, starting variable

c)

4, starting variable

d)

4, production rules

18.

An NFA’s transition function returns

a)

State

b)

boolean value

c)

A set of states

d)

None of these

19.

in pumping lemma, string w can be decomposed into:

a)

w=xyz, where y can not be null

b)

w=xyz, where y may be null

c)

x=yaz

d)

w=yzx

20.

A push down automaton employs ________ data structure.

a)

Queue

b)

Linked List

c)

Hash Table

d)

Stack