toc
toc
Regular Expressions & Languages: Represent regular languages using symbols and
operators (*, +, |). Examples:
o (0|1)*: Represents all binary strings.
o a(b|c)*: Represents strings starting with ‘a’ followed by any number of ‘b’ or ‘c’.
Deterministic Finite Automata (DFA):
o Defined as (Q, Σ, δ, q0, F), where:
Q: Finite set of states
Σ: Input alphabet
δ: Transition function (mapping states and inputs to new states)
q0: Initial state
F: Set of final states (accept states)
o Equivalence with regular expressions: Every regular language can be represented
by a DFA.
Nondeterministic Finite Automata (NFA):
o Similar to DFA but allows multiple transitions for a single input.
o Example: An NFA for (a|b)* accepts any string of a’s and b’s.
o Equivalence with DFA: Every NFA can be converted to an equivalent DFA
using the subset construction method.
Regular Grammars & Equivalence with Finite Automata:
o Right-linear and left-linear grammars correspond to regular languages.
o Example:
Right-linear: A → aB | b
Left-linear: A → Ba | b
Properties of Regular Languages:
o Closure under:
Union: If L1 and L2 are regular, then L1 ∪ L2 is regular.
Concatenation: If L1 and L2 are regular, then L1L2 is regular.
Kleene star: If L is regular, then L* is regular.
Intersection and Complement: Regular languages are closed under these
operations.
Kleene’s Theorem: States that regular languages are equivalent to finite automata and
regular expressions.
Pumping Lemma for Regular Languages:
o Used to prove that a language is not regular by contradiction.
o If a language L is regular, then there exists a pumping length p such that any
string w in L with |w| ≥ p can be decomposed as w = xyz, satisfying:
1. |xy| ≤ p
2. |y| > 0
3. xyⁿz ∈ L for all n ≥ 0
o Example: Proving L = {aⁿbⁿ | n ≥ 0} is not regular using the pumping lemma.
Myhill-Nerode Theorem & Its Uses:
o Characterizes regular languages using distinguishable string equivalence classes.
o Application: Minimization of finite automata by merging equivalent states.
Minimization of Finite Automata:
o Reducing the number of states in a DFA while preserving language acceptance.
o Steps: