BBM401 Automata Theory and Formal Languages 1
BBM401 Automata Theory and Formal Languages 1
• In 1930s, Turing studied an abstract machine (Turing machine) that had all the
capabilities of today’s computers.
– Turing’s goal was to describe precisely the boundary between what a computing machine
could do and what it could not do.
• In 1940s and 1950s, simpler kinds of machines (finite automata) were studied.
– Chomsky began the study of formal grammars that have close relationships to abstract
automata and serve today as the basis of some important software components.
• Automata theory presents many useful models for software and hardware.
– In compilers we use finite automata for lexical analyzers, and push down
automatons for parsers.
– In search engines, we use finite automata to determine tokens in web pages.
– Finite automata model protocols, electronic circuits.
– Context-free grammars are used to describe the syntax of essentially every
programming language.
– Automata theory offers many useful models for natural language processing.
• When developing solutions to real problems, we often confront the limitations of what
software can do.
– Undecidable things – no program whatever can do it.
– Intractable things – there are programs, but no fast programs.
• Memory is crucial:
– Finite Memory
– Infinite Memory
• Automata differ in
– the amount of memory then have (finite vs infinite)
– what kind of access to the memory they allow.
• Automata can behave deterministically or non-deterministically
– For a deterministic automaton, there is only one possible alternative at any point, and it
can only pick that one and proceed.
– A non-deterministic automaton can at any point, among possible next steps, pick one step
and proceed.
BBM401 Automata Theory and Formal Languages 15
Finite Automata
• Finite automata are finite collections of states with transition rules that take you
from one state to another.
• A finite automaton has finite number of states.
In a finite automaton:
push
• States are represented by circles.
start
off on • Accepting (final) states are represented by
double circles.
• One of the states is a starting state.
push
• Arcs represent state transitions and labels on
arcs represent inputs (external influences)
causing transitions.
start i l y a s
i il ily ilya ilyas
not i or g
not i not i or n i
not i
• The language of this automaton is the set of all strings ending in “ing”.
• i.e. {ing, aing, bing, going, coming, inging, …}
• Each step of a deductive proof MUST follow from a given fact or previous statements
(or their combinations) by an accepted logical principle (inference rules).
– A logical principles guarantees that if its precedences are correct(true), its conclusion is
correct (true) too.
• Theorem to be proved:
If x is the sum of the squares of four positive integers, then 2x ≥ x2
Hypothesis Conclusion
Statement Justification
1. If x ≥ 4, then 2x ≥ x2 Given theorem
2. x = a2 + b2 + c2 + d2 Given
3. a ≥ 1 b≥1 c≥1 d≥1 Given
4. a2 ≥ 1 b2 ≥ 1 c2 ≥ 1 d2 ≥ 1 From (3) and principle of arithmetic
5. x ≥ 4 From (2), (4) and principle of arithmetic
6. 2x ≥ x2 From (1) and (5)
Only-If-Part:
• Given that x = x
• By definitions of ceiling and floor operations. x ≤ x and x ≥ x
• Since given that x = x, x ≤ x and x ≥ x
• By the properties of arithmetic inequalities, x = x
• Since x is always an integer, x MUST be integer too.
i 1 2
k 1 k
i i (k 1)
i 1 i 1
k (k 1)
(k 1) by the inductive hypothesis
2
k (k 1) 2(k 1) (k 1)(k 2)
2 2
n
n(n 1)
It follows that i
i 1 2
for all n ≥ 1. □
Theorem: R ( S T) = (R S) (R T)
Statement Justification
1. x is in R ( S T) Given
2 x is in R or x is in ( S T) (1) and definition union
3 x is in R or x is in both S and T (2) and definition of intersection
4. x is in (R S) (3) and definition of union
5. x is in (R T), (3) and definition of union
6. x is in (R S) (R T) (4), (5) and definition of intersection
Statement Justification
1. x is in (R S) (R T) Given
2 x is in (R S) (1) and definition intersection
3 x is in (R T) (1) and definition of intersection
4. x is in R or x is in both S and T (2), (3) and reasoning about unions
5. x is in R or x is in ( S T) (4) and definition of intersection
6. x is in R ( S T) (5) and definition of union