Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Turing Machines: Halting Problem, Linear Bounded Automata, and Context-Sensitive Grammars, Lecture notes of Network Theory

A comprehensive explanation of turing machines, including the halting problem, linear bounded automata (lba), and context-sensitive grammars (csg). It delves into the concept of reduction, demonstrating how the halting problem is undecidable. The document also explores the properties of lba and csg, highlighting their significance in computational theory. It is a valuable resource for students studying theoretical computer science and formal languages.

Typology: Lecture notes

2023/2024

Uploaded on 01/15/2025

akshay-singh-thakur
akshay-singh-thakur 🇮🇳

3 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Halting Problem
Input − A Turing machine and an input string w.
Problem − Does the Turing machine finish computing of the string w in a finite number of
steps? The answer must be either yes or no.
Proof − At first, we will assume that such a Turing machine exists to solve this problem and
then we will show it is contradicting itself. We will call this Turing machine as a Halting
machine that produces a ‘yes’ or ‘no’ in a finite amount of time. If the halting machine finishes
in a finite amount of time, the output comes as ‘yes’, otherwise as ‘no’. The following is the
block diagram of a Halting machine
Now we will design an inverted halting machine (HM)’ as −
If H returns YES, then loop forever.
If H returns NO, then halt.
The following is the block diagram of an ‘Inverted halting machine’ −
Further, a machine (HM)2 which input itself is constructed as follows −
If (HM)2 halts on input, loop forever.
Else, halt.
Here, we have got a contradiction. Hence, the halting problem is undecidable.
pf3
pf4
pf5
pf8

Partial preview of the text

Download Turing Machines: Halting Problem, Linear Bounded Automata, and Context-Sensitive Grammars and more Lecture notes Network Theory in PDF only on Docsity!

Halting Problem

Input − A Turing machine and an input string w. Problem − Does the Turing machine finish computing of the string w in a finite number of steps? The answer must be either yes or no. Proof − At first, we will assume that such a Turing machine exists to solve this problem and then we will show it is contradicting itself. We will call this Turing machine as a Halting machine that produces a ‘yes’ or ‘no’ in a finite amount of time. If the halting machine finishes in a finite amount of time, the output comes as ‘yes’, otherwise as ‘no’. The following is the block diagram of a Halting machine Now we will design an inverted halting machine (HM)’ as −  If H returns YES, then loop forever.  If H returns NO, then halt. The following is the block diagram of an ‘Inverted halting machine’ − Further, a machine (HM) 2 which input itself is constructed as follows −  If (HM) 2 halts on input, loop forever.  Else, halt. Here, we have got a contradiction. Hence, the halting problem is undecidable.

