0% found this document useful (0 votes)
31 views36 pages

Unit-3 ATCD

The document provides an overview of pushdown automata (PDA) and Turing machines, detailing their definitions, models, and acceptance criteria for context-free languages (CFL). It explains the structure and functioning of PDAs, including deterministic and non-deterministic types, and presents examples of constructing PDAs for specific languages. Additionally, it outlines the transition functions and acceptance conditions for PDAs, along with problems for practice.

Uploaded by

cprtv101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views36 pages

Unit-3 ATCD

The document provides an overview of pushdown automata (PDA) and Turing machines, detailing their definitions, models, and acceptance criteria for context-free languages (CFL). It explains the structure and functioning of PDAs, including deterministic and non-deterministic types, and presents examples of constructing PDAs for specific languages. Additionally, it outlines the transition functions and acceptance conditions for PDAs, along with problems for practice.

Uploaded by

cprtv101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Unit-3

Pushdown automata
Turing Machine
Contents
• Pushdown automata: Definition, model,
acceptance of CFL, introduction to
Deterministic PDA and Non-Deterministic PDA,
design of PDA.
• Turing Machine: Turing Machine, definition,
model, design of TM, recursively enumerable
languages.
Pushdown automata: Definition
• Pushdown automata is a way to implement a CFG in the same way we design
DFA for a regular grammar.
• A DFA can remember a finite amount of information, but a PDA can remember
an infinite amount of information.
• A pushdown automaton (PDA) is a computational model that recognizes
context-free languages.
• It consists of an input tape, a stack, and a finite set of states.
• A pushdown automaton (PDA) is a finite automaton equipped with a stack-
based memory.
• Each transition
– is based on the current input symbol and the top of the stack,
– optionally pops the top of the stack, and
– optionally pushes new symbols onto the stack.
• Initially, the stack holds a special symbol Z0 that indicates the bottom of the
stack.
Instantaneous Description (ID)
• Instantaneous Description (ID) is an informal notation of how a PDA
“computes” an input string and makes a decision whether that string is
accepted or rejected.
• An ID is a triple (q, w, α), where:
1. q is the current state.
2. w is the remaining input.
3.α is the stack contents, top at the left.
• Turnstile Notation
• ⊢ sign is called a “turnstile notation” and represents
one move.
⊢* sign represents a sequence of moves.
Eg- (p, b, T) ⊢ (q, w, α)
This implies that while taking a transition from state p to state q, the input
symbol ‘b’ is consumed, and the top of the stack ‘T’ is replaced by a new
string ‘α’
Model
• A PDA may or may not read an input symbol, but it has to read the top of the stack in every
transition.
• PDA Components:
• 1.Input tape: The input tape is divided in many cells or symbols. The input head is read-only
and may only move from left to right, one symbol at a time.
• 2.Finite control: The finite control has some pointer which points the current symbol which is
to be read.
• 3. Stack: The stack is a structure in which we can push and remove the items from one end
only. It has an infinite size. In PDA, the stack is used to store the items temporarily.
Pushdown automata: Definition
A PDA can be formally described as a 7-tuple (Q, ∑, Γ,δ, q0, Z0,F) −
• Q is the finite number of states
• ∑ is input alphabet
• Γ is stack symbols
• δ is the transition function: Q × (∑ ∪ {ε}) × Γ Q × Γ*
• q0 is the initial state (q0 ∈ Q)
• Z0 is the initial stack top symbol (Γ ∈ S)
• F is a set of accepting states (F ∈ Q)
• The following diagram shows a transition in a PDA from a state q1 to state q2, labeled
as a,b → c −

