SlideShare a Scribd company logo
Undecidability
UNIT V
BY DR.T.P.LATCHOUMI
Introduction
Alan Turing first proved this result in 1936. It is related to Gödel's Incompleteness Theorem,
which states that there is no system of logic strong enough to prove all true sentences of number
theory.
Essentially, Gödel uses a fix point construction to construct a self-referential sentence of number
theory which states something to the effect: "I am not provable".
The argument is quite complex. However, the argument is basically analogous to the one given
in support of the fact that the truth value of the statement ‘I am telling lies’ can not be determined.
Cont…
In view of the large number of applications of modern computer systems that help us in solving
problems from almost every domain of human experience, you might be tempted to think that
computers can solve any problem if the problem is properly formulated.
 We will prove that such problems cannot be solved no matter.
◦ What language is used?
◦ What machine is used?
◦ Much computational resources are devoted in attempting to solve the problem, etc.
For problems that cannot be solved by computational means, we can approximate their solutions,
but it's impossible to get the perfectly correct solutions in all cases.
Decidable
Problems
Examples
Equivalence of two regular languages: Given two
regular languages, there is an algorithm and a Turing
machine to decide whether two regular languages are
equal or not.
Finiteness of regular languages: Given a regular
language, there is an algorithm and a Turing machine to
decide whether regular language is finite or not.
Emptiness of context free languages: Given a context
free language, there is an algorithm whether CFL is
empty or not.
A problem is decidable if we can
construct a Turing machine which
will halt in finite amount of time for
every input and give an answer as
‘yes’ or ‘no’.
A decidable problem has an
algorithm to determine the answer
for a given input.
Example 1
Example 2
Example 3
Cont…
Undecidable
problems
Examples
The ambiguity of context-free languages: Given a context-
free language, there is no Turing machine which will always
halt in finite amount of time and give an answer whether
language is ambiguous or not.
Equivalence of two context-free languages: Given two
context-free languages, there is no Turing machine which will
always halt in finite amount of time and give an answer
whether two context free languages are equal or not.
A problem is undecidable if there
is no Turing machine which will
always halt in finite amount of time
to give an answer as ‘yes’ or ‘no’.
An undecidable problem has no
algorithm to determine the answer
for a given input.
Cont….
Everything or completeness of CFG: Given a CFG and
input alphabet, whether CFG will generate all possible
strings of the input alphabet (∑*) is undecidable.
Regularity of the CFL, CSL, REC and REC: Given a
CFL, CSL, REC or REC, determining whether this
language is regular is undecidable.
Semi-decidable Problems
A semi-decidable problem is a subset of undecidable
problems for which Turing machine will always halt in
finite amount of time to answer as ‘yes’ and may or may not
halt for an answer as ‘no’.
Example
 Are two regular languages L and M equivalent?
We can easily check this by using Set Difference
operation.
L-M =Null and M-L =Null.
Hence (L-M) U (M-L) = Null, then L, M is equivalent.
 Membership of a CFL?
We can always find whether a string exists in a given
CFL by using on algorithms based on dynamic
programming.
 Emptiness of a CFL