Recursive Enumerable (RE) or Type  RE languages or type-0 languages are generated by type  An RE language can be accepted or recognized by Turing machine which means it will enter into 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 Language (REC)  A recursive language (subset of RE) can be decided by Turing machine which means it will enter into final state for the strings of language and rejecting state for the strings which are not part of the language.  e.g.; L= {a n b n c n |n>=1} is recursive because we can construct a turing machine which will move to final state if the string is of the form a  So the TM will always halt in this case. REC languages are Decidablelanguages. Closure Properties of Recursive Languages  Union: If L1 and If L2 are two recursive languages, their union L1?L 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.L will also be recursive. For Example: L1= {a n b n c n |n>=0} L2= {d m e m f m |m>=0} L3= L1.L = {a n b n c n d m e m f m |m>=0 and n>=0} is also recursive.  Kleene Closure: If L1is recursive, its kleene closure L1* will also be recursive. Example: L1= {a n b n c n |n>=0} L1= { a n b n c n ||n>=0} is also recursive.  Intersection and complement intersection L1? L2 will also be recursive. For Example: L1= {a n b n c n dm|n>=0 and m>=0} L2= {anbncndn|n>=0 and m>=0} L3=L1? L = { anbncndn^ |n>=0} will be recursive. Recursive Enumerable (RE) or Type -0 Language 0 languages are generated by type-0 grammars. An RE language can be accepted or recognized by Turing machine which means it will enter into 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. rever for the strings which are not a part of the language. RE languages are also called as Turing recognizable languages. A recursive language (subset of RE) can be decided by Turing machine which means it ate for the strings of language and rejecting state for the strings which are not part of the language. |n>=1} is recursive because we can construct a turing machine which will move to final state if the string is of the form a n b n c n else move to non So the TM will always halt in this case. REC languages are also called as Turing Closure Properties of Recursive Languages : If L1 and If L2 are two recursive languages, their union L1?L recursive because if TM halts for L1 and halts for L2, it will also halt for L1?L2. If L1 and If L2 are two recursive languages, their concatenation L1.L For Example: |m>=0 and n>=0} is also recursive. If L1is recursive, its kleene closure L1* will also be recursive. ||n>=0}* is also recursive. rsection and complement: If L1 and If L2 are two recursive languages, their intersection L1? L2 will also be recursive. For Example: dm|n>=0 and m>=0} |n>=0} will be recursive. 0 grammars. An RE language can be accepted or recognized by Turing machine which means it will enter into final state for the strings of language and may or may not enter into rejecting rever for the strings which are not a part of the language. RE A recursive language (subset of RE) can be decided by Turing machine which means it ate for the strings of language and rejecting state for the strings |n>=1} is recursive because we can construct a turing machine which ove to non-final state. also called as Turing : 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. If L1 and If L2 are two recursive languages, their concatenation L1.L If L1is recursive, its kleene closure L1* will also be recursive. For : If L1 and If L2 are two recursive languages, their

Introduction to Linear Bounded Automata : A Linear Bounded Automaton (LBA) is similar to stated below:  Turing Machine with Non-deterministic logic  Turing Machine with Multi-track, and  Turing Machine with a bounded finite length of the tape. Tuples Used in LBA : LBA can be defined with eight tuples (elements that help to design automata) as: M = (Q , T , E , q0 , ML , MR , S , F), where, Q - > A finite set of transition states T -> Tape alphabet E -> Input alphabet q0 -> Initial state ML -> Left bound of tape MR -> Right bound of tape S -> Transition Function F -> A finite set of final states Diagrammatic Representation of LBA : Examples: Languages that form LBA with tape as shown above,  L = {a n! | n >= 0} Introduction to Linear Bounded Automata : A Linear Bounded Automaton (LBA) is similar to Turing Machine with some properties deterministic logic, track, and a bounded finite length of the tape. LBA can be defined with eight tuples (elements that help to design automata) as: , S , F),

A finite set of transition states Diagrammatic Representation of LBA : that form LBA with tape as shown with some properties LBA can be defined with eight tuples (elements that help to design automata) as:

Context-Sensitive Grammar – A Context-sensitive grammar is an Unrestricted grammar in which all the productions are of form – Where α and β are strings of non-terminals and terminals. Context-sensitive grammars are more powerful than context-free grammars because there are some languages that can be described by CSG but not by context-free grammars and CSL are less powerful than unrestricted grammar. That’s why context-sensitive grammars are positioned between context-free and unrestricted grammars in the Chomsky hierarchy. Context-sensitive grammar has 4-tuples. G = {N, Σ, P, S}, Where N = Set of non-terminal symbols Σ = Set of terminal symbols S = Start symbol of the production P = Finite set of productions All rules in P are of the form α 1 A α 2 –> α 1 β α 2

Q. what is Turing machine? A Turing machine consists of an infinite tape (as the memory), a tape head (a pointer to the currently inspected cell of memory), and a state transition table (to govern the behavior of the machine). Each cell of the tape can have one of a predetermined finite set of symbols, one of which is the blank symbol. A Turing machine, like an algorithm, executes on an input string of bits. At the beginning, the input string is written on the tape, the tape head points to the first cell of the string, and all other cells are blank. The Turing machine is the most powerful computation model when compared with FA and PDA. Formally, a Turing machine M can be defined as follows − M = (Q, X, ∑, δ, q0, B, F)  Q represents the finite, non-empty set of states.  X 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 X → Q x 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.