• This means at state q1, if we encounter an input string ‘a’ and top symbol of the stack
is ‘b’, then we pop ‘b’, push ‘c’ on top of the stack and move to state q2.
Acceptance of CFL
• There are two different ways to define PDA acceptability.
Final State Acceptability
• In final state acceptability, a PDA accepts a string when, after reading the entire
string, the PDA is in a final state. From the starting state, we can make moves
that end up in a final state with any stack values. The stack values are irrelevant
as long as we end up in a final state.
• For a PDA (Q, ∑, Γ, δ, q0, Z0, F), the language accepted by the set of final states F
is −
• L(PDA) = {w | (q0, w, Z0) ⊢* (q, ε, x), q ∈ F} for any input stack string x.
Empty Stack Acceptability
• Here a PDA accepts a string when, after reading the entire string, the PDA has
emptied its stack.
• For a PDA (Q, ∑, S, δ, q0, Z0, F), the language accepted by the empty stack is −
• L(PDA) = {w | (q0, w, I) ⊢* (q, ε, ε), q ∈ Q}
Example
• Construct a PDA that accepts L = {0n 1n | n ≥ 0}
Solution
• Final State Acceptability:

• Empty Stack Acceptability:

• This language accepts L = {ε, 01, 0011, 000111, ............................. } Here, in this example, the
number of ‘a’ and ‘b’ have to be same.
• Initially we put a special symbol ‘$’ into the empty
stack.
• Then at state q2, if we encounter input 0 and top is
Null, we push 0 into stack. This may iterate. And if
we encounter input 1 and top is 0, we pop this 0.
• Then at state q3, if we encounter input 1 and top is
0, we pop this 0. This may also iterate. And if we
encounter input 1 and top is 0, we pop the top
element.
• If the special symbol ‘$’ is encountered at top of the
stack, it is popped out and it finally goes to the
accepting state q4.
Example

• Define the pushdown automata for language {anbn | n>=1}


Solution : M = where Q = {q0, q1, q2 } and Σ = { a, b } and Γ = {a ,Z0 } and δ is
given by :
• δ(q0, a, Z0 ) = { (q0, a Z0 ) }
δ(q0, a, a) = { (q0, aa ) }
δ(q0, a,a) = { (q0, aaa) }
δ(q0, b, a) = { (q1, ∈) }
δ(q1, b,a) = { (q1, ∈) }
δ(q1, b,a) = { (q1, ∈) }
δ(q1,∈, Z0) = { (q2, ∈) }
Example
• Define the pushdown automata for language {anbmCn | n>=1, m>=1}
• M = where Q = {q0, q1, q2, q3 } and Σ = { a, b,c } and Γ = {a ,Z0 } and δ is given
by :
• δ(q0, a, Z0 ) = { (q0, a Z0 ) }
δ(q0, a, a) = { (q0, aa ) }
δ(q0, b, a) = { (q1, aa) }
δ(q1, c,a) = { (q2, ∈) }
δ(q2, c,a) = { (q2, ∈) }
δ(q2,∈, Z0) = { (q3, ∈) }
Example
• Define the pushdown automata for language {anb2n | n>=1}
Solution : L={abb,aabbbb,aaabbbbbb,..........}
• Input string is aabbbb∈
Logic 1: step1: if we read ‘a’ then push two ‘a’s on stack
• Step2: if we read ‘b’ then perform pop operation
– For first ‘b’ operation change the state
– For next pop operation there no need to change state
• Step3: Repeat step2 until the entire input string completely processed.
Logic 2: step1: if we read ‘a’ then push ‘a’ on stack
• Step2: Where as here two ‘b’s for first ‘b’ don’t perform any pop operation.
– Where as second ‘b’ perform pop operation
– For third ’b’ don’t perform pop operation
– For fourth ‘b’ perform pop operation.
• Step3: Repeat step2 until the entire input string completely processed.
M = where Q = {q0, q1, q2, q3 } and Σ = { a, b } and Γ = {a ,Z0 } and δ is given by :
• δ(q0, a, Z0 ) = { (q0, a Z0 ) }
δ(q0, a, a) = { (q0, aa ) }
δ(q0, b,a) = { (q1, a) }
δ(q1, b, a) = { (q2, ∈) }
δ(q2, b,a) = { (q1, a) }
δ(q1, b,a) = { (q1, ∈) }
δ(q2,∈, Z0) = { (qf,Z0) }

