Lecture 3 : DFA AND NFA Flashcards
What is regular expression
Regular expressions (REs) are a language for expressing patterns
What is L(s)?
L(s) is known as the “language of s”.
What is s*?
s* is a RE such that L(s*) = L(s) concatenated zero or more times.
What is s?
S? indicates that s is optional.
S? can be written as (S|e).
What is s+
s+ indicates that s is repeated one or more times
s+ can be written as ss*
What is [a-z]
[a-z] indicates any character in that range.
[a-z] can be written as (a|b|…|z)
What is r1|r2 and r1.r2?
r1|r2 means either r1 or r2
r1.r2 means r1 followed by r2
What is [^x]?
[ˆx] indicates any character except one.[ˆx] can be written as Ʃ- x
A DFA has 5 tuples?
{Q,E,q0,F,&}
Q: Set of all states
E: Finite set of input symbols
q0: initial state
F: Set of all final state
&: transition function
Common ways to solve ambiguity in nfa
Crystal ball interpretation
Many-worlds interpretation
Describe Crystal ball interpretation
The Crystal ball interpretation suggests that the NFA somehow “knows” what the best choice is, by some means external to the NFA itself.