Practice Questions (Lectures) Flashcards

1
Q

For any language L ⊆ Σ∗, Σ != ∅
there is a deterministic
automata M, such that L = L(M)

A

True only when L is regular

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Any regular language has a finite representation.

A

True by definition of regular language and the fact that regular
expression is a finite string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Any finite language is regular

A

True as we proved it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Given L1, L2 languages over Σ, then
((L1 ∩ (Σ∗ − L2)) ∪ L2)L1 is a regular language

A

True only when both are regular languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

For any finite automata M
L(M) =
U{R(1, j, n) : qj ∈ F}

A

True only when M has n states and they are put in 1-1
sequence and q1 = s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Σ in any Generalized Finite Automaton includes some
regular expressions

A

True by definition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Pumping Lemma says that we can always prove that a
language is not regular

A

False PL serves as a tool for proving that some
languages are not regular

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

L = {a^n c^n : n ≥ 0} is regular

A

False we proved by PL that it is not regular

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The set of terminals in a context free grammar G is a
subset of the alphabet of G

A

True By definition: Σ ⊆ V

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The set of terminals and non- terminals in a context free
grammar G form the alphabet of G

A

True By definition: V = Σ ∪ (V − Σ)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The set of non-terminals is always non- empty

A

True By definition:
S ∈ V

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The set of terminals is always non- empty

A

False Σ = ∅ is a finite set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Let G be a context-free grammar
L(G) = {w ∈ V :
S∗⇒G w}

A

False Should be
w ∈ Σ∗

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The language L ⊆ Σ∗
is context-free if and only if L = L(G)

A

False Holds only when G is a context -free grammar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A language is context-free if and only if it is accepted by a context-free grammar

A

False Language is generated, not accepted by a grammar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Any regular language is context-free

A

True: Regular languages are generated by regular
grammars, that are special case of CF grammars

17
Q

Language is regular if and only if it is generated by
a regular grammar (right- linear)

A

True : Theorem proved in class

18
Q

L = {w ∈ {a, b}∗ :
w = w^R } is context-free

A

True: G with the rules:
S → aSa|bSb|a|b||e is the required grammar

19
Q

A regular language is a CF language

A

True: Regular grammar is a special case of a context-free
grammar