Example
Design pushdown automata for language {a ibj ck| i=j where i,j,k>=1}
• Solution: Logic
• Step1: if input symbol is ‘a’ push ‘a’ onto stack
• Step2: if input symbol is ‘b’ pop the stack.
• Step3: if input symbol is ‘c’ then stack is unchanged.
• L={abcc,aabbc,.........}
M = where Q = {q0, q1, q2, q3 } and Σ = { a, b,c } and Γ = {a ,Z0 } and δ is given by :
• δ(q0, a, Z0 ) = { (q0, aZ0 ) }
δ(q0, a, a) = { (q0, aa ) }
δ(q0, b,a) = { (q1, ∈) }
δ(q1, b, a) = { (q1, ∈) }
δ(q1, c,a) = { (q2, Z0) }
δ(q2, c, Z0 ) = { (q2, Z0) }
δ(q2, c, Z0 ) = { (q2, Z0) }
δ(q2,∈, Z0) = { (qf, ∈) }
Example
• Construct a PDA for language L = {0n1m2m3n | n>=1, m>=1}
• Step-1: On receiving 0 push it onto stack. On receiving 1, push it onto stack and
goto next state
• Step-2: On receiving 1 push it onto stack. On receiving 2, pop 1 from stack and
goto next state
• Step-3: On receiving 2 pop 1 from stack. If all the 1’s have been popped out of
stack and now receive 3 then pop a 0 from stack and goto next state
• Step-4: On receiving 3 pop 0 from stack. If input is finished and stack is empty then
goto last state and string is accepted
Problems
• Design pushdown automata for language {a2nbn | n>=1}
• Construct PDA for language L={w/na(w)>nb(w) where w∈(a+b)*}
• Design pushdown automata for language {aibj ck| i=j where i,j,k>=1}
• Design pushdown automata for language {aibj ck| j=k where i,j,k>=1}
• Construct PDA for language L={w/na(w)=nb(w) where w∈(a+b)*}
Deterministic Pushdown Automaton
(DPDA)
• A Deterministic Pushdown Automaton (DPDA) is a type of pushdown
automaton (PDA) where, for any given state, input symbol, and stack
symbol, there is at most one possible transition, unlike
nondeterministic PDAs which can have multiple choices.
• Formal Definition:
• A DPDA is formally defined as a tuple (Q, Σ, Γ, δ, q₀, Z₀, F), where:Q is a
finite set of states.
• Σ is a finite set of input symbols.
• Γ is a finite set of stack symbols.
• δ is the transition function.
• q₀ is the initial state.
• Z₀ is the initial stack symbol.
• F is a set of final states.
Example
Design DPDA for L={wcwR | w ε (a,b)* }
It is also called odd length palindrome
Solution: L={abcba,abbcbba,........}
• Some string will come followed by one 'c', followed by reverse of the string before 'c'.
• So we get to know that 'c' will work as an alarm to starting poping STACK.
• So we will pop every 'a' with 'a' and every 'b' with 'b'.
• For every two a's and b's push them into STACK
• When 'c' comes do nothing.
• If input symbol is ‘a’ stack’s top most symbol is ‘a’ then do the pop operation
• If input symbol is ‘b’ stack’s top most symbol is ‘b’ then do the pop operation
STACK Transiton Function δ :
• δ(q0, a, Z) = (q0, aZ)
• δ(q0, a, a) = (q0, aa)
• δ(q0, b, Z) = (q0, bZ)
• δ(q0, b, b) = (q0, bb)
• δ(q0, a, b) = (q0, ab)
• δ(q0, b, a) = (q0, ba)
• // this is decision step
• δ(q0, c, a) = (q1, a)
• δ(q0, c, b) = (q1, b)
• δ(q1, b, b) = (q1, ε)
• δ(q1, a, a) = (q1, ε)
• δ(q1, ε, Z) = (qf, Z)
• Q={q0,q1,qf}, ∑={a,b,c}, Γ={a,b,Z} , q0 ={q0}, Z0={Z},F={qf}
Previous example explanation
• Lets see, how this DPDA is working:
We will take one input string: "abbcbba“
• Scan string from left to right
• First input is 'a' and follow the rule:
• on input 'a' and STACK alphabet Z, push the two 'a's into STACK as : (a,Z/aZ) and state will be q0
• Second input is 'b' and so follow the rule:
• on input 'b' and STACK alphabet 'a', push the 'b' into STACK as : (b,a/ba) and state will be q0
• Third input is 'b' and so follow the rule:
• on input 'b' and STACK alphabet 'b', push the 'b' into STACK as : (b,b/bb) and state will be q0
• Fourth input is 'c' and so follow the rule:
• on input 'c' and STACK alphabet 'a' or 'b' and state q0, do nothing as : (c,b/b) and state will be q1
• Fifth input is 'b' and so follow the rule:
• on input 'b' and STACK alphabet 'b' (state is q1), pop one 'b' from STACK as : (b,b/ε) and state will be q1
• Sixth input is 'b' and so follow the rule:
• on input 'b' and STACK alphabet 'b' (state is q1), pop one 'b' from STACK as : (b,b/ε) and state will be q1
• Seventh input is 'a' and so follow the rule:
• on input 'a' and STACK alphabet 'a' and state q1, pop one 'a' from STACK as : (a,a/ε) and state will
remain q1
• We reached end of the string, so follow the rule:
• on input ε and STACK alphabet Z, go to final state(qf) as : (ε, Z/Z)
Non Deterministic Pushdown Automaton
(NPDA)
• In a non-deterministic pushdown automata (NPDA), this machine has the freedom to explore
all possible paths.
• It can simultaneously follow multiple paths based on the input and the stack's content.
• This means that the machine can accept a string if even one of its possible paths leads to an
accepting state.
Defining a Non-Deterministic Pushdown Automata (NPDA):-
A NPDA can be formally described as a 7-tuple (Q, ∑, Γ,δ, q0, Z0,F) −
• Q is the finite number of states
• ∑ is input alphabet
• Γ is stack symbols
• δ is the transition function: Q × (∑ ∪ {ε}) × Γ 2(Q × Γ*)
• q0 − The initial state
• Z0 − The initial stack symbol
• F − A set of final states
Example
• Design NPDA for language L={wwR | w ε (a,b)* }
• It is also called even length palindrome
• Solution:
• If the input symbol is ‘a’ and stack top most symbol is empty we can push ‘a’ on stack. Like wise
• If the input symbol is ‘b’ and stack top most symbol is empty we can push ‘b’ on stack.
• If the input symbol is ‘a’ and stack top most symbol is ‘b’ we can say that it is not the middle of
the string then simply we need to push ‘a’ on stack.
• If the input symbol is ‘b’ and stack top most symbol is ‘a’ we can say that it is not the middle of
the string then simply we need to push ‘b’ on stack.
• If the input symbol is ‘a’ there is a two possibility that i) the centre has come ii) centre not come
• Let the input is ‘a’ and the stack top most symbol is ‘a’. Let assume centre is not come there is
no problem with this just we need to push ‘a’ on to the stack.
• Let the input is ‘a’ and the stack top most symbol is ‘a’. Then we perform pop operation and
change the state.
• If the input symbol is ‘b’ and stack top most symbol is ‘b’ let assume centre not come just simply
we need to push ‘b’ on to the stack.
• Let the input is ‘b’ and the stack top most symbol is ‘b’. Then we perform pop operation.
• Transition Function
• δ(q0, a, Z) = (q0, aZ)
• δ(q0, a, a) = (q0, aa)
• δ(q0, b, Z) = (q0, bZ)
• δ(q0, b, b) = (q0, bb)
• δ(q0, a, b) = (q0, ab)
• δ(q0, b, a) = (q0, ba)
• // this is decision step
• δ(q0, a, a) = (q1, ε)
Q={q0,q1,qf}, ∑={a,b,}, Γ={a,b,Z} , q0 ={q0},
• δ(q0, b, b) = (q1, ε) Z0={Z},F={qf}
• δ(q1, b, b) = (q1, ε)
• δ(q1, a, a) = (q1, ε)
• δ(q1, ε, Z) = (qf, Z)
• Lets see, how this DPDA is working:
We will take one input string: "abbbba“
• Scan string from left to right
• First input is 'a' and follow the rule:on input 'a' and STACK alphabet Z, push the two 'a's into
STACK as : (a,Z/aZ) and state will be q0
• Second input is 'b' and so follow the rule:on input 'b' and STACK alphabet 'a', push the 'b' into
STACK as : (b,a/ba) and state will be q0
• Third input is 'b' and so follow the rule: on input 'b' and STACK alphabet 'b', push the 'b' into
STACK as : (b,b/bb) and state will be q0
• Here we will assume that one delimeter comes either that could be 'a' or 'b‘
• Forth input is 'b' and so follow the rule: on input 'b' and STACK alphabet 'b' (state is q1), pop
one 'b' from STACK as : (b,b/ε) and state will be q1
• Fifth input is 'b' and so follow the rule:on input 'b' and STACK alphabet 'b' (state is q1), pop
one 'b' from STACK as : (b,b/ε) and state will be q1
• Sixth input is 'a' and so follow the rule:on input 'a' and STACK alphabet 'a' and state q1, pop
one 'a' from STACK as : (a,a/ε) and state will remain q1
• We reached end of the string, so follow the rule:on input ε and STACK alphabet Z, go to final
state(qf) as : (ε, Z/Z)
DPDA(Deterministic Pushdown Automata) NPDA(Non-deterministic Pushdown
Automata)

