1. The document discusses decidability and undecidability of problems and languages. Decidable problems have Turing machines that always halt, while undecidable problems do not.
2. The halting problem is introduced as an example of an undecidable problem. It is shown that no Turing machine can correctly determine if an arbitrary machine will halt on a given input.
3. Languages are classified as recursive, recursively enumerable, or non-recursively enumerable. The diagonalization language is given as an example of a non-recursively enumerable language, showing that more languages exist than Turing machines.
A grammar is said to be regular, if the production is in the form -
A → αB,
A -> a,
A → ε,
for A, B ∈ N, a ∈ Σ, and ε the empty string
A regular grammar is a 4 tuple -
G = (V, Σ, P, S)
V - It is non-empty, finite set of non-terminal symbols,
Σ - finite set of terminal symbols, (Σ ∈ V),
P - a finite set of productions or rules,
S - start symbol, S ∈ (V - Σ)
Finite automaton discussed so far, is just associated with the RE or the language.
There is a question whether does there exist an FA which generates an output string corresponding to each input string ? The answer is yes. Such machines are called machines with output.
There are two types of machines with output.
Moore machine
Mealy machine
Equivalent machines Two machines are said to be equivalent if they print the same output string when the same input string is run on them.
A grammar is said to be regular, if the production is in the form -
A → αB,
A -> a,
A → ε,
for A, B ∈ N, a ∈ Σ, and ε the empty string
A regular grammar is a 4 tuple -
G = (V, Σ, P, S)
V - It is non-empty, finite set of non-terminal symbols,
Σ - finite set of terminal symbols, (Σ ∈ V),
P - a finite set of productions or rules,
S - start symbol, S ∈ (V - Σ)
Finite automaton discussed so far, is just associated with the RE or the language.
There is a question whether does there exist an FA which generates an output string corresponding to each input string ? The answer is yes. Such machines are called machines with output.
There are two types of machines with output.
Moore machine
Mealy machine
Equivalent machines Two machines are said to be equivalent if they print the same output string when the same input string is run on them.
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docxjasoninnes20
Busy week
• Lab 9 due Thursday at 5 pm:
L = { <M,s> : s ∈ L(M) and |L(M)| % 2 = 0}. For example, suppose that L(M) = {aa}. Then
<M,aa> ∉ L because |L(M)| = 1, 1 % 2 = 1; If L(M) {a,aaa} then <M,ℇ> ∉ L because ℇ ∉ L(M),
but <M,aaa> ∈ L. Prove that L ∉ D by reduction from H.
Your proof could implement R, the mapping reduction function, as a Java or Python program in
the form demonstrated, which allows the user to configure whether M halts on w.
We start the proof by creating R. We start are by thinking of the input to ouput. What's the
input to the function R? Remember that R is a mapping reduction from H to L. So the input to
R must be something that could be in H. <M,w> has the correct syntactic form. Could R return
this: <M#,aaa>? think of terms of whether the output of R could possible be in L.
R(<M,w>) =
1. Define M#:
1.a
1.x Run M on w
2. Return M#,aaa>
M halts on w, <M#,aaa> is in L. So if you make it through step 1.x, then M#,aaa satisfies the
characteristic function of L.
and if M does not halt on w, <M#,aaa> is not in L. If you don't get through 1.x, then you lack
some component of the characteristic function.
• Online Pumping Theorem workshop Thursday at 9 pm: (10 extra credit points for full
participation)
• Lab 10 due Monday at noon:
L {<M,s> : s ∈ L(M), |L(M)| = 2}. Prove that L ∉ SD by a reduction from ¬H}
• HW #3 due Friday May 8 at 2 pm.
• Midterm #3 Tuesday May 12
Rice Theorem and Semidecidability Page 1
Rice's Theorem and Semidecidability
Mapping Reducibility
Recall that a mapping reduction function ƒ transforms an L₁ membership question into an L₂
membership question:
∀x∈Σ* (x ∈ L₁ iff ƒ(x) ∈ L₂)
H = { <M,w> : M halts on w>
Hε = {<M> : M halts on ε}. That is the strings in the language Hε are encodings of TMs
such tht the encoded TM halts when started on an empty input tape.
if H ≤M Hε then if Hε ∈ D then H ∈ D; But we know that H is not decidable.
And so by applying the modus tollens logic rule to the implicaion,
Hε ∉ D
If there's a target langauge that we want to show is not decidable, than we show that
by showing that a not decidable langauge, like H, is mapping reducible to the target
language.
It seems more natural to go in the other direction, H ≤M Hε: Reduce the problem of whether
you can decide if M will halt on some particular string to, whether you can decide if M will halt
on any string. But we already know that H ∈ SD/D, and we are using that knowlege to prove
something about Hε.
This proof is confusing at first because it uses two languages, H and Hε, five different TMs, and
two string variables:
TM 1: Mₒ (the "Oracle"), the hypothetical machine that could decide Hε. It may be helpful to
think of it as a source code analyzer, which claims to be able to inspect any high-level TM
description and tell whether the machine would be an element of the target language.
TM 2: R, which implements the mapping reduction fun ...
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docxclairbycraft
Busy week
• Lab 9 due Thursday at 5 pm:
L = { <M,s> : s ∈ L(M) and |L(M)| % 2 = 0}. For example, suppose that L(M) = {aa}. Then
<M,aa> ∉ L because |L(M)| = 1, 1 % 2 = 1; If L(M) {a,aaa} then <M,ℇ> ∉ L because ℇ ∉ L(M),
but <M,aaa> ∈ L. Prove that L ∉ D by reduction from H.
Your proof could implement R, the mapping reduction function, as a Java or Python program in
the form demonstrated, which allows the user to configure whether M halts on w.
We start the proof by creating R. We start are by thinking of the input to ouput. What's the
input to the function R? Remember that R is a mapping reduction from H to L. So the input to
R must be something that could be in H. <M,w> has the correct syntactic form. Could R return
this: <M#,aaa>? think of terms of whether the output of R could possible be in L.
R(<M,w>) =
1. Define M#:
1.a
1.x Run M on w
2. Return M#,aaa>
M halts on w, <M#,aaa> is in L. So if you make it through step 1.x, then M#,aaa satisfies the
characteristic function of L.
and if M does not halt on w, <M#,aaa> is not in L. If you don't get through 1.x, then you lack
some component of the characteristic function.
• Online Pumping Theorem workshop Thursday at 9 pm: (10 extra credit points for full
participation)
• Lab 10 due Monday at noon:
L {<M,s> : s ∈ L(M), |L(M)| = 2}. Prove that L ∉ SD by a reduction from ¬H}
• HW #3 due Friday May 8 at 2 pm.
• Midterm #3 Tuesday May 12
Rice Theorem and Semidecidability Page 1
Rice's Theorem and Semidecidability
Mapping Reducibility
Recall that a mapping reduction function ƒ transforms an L₁ membership question into an L₂
membership question:
∀x∈Σ* (x ∈ L₁ iff ƒ(x) ∈ L₂)
H = { <M,w> : M halts on w>
Hε = {<M> : M halts on ε}. That is the strings in the language Hε are encodings of TMs
such tht the encoded TM halts when started on an empty input tape.
if H ≤M Hε then if Hε ∈ D then H ∈ D; But we know that H is not decidable.
And so by applying the modus tollens logic rule to the implicaion,
Hε ∉ D
If there's a target langauge that we want to show is not decidable, than we show that
by showing that a not decidable langauge, like H, is mapping reducible to the target
language.
It seems more natural to go in the other direction, H ≤M Hε: Reduce the problem of whether
you can decide if M will halt on some particular string to, whether you can decide if M will halt
on any string. But we already know that H ∈ SD/D, and we are using that knowlege to prove
something about Hε.
This proof is confusing at first because it uses two languages, H and Hε, five different TMs, and
two string variables:
TM 1: Mₒ (the "Oracle"), the hypothetical machine that could decide Hε. It may be helpful to
think of it as a source code analyzer, which claims to be able to inspect any high-level TM
description and tell whether the machine would be an element of the target language.
TM 2: R, which implements the mapping reduction fun.
Some New Exercises on Computability Theory Associated with Turing Machinerahulmonikasharma
In this paper we present the problems previously encountered in the academic literature related to Turing machines that allow to check the students' understanding of the actual, rather than formal memorizing definitions and concepts.
Some New Exercises on Computability Theory Associated with Turing Machinerahulmonikasharma
In this paper we present the problems previously encountered in the academic literature related to Turing machines that allow to check the students' understanding of the actual, rather than formal memorizing definitions and concepts.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
2. 2
Decidability vs. Undecidability
There are two types of TMs (based on halting):
(Recursive)
TMs that always halt, no matter accepting or non-
accepting DECIDABLE PROBLEMS
(Recursively enumerable)
TMs that are guaranteed to halt only on acceptance. If
non-accepting, it may or may not halt (i.e., could loop
forever).
Undecidability:
Undecidable problems are those that are not
recursive
3. 3
Recursive, RE, Undecidable languages
Regular
(DFA)
Context-
free
(PDA)
Context
sensitive
Recursive
Recursively
Enumerable
(RE)
Non-RE Languages
(all other languages for which
no TMs can be built)
LBA
TMs that always halt
TMs that may or
may not halt
No TMs exist
“Undecidable” problems
“Decidable” problems
4. 4
Recursive Languages &
Recursively Enumerable (RE)
languages
Any TM for a Recursive language is going to
look like this:
Any TM for a Recursively Enumerable (RE)
language is going to look like this:
M
w
“accept”
“reject”
M
w
“accept”
8. Recursive Langs are closed
under Union
Let Mu = TM for L1 U L2
Mu construction:
1. Make 2-tapes and
copy input w on both
tapes
2. Simulate M1 on tape 1
3. Simulate M2 on tape 2
4. If either M1 or M2
accepts, then Mu
accepts
5. Otherwise, Mu rejects.
8
w
M1
M2
accept
reject
accept
reject
OR
Mu
9. Recursive Langs are closed
under Intersection
Let Mn = TM for L1 L2
Mn construction:
1. Make 2-tapes and
copy input w on both
tapes
2. Simulate M1 on tape 1
3. Simulate M2 on tape 2
4. If M1 AND M2 accepts,
then Mn accepts
5. Otherwise, Mn rejects.
9
w
M1
M2
accept
reject
accept
reject
Mn
AND
AND
10. 10
Other Closure Property
Results
Recursive languages are also closed under:
Concatenation
Kleene closure (star operator)
Homomorphism, and inverse homomorphism
RE languages are closed under:
Union, intersection, concatenation, Kleene closure
RE languages are not closed under:
complementation
11. 11
“Languages” vs. “Problems”
A “language” is a set of strings
Any “problem” can be expressed as a set of all
strings that are of the form:
“<input, output>”
==> Every problem also corresponds to a
language!!
Think of the language for a “problem” == a verifier for the problem
e.g., Problem (a+b) ≡ Language of strings of the form { “a#b, a+b” }
14. 14
What is the Halting Problem?
Definition of the “halting problem”:
Does a givenTuring Machine M halt on
a given input w?
Machine
M
Input w
15. 15
The Universal Turing Machine
Given: TM M & its input w
Aim: Build another TM called “H”, that will output:
“accept” if M accepts w, and
“reject” otherwise
An algorithm for H:
Simulate M on w
H(<M,w>) =
accept, if M accepts w
reject, if M does does not accept w
A Turing Machine simulator
Question: If M does not halt on w, what will happen to H?
Implies: H is in RE
16. 16
A Claim
Claim: No H that is always guaranteed
to halt, can exist!
Proof: (Alan Turing, 1936)
By contradiction, let us assume H exists
H
<M,w>
“accept”
“reject”
17. 17
HP Proof (step 1)
Let us construct a new TM D using H as a
subroutine:
On input <M>:
1. Run H on input <M, <M> >; //(i.e., run M on M itself)
2. Output the opposite of what H outputs;
H
<M>
“accept”
“reject” “reject”
“accept”
D
<M, “<M>” >
Therefore, if H exists D also should exist.
But can such a D exist? (if not, then H also cannot exist)
18. 18
HP Proof (step 2)
The notion of inputing “<M>” to M itself
A program can be input to itself (e.g., a compiler is a
program that takes any program as input)
accept, if M does not accept <M>
reject, if M accepts <M>
D (<M>) =
accept, if D does not accept <D>
reject, if D accepts <D>
D (<D>) =
Now, what happens if D is input to itself?
A contradiction!!! ==> Neither D nor H can exist.
19. 19
Of Paradoxes & Strange
Loops
A fun book for further reading:
“Godel, Escher, Bach: An Eternal Golden Braid”
by Douglas Hofstadter (Pulitzer winner, 1980)
E.g., Barber’s paradox, Achilles & the Tortoise (Zeno’s paradox)
MC Escher’s paintings
22. 22
A Language about TMs &
acceptance
Let L be the language of all strings
<M,w> s.t.:
1. M is a TM (coded in binary) with input
alphabet also binary
2. w is a binary string
3. M accepts input w.
23. 23
Enumerating all binary strings
Let w be a binary string
Then 1w i, where i is some integer
E.g., If w=, then i=1;
If w=0, then i=2;
If w=1, then i=3; so on…
If 1w i, then call w as the ith word or ith binary
string, denoted by wi.
==> A canonical ordering of all binary
strings:
{, 0, 1, 00, 01, 10, 11, 000, 100, 101, 110, …..}
{w1, w2, w3, w4, …. wi, … }
24. 24
Any TM M can also be binary-
coded
M = { Q, {0,1}, , , q0,B,F }
Map all states, tape symbols and transitions to
integers (==>binary strings)
(qi,Xj) = (qk,Xl,Dm) will be represented as:
==> 0i1 0j1 0k1 0l1 0m
Result: Each TM can be written down as a
long binary string
==> Canonical ordering of TMs:
{M1, M2, M3, M4, …. Mi, … }
25. 25
The Diagonalization Language
Ld = { wi | wi L(Mi) }
The language of all strings whose corresponding
machine does not accept itself (i.e., its own code)
1 2 3 4 …
1 0 1 0 1 …
2 1 1 0 0 …
3 0 1 0 1 …
4 1 0 0 1 …
i
j
…
. .
.
diagonal
• Table: T[i,j] = 1, if Mi accepts wj
= 0, otherwise.
(input word w)
(TMs)
• Make a new language called
Ld = {wi | T[i,i] = 0}
26. 26
Ld is not RE (i.e., has no TM)
Proof (by contradiction):
Let M be the TM for Ld
==> M has to be equal to some Mk s.t.
L(Mk) = Ld
==> Will wk belong to L(Mk) or not?
1. If wk L(Mk) ==> T[k,k]=1 ==> wk Ld
2. If wk L(Mk) ==> T[k,k]=0 ==> wk Ld
A contradiction either way!!
27. 27
Why should there be
languages that do not have
TMs?
We thought TMs can solve
everything!!
29. 29
One Explanation
There are more languages than TMs
By pigeon hole principle:
==> some languages cannot have TMs
But how do we show this?
Need a way to “count & compare” two infinite
sets (languages and TMs)
30. 30
How to count elements in a
set?
Let A be a set:
If A is finite ==> counting is trivial
If A is infinite ==> how do we count?
And, how do we compare two infinite sets by
their size?
31. 31
Cantor’s definition of set “size”
for infinite sets (1873 A.D.)
Let N = {1,2,3,…} (all natural numbers)
Let E = {2,4,6,…} (all even numbers)
Q) Which is bigger?
A) Both sets are of the same size
“Countably infinite”
Proof: Show by one-to-one, onto set correspondence from
N ==> E n
1
2
3
.
.
f(n)
2
4
6
.
.
i.e, for every element in N,
there is a unique element in E,
and vice versa.
32. 32
Example #2
Let Q be the set of all rational numbers
Q = { m/n | for all m,n N }
Claim: Q is also countably infinite; => |Q|=|N|
1/1 1/2 1/3 1/4 1/5
2/1 2/2 2/3 2/4 2/5
3/1 3/2 3/3 3/4 3/5
4/1 4/2 4/3 4/4 4/5
5/1 5/2 ….
….
….
….
….
33. 33
Uncountable sets
Example:
Let R be the set of all real numbers
Claim: R is uncountable
n
1
2
3
4
.
.
.
f(n)
3 . 1 4 1 5 9 …
5 . 5 5 5 5 5 …
0 . 1 2 3 4 5 …
0 . 5 1 4 3 0 … E.g. x = 0 . 2 6 4 4 …
Build x s.t. x cannot possibly
occur in the table
Really, really big sets!
(even bigger than countably infinite sets)
34. 34
Therefore, some languages
cannot have TMs…
The set of all TMs is countably infinite
The set of all Languages is uncountable
==> There should be some languages
without TMs ( by PHP)
35. 41
Summary
Problems vs. languages
Decidability
Recursive
Undecidability
Recursively Enumerable
Not RE
Examples of languages
The diagonalization technique
Reducability