By checking the production rules of the CFL we can
easily state whether the language generates any strings or
not.
We will now consider few
important Decidable problems:
The relationship between semi-decidable,
undecidable and decidable problem
Definitions
A language is called Decidable or
Recursive if there is a Turing
machine which accepts and halts on
every input string w.
Every decidable language is Turing-
Acceptable.
A decision problem P is decidable if the language L of all yes,
instances to P is decidable.
For a decidable language, for each
input string, the TM halts either at
the accept or the reject state as
depicted in the following diagram –
Example 1
Solution
Prime numbers = {2, 3, 5, 7, 11, 13, …………..}
Divide the number ‘m’ by all the numbers between ‘2’
and ‘√m’ starting from ‘2’.
If any of these numbers produce a remainder zero, then it
goes to the “Rejected state”, otherwise it goes to the
“Accepted state”. So, here the answer could be made by
‘Yes’ or ‘No’.
Hence, it is a decidable problem.
Find out whether the following
problem is decidable or not − Is a
number ‘m’ prime?
Example 2
Solution
Take the DFA that accepts L and check if w is accepted
Given a regular language L and
string w, how can we check if w ∈
L?
A Language that is not
Recursively
Enumerable (RE)
RE languages or type-0 languages are generated by
type-0 grammars.
A RE language can be accepted or recognized by Turing
machine which means it will enter into a final state for
the strings of language and may or may not enter into
rejecting state for the strings which are not part of the
language.
It means TM can loop forever for the strings which are
not a part of the language.
RE languages are also called as Turing recognizable
languages
Recursive Enumerable (RE) or
Type -0 Language
Definition
The language L is called a recursive enumerable
languages, if and only if each and every string which
belongs to L is either accepted by a Turing machine and
rejects or loops forever every other string which does not
belong to L.
In other words, we can say recursively enumerable (re)
languages are accepted by TM.
Recursive
Language (REC)
A recursive language (subset of RE) can be decided by
Turing machine which means it will enter into a final
state for the strings of language and rejecting state for the
strings which are not part of the language.
E.g.; L= {anbncn|n>=1} is recursive because we can
construct a Turing machine which will move to final
state if the string is of the form anbncn else move to non-
final state.
So the TM will always halt in this case. REC languages
are also called as Turing decidable languages.
Definition
Recursive Language = accepts L and rejects L’
Recursive Enumerable language= accepts L and rejects
or loops for L’.
The relationship between RE and REC languages can be
shown in Figure.
A language L is recursive if there is a
Turing machine that recognizers L.
The recursively enumerable
languages are called Turing-
acceptable and recursive languages
are called Turing-decidable
respectively.
Let L be any language accepted by
TM and L’ be the complement of L.
Types of TM
Properties of Recursive
and Recursively
enumerable language
Theorem 1:
If the language L is a recursive language, then the complement of
L’ is also a recursive language. That is recursive language are
closed under complementation.
Proof:
Let M be a TM which accepts the input w and enters into the
accept halt state.
Construct M’ such that if M enters in halt state without accepting w
then M’ enters in the halt state by accepting the same w.
A language is recursive if at least
one Turing machine exits which
accepts it and rejects its
complement.
There is no loop forever set existing
in TM for recursive languages.
Theorem 2
Proof:
Let L1 and L2 be the two recursive languages is recursive and union of two
recursively enumerable languages is also a recursively enumerable language.
We construct M, which first simulates M1.
If M1 accepts, then M accepts, if M1 rejects, then M simulates M2 and accepts if
and only if M2 accepts.
Since both M1 and M2 are algorithms, M is definitely going to halt.
Thus M accepts L1UL2.
The union of two recursive
languages is recursive and union of
two recursively enumerable
languages is also a recursively
enumerable language.
a. Construction of recursive languages.
b. Construction of recursively enumerable
languages
Theorem 3
Proof:
Let L and L’ are the languages accepted by M1 and M2
respectively.
Simulate M1 and M2 simultaneously M accepts w if M1
accepts w and rejects w if M2 accepts w.
If language L and its complement L’
both are recursively enumerable,
then L and L’ are recursive.
Example 1
Cont….
Example 2
Cont…
Theorem
Cont…
Cont…
An Undecidable
problem that is
RE
We have already shown that it is
undecidable whether a context-free
grammar is ambiguous.
The proof technique we used was to
reduce Post’s Correspondence
Problem to the ambiguity problem for
CFG’s.
We can also use this proof technique
to show a number of important
problems about context-free
languages are undecidable.
Cont…
Proof of the undecidability of the
validity problem for the set of
sentences written as a formal-exists
quantifier alternation applied to
positive word equations.
A corollary of this undecidability
result is that this set is undecidable
even with sentences with at most
two occurrences of a string variable.
Undecidable
problems about
Turing Machine
Examples of undecidable problems
• About Turing machines:
Is the language accepted by a TM empty, finite, regular, or
context-free?
Does a TM meet its “specification ? ,” that is, does it have
any “bugs.”
One may ask, Why is this important? A reduction of
problem B to problem A shows that problem A is at least as
difficult to solve as problem B.
Also, we can show the following:
• To show that a problem A is undecidable, we reduce
another problem that is known to be undecidable to A.
• Having proved that the halting problem is undecidable, we
use problem reduction to show that other problems are
undecidable.
Once we have shown that the
halting problem is undecidable, we
can show that a large class of other
problems about the input/output
behavior of programs is
undecidable.
Example 1:
Totality
Problem
Proof: We prove that the halting problem is reducible to
the totality problem. That is, if an algorithm can solve the
totality problem, it can be used to solve the halting
problem. Since no algorithm can solve the halting
problem, the totality problem must also be undecidable.
The reduction is as follows. For any TM M and input w,
we create another TM M1 that takes an arbitrary input,
ignores it, and runs M on w.
Note that M1 halts at all inputs if and only if M halts on
input w. Therefore, an algorithm that tells us whether M1
halts on all inputs also tells us whether M halts on input
w, which would be a solution to the halting problem.
Hence, The totality problem is undecidable.
Decide whether an arbitrary TM
halts on all inputs. (If it does, it
computes a “total function”).
This is equivalent to the problem of
whether a program can ever enter
an infinite loop, for any input.
It differs from the halting problem,
which asks whether it enters an
infinite loop for a particular input.
Example 2:
Equivalence
problem
Proof: We prove that the totality problem is reducible to
the equivalence problem. That is, if an algorithm can
solve the equivalence problem, it can be used to solve
the totality problem. Since no algorithm can solve the
totality problem, the equivalence problem must also be
unsolvable.
The reduction is as follows. For any TM M, we can
construct a TM M1 that takes any input w, runs M on that
input, and outputs “yes” if M halts on w.
We can also construct a TM M2 that takes any input and
simply outputs “yes.” If an algorithm can tell us whether
M1 and M2 are equivalent, it can also tell us whether M1
halts on all inputs, which would be a solution to the
totality problem.
Hence, the equivalence problem is undecidable.
Decide whether two TMs accept the
same language.
This is equivalent to the problem of
whether two programs compute the
same output for every input.
Post’s
Correspondence
Problem
Let Σ be an alphabet, and let L and M be two lists of
nonempty strings over Σ, such that L and M have the
same number of strings. We can represent L and M as
follows.
Undecidable problems arise in
language theory also. It is required
to develop techniques for proving
particular problems undecidable.
In 1946, Emil Post proved that the
following problem is undecidable:
Example 1
Example 2
Example 3
Consider the following instance of the PCP:
Alphabet Σ = { a, b }
List L = (a, ab)
List M = (aa, b)
We see that ( 1, 2 ) is a sequence of integers that solves
this PCP instance, since the concatenation of a and ab is
equal to the concatenation of aa and b (i.e w1 w2 = v1 v2
= aab). other solutions include: ( 1, 2, 1, 2 ) , ( 1, 2, 1, 2,
1, 2 ) and so on.
Example 4
Solution:
A solution is 2, 1, 1, 3. That means w2w1w1w3 = x2x1x1x3
The constructed string from both lists is bab3b3a.
Consider the correspondence
system as given below
A = (b, bab3, ba) and B = (b3, ba, a).
The input set is ∑ = {0, 1}. Find the
solution.
Rice Theorem
Formal Definition
If P is a non-trivial property, and the language holding
the property, Lp , is recognized by Turing machine M,
then Lp = {<M> | L(M) ∈ P} is undecidable.
Rice theorem states that any non-
trivial semantic property of a
language which is recognized by a
Turing machine is undecidable.
A property, P, is the language of all
Turing machines that satisfy that
property.
Description and
Properties
Property of languages, P, is simply a set of languages. If
any language belongs to P (L ∈ P), it is said that L satisfies
the property P.
A property is called to be trivial if either it is not satisfied
by any recursively enumerable languages, or if it is satisfied
by all recursively enumerable languages.
A non-trivial property is satisfied by some recursively
enumerable languages and are not satisfied by others.
Formally speaking, in a non-trivial property, where L ∈ P,
both the following properties hold:
◦ Property 1 − There exists Turing Machines, M1 and M2 that
recognize the same language, i.e. either ( <M1>, <M2> ∈ L ) or
( <M1>,<M2> ∉ L )
◦ Property 2 − There exists Turing Machines M1 and M2, where
M1 recognizes the language while M2 does not, i.e. <M1> ∈ L
and <M2> ∉ L
Theorem
Cont…
Rice theorem
for some
undecidable
languages
Any non-trivial property of the
language recognizable by a Turing
machine (recursively enumerable
language) is undecidable.
Rice theorem for some
unrecognizable
language
Any non-monotonic property of the
language recognizable by a Turing
machine (recursively enumerable
language) is unrecognizable
Cont…
Cont….
Applications of
Rice’s Theorem
From Rice’s theorem, we can conclude that a whole host
of TM-related problems are undecidable, including:
Is L(M)L(M) a regular language?
Is L(M)L(M) a CFL?
Is L(M)L(M) empty?
Does L(M)L(M) include any palindromes?
Unit v

