wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

TAFL Unit 2 Quiz: Regular Expressions

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which of the following is a valid regular expression?

a)

a(b|c)*

b)

a(b+c

c)

a|b)*

d)

ab(**

2.

Kleene's Theorem states the equivalence between:

a)

Regular expressions and context-free grammars

b)

DFA and Turing machines

c)

Regular expressions and finite automata

d)

Context-free grammars and pushdown automata

3.

Which of the following is not a closure property of regular languages?

a)

Union

b)

Intersection

c)

Complement

d)

Infinite Reversal

4.

What does the Pumping Lemma prove?

a)

A language is regular

b)

A language is not regular

c)

A language is context-free

d)

A language is finite

5.

Arden's Theorem is used to:

a)

Convert a DFA to a regular expression

b)

Eliminate null transitions

c)

Minimize a DFA

d)

Prove non-regularity

6.

Which of the following languages is not regular?

a)

L = {a^n | n ≥ 0}

b)

L = {a^n b^n | n ≥ 0}

c)

L = {a, aa, aaa, …}

d)

L = {a^n b^m | n, m ≥ 0}

7.

The Pigeonhole Principle is used in the Pumping Lemma to:

a)

Minimize states

b)

Ensure repetition

c)

Prove context-free grammars

d)

Remove dead states

8.

What is the minimum number of states in a DFA to accept all strings over {0,1} with an even number of 0s?

a)

1

b)

2

c)

3

d)

4

9.

A language is regular if it can be accepted by:

a)

PDA

b)

Turing Machine

c)

DFA

d)

Context-Free Grammar

10.

Which of the following is decidable?

a)

Membership problem for DFA

b)

Ambiguity in CFG

c)

Halting problem

d)

Equivalence of two Turing Machines

11.

In a finite automaton, what does a transition graph represent?

a)

Language hierarchy

b)

Parsing rules

c)

State transitions

d)

Context-free derivations

12.

Regular expressions can be used to describe:

a)

Context-free languages

b)

Recursive languages

c)

Regular languages

d)

Undecidable languages

13.

Which of the following is true for DFA and NFA?

a)

Every DFA is an NFA

b)

Every NFA is a DFA

c)

NFAs and DFAs accept different languages

d)

NFA has more computational power

14.

Which method is used to derive a regular expression from finite automata?

a)

Pumping Lemma

b)

Kleene's Algorithm

c)

Arden's Theorem

d)

Turing Reduction

15.

The language L = {a^n b^m | n ≠ m} is:

a)

Regular

b)

Context-Free

c)

Non-regular

d)

Recursive

16.

Which of the following operations do regular languages support under closure properties?

a)

Union

b)

Concatenation

c)

Kleene Star

d)

All of the above

17.

Which of the following languages can be proven non-regular using the Pumping Lemma?

a)

L = {a^n b^n | n ≥ 0}

b)

L = {a^n b^m | n, m ≥ 0}

c)

L = {a^n | n ≥ 0}

d)

L = {a, aa, aaa}

18.

The decision problem "Is a given DFA empty?" is:

a)

Undecidable

b)

NP-Hard

c)

Decidable

d)

Recursive Enumerable

19.

What does Arden's theorem state about the equation X = rX + s?

a)

X = r* s

b)

X = s r*

c)

X = r + s

d)

X = r* + s

20.

If a DFA has n states, and the input string is of length > n, then:

a)

The DFA halts

b)

A state must repeat (Pigeonhole Principle)

c)

It accepts

d)

It is non-deterministic