It is less powerful than NPDA. It is more powerful than DPDA.


Example: Example:
We can only construct DPDA for odd-length NPDA can be constructed for both even-
palindromes and not for even length length and odd-length palindromes.
palindromes.

It is possible to convert every DPDA to a It is not possible to convert every NPDA to a


corresponding NPDA. corresponding DPDA.

The language accepted by DPDA is a subset of The language accepted by NPDA is not a
the language accepted by NPDA. subset of the language accepted by DPDA.

The language accepted by DPDA is called The language accepted by NPDA is called
DCFL(Deterministic Context-free Language) NCFL(Non-deterministic Context-free
which is a subset of NCFL(Non-deterministic Language).
Context-free Language) accepted by NPDA.

There is only one state transition from one There may or may not be more than one state
state to another state for an input symbol. transition from one state to another state for
same input symbol.
Turing Machine
• A Turing machine is a computational model, like Finite Automata (FA),
Pushdown automata (PDA), which works on unrestricted grammar. The Turing
machine is the most powerful computation model when compared with FA and PDA.
• Formal Definition of Turing machine M can be defined as follows −
• M = (Q, ∑, Γ,δ, q0, Z0,F)
where
• Q represents the finite, non-empty set of states.
• Γ represents the set of tape alphabets.
• ∑ represents the non-empty set of input alphabets.
• δ is the transition function, whose mapping is given as, δ : Q x Γ → Q x Γ x {Left_shift,
Right_shift}.
• q0 is the initial state of the machine
• B is the blank symbol
• F is the set of final states or halt states.