More Related Content

What's hot

Turing Machine
Turing MachineTuring Machine
Turing Machine
AniketKandara1
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1
Rajendran
 
Semantic analysis
Semantic analysisSemantic analysis
Semantic analysis
Lahore Garrison University
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture Notes
FellowBuddy.com
 
Turing machines
Turing machinesTuring machines
Turing machines
surekamurali
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory
Rajendran
 
Turing machine
Turing machineTuring machine
Turing machine
MuhammadSamranTanvee
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
Deepjyoti Kalita
 
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
United International University
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
TM - Techniques
TM - TechniquesTM - Techniques
TM - Techniques
Rajendran
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
Anshuman Biswal
 
Turing machines
Turing machinesTuring machines
Turing machines
lavishka_anuj
 
Pumping lemma for regular language
Pumping lemma for regular languagePumping lemma for regular language
Pumping lemma for regular language
sadique_ghitm
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
Rajendran
 
Np complete
Np completeNp complete
Turing machine
Turing machineTuring machine
Turing machine
HimanshuSirohi6
 
Automata theory
Automata theoryAutomata theory
Automata theory
Pardeep Vats
 
0.0 Introduction to theory of computation
0.0 Introduction to theory of computation0.0 Introduction to theory of computation
0.0 Introduction to theory of computation
Sampath Kumar S
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machines
Irfan Anjum
 

