TOC-MOD1-1
TOC-MOD1-1
TOC-MOD1-1
Finite Automata
Turing Machine
Computability Theory
✓Develop formal mathematical model of computation that reflect real
world computers.
Complexity Theory
✓It group the computable problem based on their hardness.
Purpose of TOC
✓It deals with what can and can not be computed by the model.
What is Computation?
✓Computation is a sequence of steps that can be performed by
computer.
2. Length of a String
• It is the number of symbols in the string or word.
• It is denoted by |w| Mod W
Eg: w=11010011 taken from binary alphabet represented by ∑= { 0,1}
Length of the string |w|= 8
• If w=abccd then |w|= 5
• |ϵ|= 0
3. Concatenation of String
• Concatenation means join two or more string.
• Let w=a1,a2,a3,……an
v=b1,b2,b3,……bm
then wv=a1,a2,a3,……an b1,b2,b3,……bm
Example:
(i) x=010 y=1
Concatenation of xy=0101 yx=1010
(ii) x=AL y=GOL
Concatenation of xy = ALGOL
(iii)Empty string is the identity element for concatenation operator
ie. wϵ = ϵw =w
4. Power of Alphabet
• If “∑” is an alphabet, we can express set of all string of certain length from
that alphabet by using exponential notation.
• It is denoted by ∑k is the set of strings of length k.
Example:
If ∑= { 0,1} then
∑0 = {ϵ} empty string
∑1 = {0,1} set of all empty strings of length one over ∑ = {0,1}
(21 =2) k=1
∑2 = {00,01,10,11} set of all strings of length two over ∑ = {0,1}
(22 =4) k=2
∑3 = {000,001,010,011,100,101,110,111} set of all strings of length
three over ∑ = {0,1}
(23 =8) k=3
5. Kleene Closure
• The set of string over an alphabet ∑ is usually denoted by ∑*
• For instance ∑*= {0,1} *
= {ϵ ,0,1,00,01,10,11,…} Including ϵ
Kleene Closure ∑*=∑0 U∑1 U∑2 U∑3 …….
6. Kleene Plus
• The set of strings over an alphabet ∑ excluding ϵ is usually denoted by
∑+
• For instance ∑+= {0,1} +
= {0,1,00,01,10,11,…} Excluding ϵ
∴ ∑+=∑* - {ϵ}
(or)
∑+=∑1 U∑2 U∑3 ……. Without ϵ symbol
Power of Alphabet
Start
Off On
Push
Read Head
A Finite state
Finite Control Automata is the
simplest and most
restricted model of a
computer
DFA is a Language recognizer that has:
1. An input File – Containing an input string. Storage
2. A Finite Control – a device that can be in a finite number of states.
3. A reader – a sequential reading device.
4. A Program
How DFA works?
1. Initialisation: Reader (read head) should be over the leftmost
symbol. Finite control is in start state.
2. Single Step: Reader reads current symbol then, reader moves to the
next symbol to the right.
Control enters a new state that depends on the current state and
current symbols. There may be no desired next state, in which case the
machine stops. The machine repeats this action.
3. No Current Symbols: All symbols have been read then, if control is in
final State, the input string is accepted. Otherwise, the input string is
not accepted.
DFA Specification
A DFA is defined by the 5-tuple:
M =(Q, Σ, S, F, δ ), Where
Q ==> a finite, non empty set of states.
Σ ==> a finite, non empty set of input symbols (alphabet).
S ϵ Q ==> a start state
F ⊆ Q ==> a set of final or accepting states subset of Q.
δ ==> a transition function, defined as δ: Q x Σ ==> Q
Inputs
States Note:
a b
• Start State ‘s’ is represented by --->
q0 q0 q1
• Final state are represented by * or
*
q1 q1 q1 double circle
Transition Function
✓The mapping function or transition function denoted by “delta δ”.
✓The two parameters are passed to this transition function.
✓Current State
✓Input Symbol
✓The transition function always return a state. Which can be called as
next state.
δ(Current_State, Current_Input_Symbol) = Next_State
Example: Q X Σ -> Q a
δ(q0, a) = q0 a
δ(q0, b) = q1 Start b
q0 q1
δ(q1, a) = q1
Properties of Transition Function (δ)
a. δ(q,ϵ) = q
This means the state of the system can be changed only by an input
symbol else remains in original state.
b. For all strings w and input symbol a
δ(q,aw) = δ(δ(q,a),w)
Similarly
δ(q,wa) = δ(δ(q,w),a)
c. The transition function δ can be extended to δ (or) δ that operates on states
and strings.
Basic: δ (q,ϵ) = q
Induction: δ(q,xa) = δ(δ(q,x),a)
Language of a DFA
A string x is said to be accepted by DFA M =(Q, Σ, S, F, δ ), If δ(q0, x)
= P for some P in F.
Method: A finite automata accepts a string w = a1,a2,a3,……an if
there is a path in the transition diagram which begins at a start
state ends at an accepted state with the sequence of labels
a1,a2,a3,……an.
❖The language accepted by finite automata (A) is
L(A) = { w: δ (q0,w) ϵ F} where F is a final state.
❖The language accepted by finite automata’s are called “regular
Language”.
Definition of NFA
The NFA is defined by the 5-tuple:
M =(Q, Σ, S, F, δ ), Where
Q ==>Finite non empty set of states.
Σ ==>Finite set of input symbols (alphabet).
S ϵ Q ==>Start state, belongs to Q.
F ⊆ Q ==>Set of final or accepting states, subset of Q.
δ ==> a transition function, defined as δ: Q x Σ ==> 2Q
Extended Transition Function (δ)