Turing Machine
• A single tape Turing machine has a single infinite tape, which is divided into cells.
• The tape symbols are present in these cells.
• →A finite control is present, which controls the working of Turing machines based on the given input.
• →The Finite control has a Read/write head, which points to a cell in tape.
• →A Turing machine can move both left and right from one cell to another.

• A Turing can have three types of action upon an input.


• Print Si, move one square to the left (L) and go to state qj.
• Print Si, move one square to the right (R) and go to state qj.
• Print Si, do not move (N) and go to state qj.
• →The mapping function shows the mapping from states of finite automata and input symbol on the
tape to the next states, external symbols and the direction for moving the tape head. This is known
as a triple or a program for turing machine.
• (q0, a) → (q1, X, R)
• That means in q0 state, if we read symbol 'a' then it will go to state q1, replaced a by X and move
ahead right(R stands for right).
Model
• The turning machine can be modelled with the help of the following representation.
• 1. The input tape is having an infinite number of cells, each cell containing one input symbol
and thus the input string can be placed on tape. The empty tape is filled by blank characters.

• 2. The finite control and the tape head which is responsible for reading the current input
symbol. The tape head can move to left to right.
• 3. A finite set of states through which machine has to undergo.
• 4. Finite set of symbols called external symbols which are used in building the logic of Turing
machine.
Design of TM Example

