NFA_vs_DFA_flashcards

1
Q

Are NFAs more powerful than DFAs?

A

No. Every NFA can be converted into an equivalent DFA.

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

What does it mean for an NFA and DFA to be equivalent?

A

They accept the same language — i.e., for every NFA, there exists a DFA that accepts the same set of words.

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

What class of languages do NFAs accept?

A

NFAs accept exactly the regular languages — same as DFAs.

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

What is the Subset Construction (a.k.a. Powerset Construction)?

A

An algorithm to convert an NFA into an equivalent DFA by creating DFA states as sets of NFA states.

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

What is the goal of the subset construction algorithm?

A

To convert NFA A = (Q, Σ, Δ, s, F) into a DFA A′ = (Q′, Σ, δ, s′, F′) that accepts the same language.

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

In subset construction, what does E(q) represent?

A

The ε-closure of state q — all states reachable from q via ε-transitions.

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

What is Q′ in the DFA produced by subset construction?

A

Q′ is the powerset of Q — all subsets of NFA states.

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

What is the start state s′ of the DFA in subset construction?

A

The ε-closure of the NFA start state: s′ = E(s).

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

How is the DFA transition function δ defined in subset construction?

A

For state R and symbol a, δ(R, a) = union of ε-closures of all states reachable from any q ∈ R via a.

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

What is the set of accepting states F′ in the DFA?

A

All DFA states R such that R ∩ F ≠ ∅ — they contain at least one NFA accepting state.

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

How do DFA states relate to NFA states in subset construction?

A

Each DFA state represents a set of NFA states the machine could be in after reading input.

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

Why are NFAs considered human-friendly?

A

Because they are simpler to design and understand for representing languages, especially with nondeterminism.

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

Why are DFAs considered computer-friendly?

A

Because they are deterministic, faster to execute, and more suitable for implementation.

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

What is the first step in converting an NFA to a DFA?

A

Determine the language the NFA represents, so you can validate the DFA’s correctness.

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

How do you determine the initial state of the DFA from an NFA?

A

Compute the ε-closure of the NFA’s start state — this becomes the DFA’s start state.

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

What should you remember when handling ε-transitions during conversion?

A

Use ε-closure to capture all jump states that are reachable without consuming input.

17
Q

How do you handle NFA transitions with multiple possible outcomes in DFA construction?

A

Create DFA states that represent sets of those NFA outcomes, and draw transitions accordingly.