What's hot (20)

Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1
 
Semantic analysis
Semantic analysisSemantic analysis
Semantic analysis
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture Notes
 
Turing machines
Turing machinesTuring machines
Turing machines
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
 
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
TM - Techniques
TM - TechniquesTM - Techniques
TM - Techniques
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Turing machines
Turing machinesTuring machines
Turing machines
 
Pumping lemma for regular language
Pumping lemma for regular languagePumping lemma for regular language
Pumping lemma for regular language
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
 
Np complete
Np completeNp complete
Np complete
 
Turing machine
Turing machineTuring machine
Turing machine
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
0.0 Introduction to theory of computation
0.0 Introduction to theory of computation0.0 Introduction to theory of computation
0.0 Introduction to theory of computation
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machines
 

Similar to Unit v

chapter 2.pptx
chapter 2.pptxchapter 2.pptx
chapter 2.pptx
sampathkumar912515
 
Undecidability Basic definitions.pptx
Undecidability Basic definitions.pptxUndecidability Basic definitions.pptx
Undecidability Basic definitions.pptx
sajinis3
 
Theory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence ProblemTheory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence Problem
Karan Thakkar
 
QB104545.pdf
QB104545.pdfQB104545.pdf
QB104545.pdf
MrRRajasekarCSE
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
adugnanegero
 
Presentation (5).pdf
Presentation (5).pdfPresentation (5).pdf
Presentation (5).pdf
Gaurav447273
 
Turing machine and Halting Introduction
Turing machine and Halting IntroductionTuring machine and Halting Introduction
Turing machine and Halting Introduction
AmartyaYandrapu1
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
mukul narayana
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
mukul narayana
 
Types of Language in Theory of Computation
Types of Language in Theory of ComputationTypes of Language in Theory of Computation
Types of Language in Theory of Computation
Ankur Singh
 
Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5
Srimatre K
 