• Construct a Turing Machine (TM) for the language L = {0ⁿ1ⁿ | n ≥ 1}, which accepts strings of
equal 0s followed by equal 1s.
• Components:
• Q = {q₀, q₁, q₂, q₃} (q₀ is the initial state)
• T = {0,1,X,Y,B} (B represents blank, X and Y mark processed symbols)
• Σ = {0,1} (input symbols)
• F = {q₃} (final state)
• Transition Table:

• Let us see how this turing machine works for 0011. Initially head points to 0 which is
underlined and state is q0 as:

B 0 0 1 1 B
• The move will be δ(q0, 0) = (q1, X, R). It means, it will go to state q1, replace 0 by X and head
will move to right as:
B X 0 1 1 B

• The move will be δ(q1, 0) = (q1, 0, R) which means it will remain in same state and without
changing any symbol, it will move to right as:

B X 0 1 1 B
• The move will be δ(q1, 1) = (q2, Y, L) which means it will move to q2 state and changing 1 to Y,
it will move to left as:

B X 0 Y 1 B
• Working on it in the same way, the machine will reach state q3 and head will point to B as
shown:
B X X Y Y B

• Using move δ(q3, B) = halt, it will stop and accepted.


Example
Transition Functions:
δ(q0, a) = (q1, X, R)
δ(q1, a) = (q1, a, R)
δ(q1, Y) = (q1, Y, R)
δ(q1, b) = (q1, Y, L)
δ(q2, a) = (q2, a , L)
δ(q2, Y) = (q2, Y , L)
δ(q2, X) = (q0, X , R)
δ(q0, Y) = (q3, Y , R)
δ(q3, Y) = (q3, Y , R)
δ(q3, B) = (q4, B , R/L) Halt

State a b X Y B
q0 (q1, X, R) (q3, Y , R)
q1 (q1, a, R) (q1, Y, L) (q1, Y, R)
q2 (q2, a , L) (q0, X , R)
q3 (q3, Y , R) = (q4, B
, R/L)
q4 Halt
Transition Functions:
δ(q0, a) = (q1, X, R)
δ(q1, a) = (q1, a, R)
δ(q1, Y) = (q1, Y, R)
δ(q1, b) = (q2, Y, R)
δ(q2, b) = (q2, b , R)
δ(q2, Z) = (q2, Z , R)
δ(q2, c) = (q3, Z , L)
δ(q2, c) = (q3, Z , L)
δ(q3, a) = (q3, a , L)
δ(q3, b) = (q3, b , L)
δ(q3, Y) = (q3, Y , L)
δ(q3, Z) = (q3, Z , L)
δ(q3, X) = (q0, X , R)
δ(q0, Y) = (q4, Y , R)
δ(q4, Y) = (q4, Y , R)
State a b c X Y Z B
δ(q4, Z) = (q5, Z , R)
q0 (q1, X, R) (q4, Y , R) δ(q5, Z) = (q5, Z , R)
δ(q5, B) = (q6, B , R/L) Halt
q1 (q1, a, R) (q2, Y, R)

q2 (q2, b , R) (q3, Z , L) (q2, Z , R)

q3 (q3, a , L) (q3, b , L) (q0, X , R) (q3, Y , L) (q3, Z , L)

q4 (q4, Y , R) (q5, Z , R)

q5 (q5, Z , R) (q6, B , R/L)

