Finite State Machines, NFA's, DFA's

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

10 Terms

1
New cards

Finite State Machine

A set of finite states that have actions to go between states. Exists as a graph. A single starting state and can have multiple ending states. Can represent regular expressions and whether an expression is accepted or not.

Needs an alphabet (∑), set of states (Q), start state (q0 ∈ Q), final states (F ⊆ Q),

  • DFA Transitions (δ:Q×Q)

  • NFA Transitions (δ:Q×(∪{ϵ})↦Q) (NFA contains explicit epsilon transitions)

2
New cards

Regex Requirements

Alphabet:

  • Set of symbols allowed

  • Denoted by ∑

  • A string is a finite sequence of symbols from ∑

Concatenation:

  • If L1 and L2 are languages, L1 concatenated with L2 is L1L2

  • Allows other characters or strings to be combined

  • “a” + “b” = “ab”

Branching (Unions):

  • If L1 and L2 are languages, L1 unioned with L2 is L1 U L2

  • Therefore, {x | x ∈ L1 V x ∈ L2}

  • L1 = {“a”}, L2 = {“b”, … L1 U L2 U … = [a-z]

Repetition (Kleene Closure):

  • If L1 is a language, then L1* = {x | x ∈ L1 V x ∈ L1L1 V …}

  • If L1 = {“a”}, then L1* = a*

<p>Alphabet:</p><ul><li><p>Set of symbols allowed</p></li><li><p>Denoted by ∑</p></li><li><p>A string is a finite sequence of symbols from ∑</p></li></ul><p>Concatenation:</p><ul><li><p>If L1 and L2 are languages, L1 concatenated with L2 is L1L2</p></li><li><p>Allows other characters or strings to be combined</p></li><li><p>“a” + “b” = “ab”</p></li></ul><p>Branching (Unions):</p><ul><li><p>If L1 and L2 are languages, L1 unioned with L2 is L1 U L2</p></li><li><p>Therefore, {x | x ∈ L1 V x ∈ L2}</p></li><li><p>L1 = {“a”}, L2 = {“b”, … L1 U L2 U … = [a-z]</p></li></ul><p>Repetition (Kleene Closure):</p><ul><li><p>If L1 is a language, then L1* = {x | x ∈ L1 V x ∈ L1L1 V …}</p></li><li><p>If L1 = {“a”}, then L1* = a*</p></li></ul>
3
New cards

Turing Machine

Can solve any solvable problem.

4
New cards

Regular Languages

Any language created by Regular expressions are regular languages

5
New cards

NFA

A type of finite state that contains explicit epsilon transitions. Easier to make than DFA’s but harder to check regex acceptance. Can have more than one outward edge of the same character.

6
New cards

DFA

A type of NFA that doesn’t contain explicit epsilon transitions. Easy to check acceptance. All DFA’s are NFA’s.

7
New cards

ϵ-closure(state)

Returns a list containing all states that can be reached using epsilon transitions from the current state.

8
New cards

move(state, action)

Returns a list containing all states you can get to using a specific symbol (not counting epsilon transitions between states).

9
New cards

Regex to NFA

Concatenation is just adding an epsilon transition from one machine to another

Branching is adding epsilon transistion to sepaarete branches that go to the same place

Kleene operator is adding an edge back to a previous state to show repetitions

(picture is: (ab|cd)+)

<p>Concatenation is just adding an epsilon transition from one machine to another</p><p>Branching is adding epsilon transistion to sepaarete branches that go to the same place</p><p>Kleene operator is adding an edge back to a previous state to show repetitions</p><p>(picture is: (ab|cd)+)</p>
10
New cards

NFA to DFA

Costly to check if an NFA accepts an input or not, so converting after combining several other machines can be good. There can be uncertainty because there can be multiple outgoing edges of the same action, so the goal is to create a new state that represents that uncertainty.

<p>Costly to check if an NFA accepts an input or not, so converting after combining several other machines can be good. There can be uncertainty because there can be multiple outgoing edges of the same action, so the goal is to create a new state that represents that uncertainty. </p>