lect_23.pdf
lect_23.pdflect_23.pdf
lect_23.pdf
test490946
 
Incompleteness without Godel Numberings
Incompleteness without Godel NumberingsIncompleteness without Godel Numberings
Incompleteness without Godel Numberings
Satvik Beri
 
Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)
Siddharaj Junnarkar
 
Chomsky classification for types of grammars
Chomsky classification for types of grammarsChomsky classification for types of grammars
Chomsky classification for types of grammars
VikrantSharma506366
 
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theory
NYversity
 
Examples of undecidable problems and problems.pptx
Examples of undecidable problems and problems.pptxExamples of undecidable problems and problems.pptx
Examples of undecidable problems and problems.pptx
sajinis3
 
slides3.pdf
slides3.pdfslides3.pdf
slides3.pdf
test490946
 
NP completeness
NP completenessNP completeness
NP completeness
Amrinder Arora
 
Unit ii
Unit iiUnit ii
Unit ii
TPLatchoumi
 

Similar to Unit v (20)

chapter 2.pptx
chapter 2.pptxchapter 2.pptx
chapter 2.pptx
 
Undecidability Basic definitions.pptx
Undecidability Basic definitions.pptxUndecidability Basic definitions.pptx
Undecidability Basic definitions.pptx
 
Theory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence ProblemTheory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence Problem
 
QB104545.pdf
QB104545.pdfQB104545.pdf
QB104545.pdf
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
 
Presentation (5).pdf
Presentation (5).pdfPresentation (5).pdf
Presentation (5).pdf
 
Turing machine and Halting Introduction
Turing machine and Halting IntroductionTuring machine and Halting Introduction
Turing machine and Halting Introduction
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
 
Ch11.ppt
Ch11.pptCh11.ppt
Ch11.ppt
 
Types of Language in Theory of Computation
Types of Language in Theory of ComputationTypes of Language in Theory of Computation
Types of Language in Theory of Computation
 
Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5
 
lect_23.pdf
lect_23.pdflect_23.pdf
lect_23.pdf
 
Incompleteness without Godel Numberings
Incompleteness without Godel NumberingsIncompleteness without Godel Numberings
Incompleteness without Godel Numberings
 
Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)
 
Chomsky classification for types of grammars
Chomsky classification for types of grammarsChomsky classification for types of grammars
Chomsky classification for types of grammars
 
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theory
 
Examples of undecidable problems and problems.pptx
Examples of undecidable problems and problems.pptxExamples of undecidable problems and problems.pptx
Examples of undecidable problems and problems.pptx
 
slides3.pdf
slides3.pdfslides3.pdf
slides3.pdf
 
NP completeness
NP completenessNP completeness
NP completeness
 
Unit ii
Unit iiUnit ii
Unit ii
 

More from TPLatchoumi

Unit 3
Unit 3Unit 3
Unit 3
TPLatchoumi
 
Unit 2
Unit 2Unit 2
Unit 2
TPLatchoumi
 
Unit iii
Unit iiiUnit iii
Unit iii
TPLatchoumi
 
Unit i
Unit iUnit i
Unit i
TPLatchoumi
 
Unit 1
Unit 1Unit 1
Unit 1
TPLatchoumi
 
Unit iv
Unit ivUnit iv
Unit iv
TPLatchoumi
 
Coa
Coa Coa
17 cs002
17 cs00217 cs002
17 cs002
TPLatchoumi
 

More from TPLatchoumi (8)

Unit 3
Unit 3Unit 3
Unit 3
 
Unit 2
Unit 2Unit 2
Unit 2
 
Unit iii
Unit iiiUnit iii
Unit iii
 
Unit i
Unit iUnit i
Unit i
 
Unit 1
Unit 1Unit 1
Unit 1
 
Unit iv
Unit ivUnit iv
Unit iv
 
Coa
Coa Coa
Coa
 
17 cs002
17 cs00217 cs002
17 cs002
 

Recently uploaded

sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
Madhumitha Jayaram
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 

Recently uploaded (20)

sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 