q6 Halt
Transition Functions:
δ(q0, a) = (q1, X, R)
δ(q1, a) = (q2, X, R)
δ(q2, a) = (q2, a, R)
δ(q2, Y) = (q2, Y, R)
δ(q2, b) = (q3, Y, L)
δ(q3, a) = (q3, a , L)
δ(q3, Y) = (q3, Y , L)
δ(q3, X) = (q0, X , R)
δ(q0, Y) = (q4, Y , R)
δ(q4, Y) = (q4, Y , R)
δ(q4, B) = (q5, B , R/L) Halt
Transition Functions:
δ(q0, a) = (q1, B, R)
δ(q1, a) = (q1, a, R)
δ(q1, b) = (q1, b, R)
δ(q1, B) = (q2, B, L)
δ(q2, a) = (q3, B, L)
δ(q3, a) = (q3, a, L)
δ(q3, b) = (q3, b, L)
δ(q3, B) = (q0, B, R)
δ(q0, b) = (q4, B, R)
δ(q4, a) = (q4, a, R)
δ(q4, b) = (q4, b, R)
δ(q4, B) = (q5, B, L)
δ(q5, b) = (q6, B, L)
δ(q6, a) = (q6, a, L)
δ(q6, b) = (q6, b, L)
δ(q6, B) = (q0, B, R)
δ(q0, B) = (q7, B , R/L) Halt
Recursively Enumerable languages
• Recursively Enumerable languages: If any Turing Machine can be designed to accept all
string of the given language, then the language is called recursively enumerable
language.
• Recursively enumerable languages are the formal languages that can be decide-able,
( fully or partially). According to the Chomsky hierarchy of formal languages, we can
see the recursively enumerable languages as type 0 languages. some examples of
recursively enumerable languages are;
• Recursive languages
• Regular languages
• Context-sensitive languages
• Context-free languages and many more.
• Recursively enumerable language is recursively enumerable if it can be accepted by the
Turing machine (Read More). This is the main reason why recursively enumerable
languages are also called Turing recognizable languages. Please note that the Turing
machine is a very strong machine as compared to the finite state automata or
pushdown automata and is more powerful than many other machines.
Properties of Recursively enumerable languages
• Union ,Intersection, Complement
Union of RE languages
• Let’s revise union of sets;
• Set 1={a, b, c}
• Set 2={b, c, d}
• Set 1 Union Set 2 = {a, b, c, d}
• Now let’s understand the same concept in Turing Machine;
• Suppose a system has 2 Turing Machines, TM1, and TM2.
• If TM1 halts then all the system halts.
• If TM1 crash then system checks that TM2 is ready to halt or not? If TM2 halts then system
halts because this is union and the union means that
– If TM1 halts then system halts
– If TM1 does not halt, and TM2 halts then system halts
– If TM1 and TM2 or TMn halts then system halts
• Figure: Union of RE languages
• The intersection of RE languages
• Let’s revise the intersection of sets;
• Set 1={a, b, c}
• Set 2={b, c, d}
• Set 1 Intersection Set 2 = {b, c}
• Now let’s understand the same concept in Turing Machine;
• Suppose a system has 2 Turing Machines, TM1, and TM2.
• If TM1 crash then all the system crash.
• If TM1 halts then system checks that TM2 is ready to halt or not? After this, If TM2 halts then
system halts because this is intersection and the intersection means that
– If TM1 crash then system crash
– If TM1 halts then check TM2 or TMn, and if TM2 is also halted, the system halts.
– If TM1 and TM2 or TMn crash then the system crash

• Figure: Intersection of Recursive Enumerable languages


• The complement of RE languages
• Suppose a system has 2 Turing Machines, TM1, and TM2.
• If TM1 crash then all the system crash.
• If TM1 halts then system check TM2 or TMn. If TM1 halts and TM2 also halts then system
crash.
• If TM1 halts then system check TM2 or TMn. If TM1 halts and TM2 crash then system halts.
• Figure: Complement of recursively enumerable languages

You might also like