Recursive and Recursively Enumerable Language Flip Class Room Activity

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 51

Recursive and

Recursively Enumerable
Language
 Introduction
 Recursively Enumerable
 Recursively Enumerable Properties
Outline  Recursive Language
 Recursive Language Properties
 Theorems
 What is Turing Machine?
 Turing Machine is expressed as 7-tuple (Q, T, B, ∑, δ, q0, F)
 Q is a finite set of states
 T is the tape alphabet (symbols which can be written on Tape)
 B is blank symbol (every cell is filled with B except input alphabet
initially)
Introduction  ∑ is the input alphabet (symbols which are part of input alphabet)
 δ is a transition function which maps Q × T → Q × T × {L,R}.
Depending on its present state and present tape alphabet (pointed
by head pointer), it will move to new state, change the tape symbol
(may or may not) and move head pointer to either left or right.
 q0 is the initial state
 F is the set of final states. If any state of F is reached, input string is
accepted.
Problem to
understand
Turing
Machine
 A language is recursively enumerable if some Turning Machine
accepts it.
 Let L be a recursively enumerable language and M the Turning
Machine that accepts it
Recursively  For string w:
Enumerable  If w ∈ L then M halts in a final state
 If w ∉ L then M halts in a non-final state or loops forever
 Union
Properties of  Intersection
Recursively  Complement
Enumerable
 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.
Union
 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
 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.
Intersection  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
 Suppose a system has 2 Turing Machines, TM1, and TM2.
 If TM1 crash then all the system crash.

Complement  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.
 A language is recursive if some turing machine accepts it and halts
on any input string.

 In other words:
A language is recursive if there is a membership algorithm for it.
Recursive  Let L be a recursive language and M the Turning Machine that
accepts it
 For string w:
 If w ∈ L then M halts in a final state
 If w ∉ L then M halts in a non-final state
 Union
Properties of  Concatenation

Recursive  Kleene Closure


 Intersection and complement
 Union: If L1 and If L2 are two recursive languages, their union
L1∪L2 will also be recursive because if TM halts for L1 and halts for
L2, it will also halt for L1∪L2.
 Concatenation: If L1 and If L2 are two recursive languages, their
concatenation L1.L2 will also be recursive. For Example:

Union &
Concatenation

L1 says n no. of a’s followed by n no. of b’s followed by n no. of c’s. L2


says m no. of d’s followed by m no. of e’s followed by m no. of f’s. Their
concatenation first matches no. of a’s, b’s and c’s and then matches
no. of d’s, e’s and f’s. So it can be decided by TM.
 Kleene Closure: If L1is recursive, its kleene closure L1* will also be
recursive. For Example:

 Intersection and complement: If L1 and If L2 are two recursive


Kleene Closure languages, their intersection L1 ∩ L2 will also be recursive. For
Example:
& Intersection
and
complement
L1 says n no. of a’s followed by n no. of b’s followed by n no. of c’s and then any
no. of d’s. L2 says any no. of a’s followed by n no. of b’s followed by n no. of c’s
followed by n no. of d’s. Their intersection says n no. of a’s followed by n no. of
b’s followed by n no. of c’s followed by n no. of d’s. So it can be decided by
turing machine, hence recursive.
Similarly, complement of recursive language L1 which is ∑*-L1, will also be
recursive.
 There is a specific language which is not recursively
enumerable(not accepted by any Turing Machine).
We will prove  There is a specific language which is recursively enumerable but
not recursive

You might also like