NFAs Flashcards

(18 cards)

1
Q

Difference between DFA and NFA

A

In a NFA there can be more than one choice from the same input e.g. input ‘a’ has two transitions. Also some states have no outgoing transitions whereas in DFA each state has exactly one transition per input

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

In an NFA how do you choose which path to take

A

Work out if the string is accepted for all paths and if it is accepted for at least one then the string is accepted even if all other paths are rejected

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

An NFA accepts a string if:

A

If there is at least one computation of the NFA that accepts the string

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

If there is still string left over after reaching an acceptance state with no transitions is it accepted or rejected

A

Rejected

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

An NFA rejects the string if:

A

For each computation:

The entire input string is consumed and the last state is not an accepting state

OR

The input string cannot be scanned entirely/the input cannot be consumed

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

What is the epsilon transition (ε)

A

The transition happens without reading an input. If there is a ε transition from q1 to q2, the NFA can decide whether to stay at q1 or jump to q2

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

what does L = {ab}^+ mean

A

L = {ab,abab,ababab, …}

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

What does L = {ab}^* mean

A

L = {empty string, ab, abab, ababab, …}

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

Formal definition of NFA’s, give the states symbols and definitions

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

what does the set Delta(q,x) contain

A

All the states you can reach from the transition x from q, including states which you can get to via an x and epsilon transition

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

What is the extended transition function

A

deltaHat({q0},aa) gives the set of states where the NFA can end up after the transition aa

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

How is extended transition function different to normal transition function

A

Extended transition function takes a string of multiple transitions

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

Machine m1 is equivalent to machibe m2 if?

A

They have the exact same language

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

If an NFA has k states what is the most states the DFA can have

A

2^k

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

When converting from an NFA TO A DFA how are the states labeled in the DFA

A

In the DFA, every state is a set

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

Convert this NFA to a DFA

17
Q

For any DFA state, if at least one state in the set is an accepting state in the NFA then…

A

That set is an accepting state in the DFA