Regular languages
Read /TheGeneralIdea before reading this.
Regular languages are languages that can be decided by finite automata -- computers with a finite number of states.
What is a finite automaton? In class we drew examples using diagrams (graphs where the nodes are states and edges are transitions).
Examples of regular languages:
- {0,1}*
- {x | x is a string of zeros and ones, x ends in a zero}
- {x | x is a string of roman alphabet characters, x ends in a "abracadabra"}
- {x | x is a string of zeros and ones, x has an odd number of ones}
- {x | x is the binary representation of an integer that is a multiple of 3} (challenge problem)
- {x | x is a word in the 2004 Mirriam-Webster dictionary}
Formally, how to define a finite automaton?
- Finite set S of states
- Finite alphabet Σ
- Set A of accept states, A ⊆ S
- Start state s0 ∈ S
- Transition function δ : S × Σ → S (See Chapter 0 of /Sipser for mathematical notation.)
[Did not formally define how a finite automaton computes.]
Examples of non-regular languages:
- {0n1n : n = 0,1,2,...} -- why is there no finite automaton for this language?
References