Unit v

  • 2. Introduction Alan Turing first proved this result in 1936. It is related to Gödel's Incompleteness Theorem, which states that there is no system of logic strong enough to prove all true sentences of number theory. Essentially, Gödel uses a fix point construction to construct a self-referential sentence of number theory which states something to the effect: "I am not provable". The argument is quite complex. However, the argument is basically analogous to the one given in support of the fact that the truth value of the statement ‘I am telling lies’ can not be determined.
  • 3. Cont… In view of the large number of applications of modern computer systems that help us in solving problems from almost every domain of human experience, you might be tempted to think that computers can solve any problem if the problem is properly formulated.  We will prove that such problems cannot be solved no matter. ◦ What language is used? ◦ What machine is used? ◦ Much computational resources are devoted in attempting to solve the problem, etc. For problems that cannot be solved by computational means, we can approximate their solutions, but it's impossible to get the perfectly correct solutions in all cases.
  • 4. Decidable Problems Examples Equivalence of two regular languages: Given two regular languages, there is an algorithm and a Turing machine to decide whether two regular languages are equal or not. Finiteness of regular languages: Given a regular language, there is an algorithm and a Turing machine to decide whether regular language is finite or not. Emptiness of context free languages: Given a context free language, there is an algorithm whether CFL is empty or not. A problem is decidable if we can construct a Turing machine which will halt in finite amount of time for every input and give an answer as ‘yes’ or ‘no’. A decidable problem has an algorithm to determine the answer for a given input.
  • 9. Undecidable problems Examples The ambiguity of context-free languages: Given a context- free language, there is no Turing machine which will always halt in finite amount of time and give an answer whether language is ambiguous or not. Equivalence of two context-free languages: Given two context-free languages, there is no Turing machine which will always halt in finite amount of time and give an answer whether two context free languages are equal or not. A problem is undecidable if there is no Turing machine which will always halt in finite amount of time to give an answer as ‘yes’ or ‘no’. An undecidable problem has no algorithm to determine the answer for a given input.
  • 10. Cont…. Everything or completeness of CFG: Given a CFG and input alphabet, whether CFG will generate all possible strings of the input alphabet (∑*) is undecidable. Regularity of the CFL, CSL, REC and REC: Given a CFL, CSL, REC or REC, determining whether this language is regular is undecidable.
  • 11. Semi-decidable Problems A semi-decidable problem is a subset of undecidable problems for which Turing machine will always halt in finite amount of time to answer as ‘yes’ and may or may not halt for an answer as ‘no’.
  • 12. Example  Are two regular languages L and M equivalent? We can easily check this by using Set Difference operation. L-M =Null and M-L =Null. Hence (L-M) U (M-L) = Null, then L, M is equivalent.  Membership of a CFL? We can always find whether a string exists in a given CFL by using on algorithms based on dynamic programming.  Emptiness of a CFL By checking the production rules of the CFL we can easily state whether the language generates any strings or not. We will now consider few important Decidable problems:
  • 13. The relationship between semi-decidable, undecidable and decidable problem
  • 14. Definitions A language is called Decidable or Recursive if there is a Turing machine which accepts and halts on every input string w. Every decidable language is Turing- Acceptable. A decision problem P is decidable if the language L of all yes, instances to P is decidable.
  • 15. For a decidable language, for each input string, the TM halts either at the accept or the reject state as depicted in the following diagram –
  • 16. Example 1 Solution Prime numbers = {2, 3, 5, 7, 11, 13, …………..} Divide the number ‘m’ by all the numbers between ‘2’ and ‘√m’ starting from ‘2’. If any of these numbers produce a remainder zero, then it goes to the “Rejected state”, otherwise it goes to the “Accepted state”. So, here the answer could be made by ‘Yes’ or ‘No’. Hence, it is a decidable problem. Find out whether the following problem is decidable or not − Is a number ‘m’ prime?
  • 17. Example 2 Solution Take the DFA that accepts L and check if w is accepted Given a regular language L and string w, how can we check if w ∈ L?
  • 18. A Language that is not Recursively Enumerable (RE) RE languages or type-0 languages are generated by type-0 grammars. A RE language can be accepted or recognized by Turing machine which means it will enter into a final state for the strings of language and may or may not enter into rejecting state for the strings which are not part of the language. It means TM can loop forever for the strings which are not a part of the language. RE languages are also called as Turing recognizable languages Recursive Enumerable (RE) or Type -0 Language
  • 19. Definition The language L is called a recursive enumerable languages, if and only if each and every string which belongs to L is either accepted by a Turing machine and rejects or loops forever every other string which does not belong to L. In other words, we can say recursively enumerable (re) languages are accepted by TM.
  • 20. Recursive Language (REC) A recursive language (subset of RE) can be decided by Turing machine which means it will enter into a final state for the strings of language and rejecting state for the strings which are not part of the language. E.g.; L= {anbncn|n>=1} is recursive because we can construct a Turing machine which will move to final state if the string is of the form anbncn else move to non- final state. So the TM will always halt in this case. REC languages are also called as Turing decidable languages.
  • 21. Definition Recursive Language = accepts L and rejects L’ Recursive Enumerable language= accepts L and rejects or loops for L’. The relationship between RE and REC languages can be shown in Figure. A language L is recursive if there is a Turing machine that recognizers L. The recursively enumerable languages are called Turing- acceptable and recursive languages are called Turing-decidable respectively. Let L be any language accepted by TM and L’ be the complement of L.
  • 23. Properties of Recursive and Recursively enumerable language Theorem 1: If the language L is a recursive language, then the complement of L’ is also a recursive language. That is recursive language are closed under complementation. Proof: Let M be a TM which accepts the input w and enters into the accept halt state. Construct M’ such that if M enters in halt state without accepting w then M’ enters in the halt state by accepting the same w. A language is recursive if at least one Turing machine exits which accepts it and rejects its complement. There is no loop forever set existing in TM for recursive languages.
  • 24. Theorem 2 Proof: Let L1 and L2 be the two recursive languages is recursive and union of two recursively enumerable languages is also a recursively enumerable language. We construct M, which first simulates M1. If M1 accepts, then M accepts, if M1 rejects, then M simulates M2 and accepts if and only if M2 accepts. Since both M1 and M2 are algorithms, M is definitely going to halt. Thus M accepts L1UL2. The union of two recursive languages is recursive and union of two recursively enumerable languages is also a recursively enumerable language. a. Construction of recursive languages. b. Construction of recursively enumerable languages
  • 25. Theorem 3 Proof: Let L and L’ are the languages accepted by M1 and M2 respectively. Simulate M1 and M2 simultaneously M accepts w if M1 accepts w and rejects w if M2 accepts w. If language L and its complement L’ both are recursively enumerable, then L and L’ are recursive.
  • 33. An Undecidable problem that is RE We have already shown that it is undecidable whether a context-free grammar is ambiguous. The proof technique we used was to reduce Post’s Correspondence Problem to the ambiguity problem for CFG’s. We can also use this proof technique to show a number of important problems about context-free languages are undecidable.
  • 34. Cont… Proof of the undecidability of the validity problem for the set of sentences written as a formal-exists quantifier alternation applied to positive word equations. A corollary of this undecidability result is that this set is undecidable even with sentences with at most two occurrences of a string variable.
  • 35. Undecidable problems about Turing Machine Examples of undecidable problems • About Turing machines: Is the language accepted by a TM empty, finite, regular, or context-free? Does a TM meet its “specification ? ,” that is, does it have any “bugs.” One may ask, Why is this important? A reduction of problem B to problem A shows that problem A is at least as difficult to solve as problem B. Also, we can show the following: • To show that a problem A is undecidable, we reduce another problem that is known to be undecidable to A. • Having proved that the halting problem is undecidable, we use problem reduction to show that other problems are undecidable. Once we have shown that the halting problem is undecidable, we can show that a large class of other problems about the input/output behavior of programs is undecidable.
  • 36. Example 1: Totality Problem Proof: We prove that the halting problem is reducible to the totality problem. That is, if an algorithm can solve the totality problem, it can be used to solve the halting problem. Since no algorithm can solve the halting problem, the totality problem must also be undecidable. The reduction is as follows. For any TM M and input w, we create another TM M1 that takes an arbitrary input, ignores it, and runs M on w. Note that M1 halts at all inputs if and only if M halts on input w. Therefore, an algorithm that tells us whether M1 halts on all inputs also tells us whether M halts on input w, which would be a solution to the halting problem. Hence, The totality problem is undecidable. Decide whether an arbitrary TM halts on all inputs. (If it does, it computes a “total function”). This is equivalent to the problem of whether a program can ever enter an infinite loop, for any input. It differs from the halting problem, which asks whether it enters an infinite loop for a particular input.
  • 37. Example 2: Equivalence problem Proof: We prove that the totality problem is reducible to the equivalence problem. That is, if an algorithm can solve the equivalence problem, it can be used to solve the totality problem. Since no algorithm can solve the totality problem, the equivalence problem must also be unsolvable. The reduction is as follows. For any TM M, we can construct a TM M1 that takes any input w, runs M on that input, and outputs “yes” if M halts on w. We can also construct a TM M2 that takes any input and simply outputs “yes.” If an algorithm can tell us whether M1 and M2 are equivalent, it can also tell us whether M1 halts on all inputs, which would be a solution to the totality problem. Hence, the equivalence problem is undecidable. Decide whether two TMs accept the same language. This is equivalent to the problem of whether two programs compute the same output for every input.
  • 38. Post’s Correspondence Problem Let Σ be an alphabet, and let L and M be two lists of nonempty strings over Σ, such that L and M have the same number of strings. We can represent L and M as follows. Undecidable problems arise in language theory also. It is required to develop techniques for proving particular problems undecidable. In 1946, Emil Post proved that the following problem is undecidable:
  • 41. Example 3 Consider the following instance of the PCP: Alphabet Σ = { a, b } List L = (a, ab) List M = (aa, b) We see that ( 1, 2 ) is a sequence of integers that solves this PCP instance, since the concatenation of a and ab is equal to the concatenation of aa and b (i.e w1 w2 = v1 v2 = aab). other solutions include: ( 1, 2, 1, 2 ) , ( 1, 2, 1, 2, 1, 2 ) and so on.
  • 42. Example 4 Solution: A solution is 2, 1, 1, 3. That means w2w1w1w3 = x2x1x1x3 The constructed string from both lists is bab3b3a. Consider the correspondence system as given below A = (b, bab3, ba) and B = (b3, ba, a). The input set is ∑ = {0, 1}. Find the solution.
  • 43. Rice Theorem Formal Definition If P is a non-trivial property, and the language holding the property, Lp , is recognized by Turing machine M, then Lp = {<M> | L(M) ∈ P} is undecidable. Rice theorem states that any non- trivial semantic property of a language which is recognized by a Turing machine is undecidable. A property, P, is the language of all Turing machines that satisfy that property.
  • 44. Description and Properties Property of languages, P, is simply a set of languages. If any language belongs to P (L ∈ P), it is said that L satisfies the property P. A property is called to be trivial if either it is not satisfied by any recursively enumerable languages, or if it is satisfied by all recursively enumerable languages. A non-trivial property is satisfied by some recursively enumerable languages and are not satisfied by others. Formally speaking, in a non-trivial property, where L ∈ P, both the following properties hold: ◦ Property 1 − There exists Turing Machines, M1 and M2 that recognize the same language, i.e. either ( <M1>, <M2> ∈ L ) or ( <M1>,<M2> ∉ L ) ◦ Property 2 − There exists Turing Machines M1 and M2, where M1 recognizes the language while M2 does not, i.e. <M1> ∈ L and <M2> ∉ L
  • 47. Rice theorem for some undecidable languages Any non-trivial property of the language recognizable by a Turing machine (recursively enumerable language) is undecidable.
  • 48. Rice theorem for some unrecognizable language Any non-monotonic property of the language recognizable by a Turing machine (recursively enumerable language) is unrecognizable
  • 51. Applications of Rice’s Theorem From Rice’s theorem, we can conclude that a whole host of TM-related problems are undecidable, including: Is L(M)L(M) a regular language? Is L(M)L(M) a CFL? Is L(M)L(M) empty? Does L(M)L(M) include any palindromes?