Lecture Notes On THEORY OF COMPUTATION MODULE - 2 UNIT - 2

Similar documents
4.2 First-Order Logic

1. Tractable and Intractable Computational Problems So far in the course we have seen many problems that have polynomial-time solutions; that is, on

Classify by number of ports and examine the possible structures that result. Using only one-port elements, no more than two elements can be assembled.

Krauskopf, B., Lee, CM., & Osinga, HM. (2008). Codimension-one tangency bifurcations of global Poincaré maps of four-dimensional vector fields.

Elements of Coordinate System Transformations

STEP Support Programme. STEP III Hyperbolic Functions: Solutions

Pulses on a Struck String

Move Blocking Strategies in Receding Horizon Control

Universal Scheme for Optimal Search and Stop

Typed Kleene Algebra with Products and Iteration Theories

FRTN10 Exercise 12. Synthesis by Convex Optimization

Section 7.4: Integration of Rational Functions by Partial Fractions

Undecidability in Binary Tag Systems and the Post Correspondence Problem for Five Pairs of Words

Department of Industrial Engineering Statistical Quality Control presented by Dr. Eng. Abed Schokry

Lecture Notes: Finite Element Analysis, J.E. Akin, Rice University

Nonlinear parametric optimization using cylindrical algebraic decomposition

Sources of Non Stationarity in the Semivariogram

The Linear Quadratic Regulator

Optimal Control of a Heterogeneous Two Server System with Consideration for Power and Performance

Worst-case analysis of the LPT algorithm for single processor scheduling with time restrictions

Convergence analysis of ant colony learning

Essentials of optimal control theory in ECON 4140

Imprecise Continuous-Time Markov Chains

Linear System Theory (Fall 2011): Homework 1. Solutions

Introduction to Turing Machines. Reading: Chapters 8 & 9

Graphs and Their. Applications (6) K.M. Koh* F.M. Dong and E.G. Tay. 17 The Number of Spanning Trees

BLOOM S TAXONOMY. Following Bloom s Taxonomy to Assess Students

Concepts Introduced. Digital Electronics. Logic Blocks. Truth Tables

Joint Transfer of Energy and Information in a Two-hop Relay Channel

Newton s Laws. Why Things Move. Overview. Part

Robust Tracking and Regulation Control of Uncertain Piecewise Linear Hybrid Systems

Assignment Fall 2014

On the tree cover number of a graph

FOUNTAIN codes [3], [4] provide an efficient solution

Modelling by Differential Equations from Properties of Phenomenon to its Investigation

1 Undiscounted Problem (Deterministic)

A Theory of Markovian Time Inconsistent Stochastic Control in Discrete Time

A Single Species in One Spatial Dimension

Chapter 2 Difficulties associated with corners

Introduction to Quantum Information Processing

Discussion Papers Department of Economics University of Copenhagen

Subcritical bifurcation to innitely many rotating waves. Arnd Scheel. Freie Universitat Berlin. Arnimallee Berlin, Germany

Cubic graphs have bounded slope parameter

Discontinuous Fluctuation Distribution for Time-Dependent Problems

Gradient Projection Anti-windup Scheme on Constrained Planar LTI Systems. Justin Teo and Jonathan P. How

Sign-reductions, p-adic valuations, binomial coefficients modulo p k and triangular symmetries

On the circuit complexity of the standard and the Karatsuba methods of multiplying integers

Setting The K Value And Polarization Mode Of The Delta Undulator

(Diskursrepräsentationstheorie)

Sensitivity Analysis in Bayesian Networks: From Single to Multiple Parameters

Second-Order Wave Equation

Bayes and Naïve Bayes Classifiers CS434

On relative errors of floating-point operations: optimal bounds and applications

Optimal Control, Statistics and Path Planning

Introdction Finite elds play an increasingly important role in modern digital commnication systems. Typical areas of applications are cryptographic sc

Discussion of The Forward Search: Theory and Data Analysis by Anthony C. Atkinson, Marco Riani, and Andrea Ceroli

arxiv: v2 [math.co] 28 May 2014

Formules relatives aux probabilités qui dépendent de très grands nombers

1. State-Space Linear Systems 2. Block Diagrams 3. Exercises

Study on the Mathematic Model of Product Modular System Orienting the Modular Design

The Cryptanalysis of a New Public-Key Cryptosystem based on Modular Knapsacks

Decision Making in Complex Environments. Lecture 2 Ratings and Introduction to Analytic Network Process

B-469 Simplified Copositive and Lagrangian Relaxations for Linearly Constrained Quadratic Optimization Problems in Continuous and Binary Variables

QUANTILE ESTIMATION IN SUCCESSIVE SAMPLING

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

Network Coding for Multiple Unicasts: An Approach based on Linear Optimization

Research Article Permanence of a Discrete Predator-Prey Systems with Beddington-DeAngelis Functional Response and Feedback Controls

CHANNEL SELECTION WITH RAYLEIGH FADING: A MULTI-ARMED BANDIT FRAMEWORK. Wassim Jouini and Christophe Moy

We automate the bivariate change-of-variables technique for bivariate continuous random variables with

Constructive Root Bound for k-ary Rational Input Numbers

Chapter 3. Preferences and Utility

System identification of buildings equipped with closed-loop control devices

Lecture 8: September 26

CRITERIA FOR TOEPLITZ OPERATORS ON THE SPHERE. Jingbo Xia

Multi-Voltage Floorplan Design with Optimal Voltage Assignment

Complex Variables. For ECON 397 Macroeconometrics Steve Cunningham

4 Exact laminar boundary layer solutions

Model Discrimination of Polynomial Systems via Stochastic Inputs

UNIT 1 TURING MACHINE

Simulation investigation of the Z-source NPC inverter

Effects of Soil Spatial Variability on Bearing Capacity of Shallow Foundations

Step-Size Bounds Analysis of the Generalized Multidelay Adaptive Filter

A Characterization of Interventional Distributions in Semi-Markovian Causal Models

Decoder Error Probability of MRD Codes

A Model-Free Adaptive Control of Pulsed GTAW

Konyalioglu, Serpil. Konyalioglu, A.Cihan. Ipek, A.Sabri. Isik, Ahmet

3.1 The Basic Two-Level Model - The Formulas

Prediction of Transmission Distortion for Wireless Video Communication: Analysis

A State Space Based Implicit Integration Algorithm. for Differential Algebraic Equations of Multibody. Dynamics

On oriented arc-coloring of subcubic graphs

Collective Inference on Markov Models for Modeling Bird Migration

Information Source Detection in the SIR Model: A Sample Path Based Approach

Ted Pedersen. Southern Methodist University. large sample assumptions implicit in traditional goodness

Study on the impulsive pressure of tank oscillating by force towards multiple degrees of freedom

Technical Note. ODiSI-B Sensor Strain Gage Factor Uncertainty

denition of distributed computations with synchronous than originally stated. Key words: Distributed computation { Message passing Communication

AN ALTERNATIVE DECOUPLED SINGLE-INPUT FUZZY SLIDING MODE CONTROL WITH APPLICATIONS

Theory of Computation - Module 4

AN ALTERNATIVE DECOUPLED SINGLE-INPUT FUZZY SLIDING MODE CONTROL WITH APPLICATIONS

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

Transcription:

BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lectre Notes On THEORY OF COMPUTATION MODULE - 2 UNIT - 2 Prepared by, Dr. Sbhend Kmar Rath, BPUT, Odisha.

Tring Machine- Miscellany UNIT 2 TURING MACHINE MISCELLANY Strctre Page Nos. 2.0 Introdction 55 2.1 Objectives 56 2.2 Extensions-cm-Eqivalents of Tring Machine 56 2.3 Universal Tring Machine (UTM) 68 2.4 Langages Accepted/Decided by TM 72 2.5 The Diagonal Langage and the Universal Langage 78 2.6 Chomsky Hierarchy 84 2.7 Smmary 88 2.8 Soltions Answers 88 2.9 Frther Readings 91 2.0 INTRODUCTION For the time being, let s concentrate on the nitty-gritty of other, possibly easier, ways of designing TMs and other related isses, and leave the isse of self reference for some later nits. The essence of the discipline of Theory of Comptation is to characterize the phenomenon of comptation in terms of formal/mathematical concepts like set, relation, fnction, etc. For this prpose, the discipline incorporates stdy of a nmber of approaches to, and models and principles of, comptation. Three approaches to comptation inclded in the crriclm are: Atomata (ii) grammatical and (iii) recrsive fnction. Varios approaches to comptation are eqivalent in the sense that to each model of comptation obtained throgh one approach, there is a (comptationally) eqivalent model of comptation throgh another approach. We initiated or stdies with Finite Atomata and Reglar Grammars and established eqivalence of these models. However, these models are fond inadeqate to captre the notion of comptation, in the sense that even a simple langage like {x n y n : n N} cannot be captred/compted by either of these models. Then, we stdied more powerfl models viz. Pshdown Atomata and Context-Free Grammars and established eqivalence between the models. Again, these models are fond inadeqate..... Tortoise: Oh, how clever, I wonder why I never thoght of that myself. Now tell me: is the following sentence selfreferential? Is Composed of Five words. is Composed of Five Words. Achilles: Hmm I can t qite tell. The sentence which yo jst gave is not really abot itself, bt rather abot the phrase is composed of five words. Thogh, of corse, that phrase is part of the sentence Tortoise: So the sentence refers to some part of itself so what? Achilles: Well, woldn t that qalify as self-reference, too? Tortoise: In my opinion, that is still a far cry from tre selfreference. Bt don t worry too mch abot these tricky matters. Yo ll have ample time to think abot them in the ftre..... Hofstadter ** In the previos nit, we introdced still more powerfl,model of comptation viz Tring Machine (TM) and mentioned the important fact that that TM model is conjectred to be the ltimate (formal) model of comptation. In this nit, we discss a nmber of important isses abot TM. First of all, we mention a nmber of extensions of the standard TM introdced in the previos nit. These extensions, thogh apparently are expected to provide more powerfl models, yet give only models, each one of which is eqivalent to standard TM. The fact of eqivalence of varios extensions of TM spport the conjectre mentioned above. The proofs of eqivalences are beyond the scope of the corse. Next, we discss Universal Tring Machine (UTM), an eqivalent of generalprpose compter. The significance of the stdy of UTM lies in the facts: ** Godel, Escher, Bach: An Eternal Golden Braid By Doglas R. Hofstadter, Pengin Books (1979) 55

Tring Machine and Recrsive Fnctions (ii) A single General Prpose Compter can be sed to solve any problem, if at all the problem is solvable by some comptational method. In order to solve a problem by TM model, nlike general prpose compter, we are reqired to constrct a new TM for each new problem. Ths, a single UTM can be sed to solve by TM models any solvable problem. Next, we introdce langages associated with TM and discss briefly properties of these langages. Thogh, some of the books that have appeared in the recent past in the discipline, do not talk of Chomsky* Hierarchy of langages; we, for the sake of exhibiting complete parallel between the atomata and grammar approaches, jst mention Chomsky Hierarchy and define grammar models of varios types of langages discssed nder Chomsky Hierarchy and mention eqivalences of these langages to appropriate atomata 2.1 OBJECTIVES After going throgh this nit, yo will be able: to discss varios extensions of standard Tring Machine; to tell that each of these extensions of TM, is jst comptationally eqivalent and, is not properly more powerfl than standard TM; to describe the strctre of Universal Tring Machine (UTM); to explain how UTM can be sed as a general prpose compter; to state and prove some of the properties of Tring Acceptable and Tring Decidable langages; and to define phrase-strctre grammar and to tell that phrase-strctre grammar model is eqivalent to TM model. 2.2 EXTENSIONS-CUM-EQUIVALENTS OF TURING MACHINE The Tring Machine, as defined in the previos nit, will be referred to as standard Tring Machine. In the standard Tring Machine, the tape is semi-infinite and is bonded on the left-end, however, the tape is nbonded on the right side. In this section we consider some extensions of the standard TM. The extensions of Tring Machine considered are: (ii) The tape may be allowed to be infinite in both the directions There may be more than one Head scanning varios cells of the tape. Two or more Heads may simltaneosly read the same cell or may attempt to write in the same cell. (iii) There may be several Tapes instead of one only, each Tape having its own independent Head. (iv) The Tape may be k-dimensional, k 2, instead of only one-dimensional. (v) For a given pair of crrent state and symbol nder the Head, in stead of at most one possible move, there may be any finite, possibly zero, nmber, of next moves (This model is called Non-Deterministic Tring Machine.). Remark 2.2.1 56

Tring Machine- Miscellany In all the above-mentioned extensions, it is invariably assmed that only finitely many cells contain non-blank symbols. All other cells are blanks. Remark 2.2.2 Each of the above-mentioned extensions, being a generalization of the standard Tring Machine, may appear to yield a strictly more powerfl model of comptation throgh atomata approach, yet it has been proved that each of these models is jst eqivalent to and not strictly more powerfl than the standard TM model of comptation. It has been already mentioned in one of the previos nits that it is conjectred that (standard) TM is ltimate model of comptation. Remark 2.2.3 Like the standard TM, each of the extensions of TM enmerated above, is formally defined as, or some variation of, a sextple of the form (Q, Σ,, δ, q 0, h), where Q, Σ,, q 0 and h stand, as in standard TM, for respectively set of states, set of inpt symbols, set of Tape symbols, initial state and halt state. However, the extensions are distingished from each other and from the standard TM throgh different definitions of next-move relation δ and of configrations for each of the extension. Therefore, in the following, most of the time, we discss the extensions only in terms of definitions of δ and of configration. 2.2.1 Extension : Two-way (infinite tape) Tring Machine Like standard TM, in this case also, the next-move is given by δ as a partial fnction from Q to Q {L, R, N} The following three points need to be noted in respect of configrations of Two-way Tring Machine: Configration/Instantaneos Description: In standard TM, if there are a nmber of left-most positions which contain blanks, then those are inclded in the configration, e.g., if the one-way configration Tape is of the form # # a b # c d e f # #..# q 2 then the configration in the standard TM is written as: (q 2, # # a b # c d e f), where we neglect all the continos seqences of right-hand blanks. However, in the Two-way infinite Tape TM, both left-hand and right-hand parts of the tape are symmetrical in the sense that there is an infinite continos seqence of blanks on each of the right-hand and left-hand of the seqence of non-blanks. Therefore, in the case of two-way infinite Tape, if the above string is on the tape then it will be in the form...# #... #... ## a b # c d q 2 e f #... #... and then, the configration for Two-way infinite tape TM will be slightly different as given below: 57

Tring Machine and Recrsive Fnctions (q 2, a b # c d e f), Note the # s to the left of a are missing here. (ii) No Hanging (or No ceasing of operations withot Halting) In this case, as there is no left end of the tape, therefore, there is no possibility of jmping off the left-end of the Tape. Ths, if the machine has the configration (q, a d...) and δ (q, a) = (p, b, L), then new configration is (p, # b d...) instead of the hanging configration. (iii) The empty Tape configration: When at some point of time all the cells of the Tape are # s and the state is say q, then the configration in Two-way Tape may be denoted as: (q, #) where only the crrent cell containing # is shown in the configration. Rest of the notations and definitions given in context of standard TM will be sed for two-way Tring Machine, inclding the definition of the next-move (partial) fnction δ. Despite the fact that, it is possible in the new model of compter to move left as far as reqired; as mentioned earlier, the model does not provide any additional comptational capability. 2.2.2 Extension (ii): Tring Machine having R heads, k 2, with only onetape In order to simplify the discssion, we assme that there are only two Heads on the Tape. The Tape is assmed to be one-way infinite. We explain the involved concepts with the help of an example. Let the contents of the Tape and the position of the two Heads, viz H 1 and H 2, be as given below: ## a b c # d e H 2 H 1 Frther, let the state of the TM be q. f # #... (*) Then one method of defining the configration of two-head one-way Tring machine is (the state, the Tape description as if H 1 is the only Head of TM, the Tape description as if H 2 is the only Head of TM). Therefore, the configration in the case of (*) given above will be (q, # # a b c # d e f, # # a b c # d e f) The Move fnction of the Two-Head One-way Tring Machine may be defined as δ (state, symbol nder Head 1, Symbol nder Head 2) = (New State, (S 1, M 1 ), (S 2, M 2 )) Where S i is the symbol to be written in the cell nder H i, the ith Head and M i denotes the movement of H i, where the movement may be L, R or N and frther L denotes movement to the left, R denotes movement to the right of the crrent cell and N denotes no movement of the Head. 58

Tring Machine- Miscellany Two Special cases of the δ fnction defined above, need to be considered: (ii) What shold be written in the crrent cell when both Heads are scanning the same cell at a particlar time and the next moves (S 1, M 1 ), (S 2, M 2 ) for the two Heads, are sch that S 1 S 2 (i.e. symbol to be written in crrent cell by H 1 symbol to be written in crrent cell by H 2 )? In sch a sitation, a general rle may be defined, say, as whatever is to be done by H 1 will take precedence over whatever is to be done by H 2. The Hanging configration: For two-head One-way Tape, a configration shall be called Hanging if δ (q, symbol nder H 1, symbol nder H 2 ) = (p, (S 1, M 1 ), (S 2, M 2 )) is sch that either (a) (b) Symbol nder H 1 is in the left-most cell and M 1 is L, i.e., movement of H 1 is to be to the left, OR Symbol nder H 2 is in the left-most cell and M 2 is L, i.e., movement of H 2 is to be to the left. Other concepts and isses in respect of Two-Head One-way Tape may be handled on the similar lines. The above discssion can be frther be extended easily to the case when nmber of Heads is more than two. Again, as mentioned earlier, the power of the TM is not enhanced by the se of extra Heads. 2.2.3 Extension (iii) Mlti-Tape Tring Machine: In stead of one Tape, we may have more than one tapes, each tape having its own independent Head. To begin with, we may take each of the tape as one-way infinite tape, bonded on the left. Again to facilitate the discssion, we initially consider the case of only two tapes: Configration/Instantaneos Description: We explain the concept of configration for Tring Machine with two Tapes with an example. Let the contents of the tapes and positions of the Heads be as follows: Tape 1: # # a b c d e # # Tape 2: e f # g d f # # #. and the state of the Tring Machine be q. Then the configration may be denoted by (q, (# # a b c d e), (e f # g d f)) ) (inner pairs of parentheses are sed only to enhance readability, not reqired otherwise) The next Move fnction δ may be defined as δ ((q, T 1, T 2 )) = (p, (S 1, M 1 ), (S 2, M 2 ) 59

Tring Machine and Recrsive Fnctions where q denotes the crrent state, T i denotes the symbol of the ith tape crrently being scanned by its Head. The symbol p denotes the next state; S i denotes the symbol to be written in the crrent cell of the ith Tape in place of T i. M i {L, R, N} denotes the movement of the Head on ith Tape. Hanging Configration in the case of Two-Tape, each Tape being one-way infinite The TM will be said to be in Hanging Configration if there is a next move given by δ (q, T 1, T 2 ) = (p, (S 1, M 1 ), (S 2, M 2 )), where p, q, T i, S i, M i, are the notations explained above, with either (ii) T 1 being in the left-most cell of Tape l and M 1 being Movement to Left, or T 2 being is in the left-most cell of Tape 2 and M 2 being Movement to Left. The discssion can be frther extended on the similar lines to k Tape Tring Machine, where k>2. The concept of k-tape, k 2, with each Tape being semi-infinite, can be frther extended when the tapes are allowed to be Two-way infinite. The notions for configration and Move fnction for sch machines can be easily defined. A very important application of the 3-tape Tring Machine model, which we are going to discss in Section 2.3, is in the design of niversal Tring Machine, a sort of a general-prpose compter. The design of k-tape Tring Machines for some of the fnctions like copying, reversing, for verifying whether a string is a palindrome or not etc, can be mch more easily carried ot as compared to the design of the corresponding standard Tring Machines. Example: 2.2.3.1 Constrct a 2-Tape Tring Machine, which retrns # ω ω # for given inpt # ω #. Soltion: Let the inpt be placed on Tape 1 and Tape 2 may contain all blanks, with the Head of Tape 2 being on the left-most # so that the initial configration is as follows: Tape 1: # w 1. w k # # q 0 Tape 2: #... q 0 Step1: Move the Head of Tape 1 containing the inpt towards the left most cell throgh the following moves. δ (q o, #, #) = (q 1, (#,L), (#, N)) δ (q 1, #, #) = (q 1, ( #,L), (#, N)) δ (q 1, #, #) = (q 2, (#,R), (#, R)) where # denotes the same non-blank symbol throghot an eqation. 60

Tring Machine- Miscellany After these moves, the configration is as follows: Tape 1: Tape 2: # w 1 w 2 ------------- w k # ---------------------- q 2 # # # -------- # q 2 where w i # for i=1,2,-------, k Step 2: Next, we copy the contents of Tape 1 to Tape 2 throgh δ (q 2, #, #) = (q 2, ( #, R), ( #, R)), where # denotes the same non-blank symbol throghot an eqation. In other words throgh these k moves, non-blank contents of Tape 1 are copied in the corresponding cells of tape 2. After k times exections of the above move, the configration becomes Tape 1: Tape 2: # w 1 w 2 ------------- w k # q 2 # w 1 w 2 ------------- w k # q 2 Step 3: At this stage we intend to move the Head of Tape 2 to the left-most # withot moving the Head of Tape 1 we introdce the moves: δ (q 2, #, #) = δ (q 3, (#, N), (#, L)) and δ (q 3, #, # ) = (q 3, (#, N) ( #, L)) At the end of k moves the configration becomes Tape 1: # w 1 w 2 w k # q 3 Tape 2: # w 1 w k # q 3 At this stage, when Head of Tape 2 is also scanning a #, we may enter a new state q 4, in which Head of Tape 1 does not move bt Head of Tape 2 moves right so that δ (q 3, #, #) = (q 4, (#, N), (#, R)). (*) In state q 4, each non-# symbol of Tape 2 is copied in the crrent cell of Tape 1, and then content of the crrent cell of Tape 2 is converted to # and both Heads move to the Right i.e, δ(q 4, #, # ) = (q 4, ( #, R), (#, R)) Step 4: Finally the configration with state q 4 is 61

Tring Machine and Recrsive Fnctions Tape 1 # w 1..w k w 1..w k # q 4 Tape 2 # # q 4 δ (q 4, #, #) = (Halt, #, #) At this stage Tape 1 contains the reqired otpt. Ex.1) Constrct Two-Tape Tring Machines for each of the following: Convert the inpt # w # into # w # w # (ii) Convert the inpt # w # into # w w R # (iii) Convert the inpt # w # into # w # w R # where if w = w 1 w 2 ------w k-1 w k then w R = w k w k-1 --------w 2 w 1 Remark 2.2.3.2: Again, it has been proved that the power of the standard Trning Machine is the same as that of a Tring Machine with any finite nmber of Tapes. Remark 2.2.3.3: The k-tape version of a Tring Machine, with each tape being only one-way can be frther extended to a k Tape Tring Machine with each Tape being Two way infinite. It may again be noted that even with this extension the compting power is the same as is achievable with standard TM. Next, let s consider 2.2.4 Extension (iv): k-dimensional Tring Machine: Again to facilitate the nderstanding of the basic ideas involved, let s discss initially only Two Dimensional Tring Machine. Then these ideas can be easily generalized to k dimensional case, where k >2. In the case of two-dimensional tape as shown below, we assme that the tape is bonded on the left and the bottom. 4 3 2 1 62

Tring Machine- Miscellany 0 0 1 2 3 Each cell is given an address say (i 1, i 2 ) where i 1 is the row-nmber of the cell and i 2 is the colmn nmber of the cell. For example, the shaded cell in the above diagram has address (2,3). Introdctory Remarks in context of the Instantaneos Description (ID) or configration: A configration of a two-dimensional TM at a particlar time may be described in terms of finitely many of the triplets of the form, (i 1, i 2, c) where for each sch triplet, (i 1, i 2 ) is the address of a cell and c denotes the contents of the cell. Only these cells are inclded in an ID, for which c, the contents, are non-blank symbols. In the configration or ID, order of the cells which are inclded in an ID, Row- Major Ordering is to be followed, i.e., first all the elements in the row with least index are inclded in the ID, followed by the elements of the row with next least index and so on. Within cells of each row, the cell with non-# contents and having least colmn nmber is inclded first followed by the non-# cell with next least colmn nmber and so on. For example, if we have the following triplets in the ID (2,5, c), (0,2,d), (4,3, f), (3,5,g), (0,3,h), then the order of the triplets in the ID will be (0,2,d), (0,3,h), (2,5,c), (3,5,g), (4,3,f) After these introdctory remarks, we define configration and the move fnction δ etc. Configration: Let q Q, c k Γ~ {#}. i.e. c k is a non-blank Tape symbol. Then a configration at a particlar instant is denoted by (q, (H 1, H 2 ) (i 1, i 2, c i1, i2 ), (j 1,j 2,c j1, j2 ),.., (k 1, k 2, c k1, k2 ).) ), where each of c i1,i2, c j1, j2,.. is non-blank and these are the only non-blanks on the tape. Also, (H1,H2) denotes the location of the cell crrently being scanned, i.e. the cell nder the Head. Frther, (i 1, i 2 ) precedes (j 1,j 2 ) and (j 1,j 2 ) precedes (k 1, k 2 ) in the row- major ordering, if i 1 j 1 k 1. and if i 1 = j 1, then i 2 < j 2 or if j 1 = k 1, then j 2 < k 2 etc. Example 2.2.4.1: Sppose at a particlar instant the contents of a Two-Dimensional Tape are as given below and the state at that instant is q 3 and the cell being scanned is (3,2). 5 f 4 b 63

Tring Machine and Recrsive Fnctions 3 2 d 1 a h 0 0 1 2 3 4 Then the configration / ID is given by (q 3, (3,2), ( 1,1,a), (1,4, h), (2,3,d), (4,3,b), (5,4,f)) The Next-Move fnction δ: maps an element of Q x Γ to Qx Γ x { L, R, U, D, N}, where L, R, U and D denote respectively Move Left, Move Right, Move Up and Move Down, and N denotes No Move. For example, δ (q 2, c) = (q 3,d, R) means the contents viz c of the cell (i 1, i 2 ) crrently being scanned, are replaced by d and the Head moves to the cell with address (i 1, i 2 +1) if the address of the scanned cell was (i 1 i 2 ). The following cases need special attention: The cases are discssed only in respect of inclsion or exclsion of triplets and not abot movement of the Head. Let δ (q 2, c) = (d, n). Case if c = # then (i 1, i 2, #) does not occr among the triplets of the configration before the move. However if d # then (i 1, i 2, d) will be added to the set of triplets in the configration. Case (ii) if c # bt d= # then (i1, i 2, c) occrs as a triplet in the configration before the move, bt this triplet is dropped from the new configration arising ot of δ (q 2 c) = (d, n). Case (iii) When c=d = # In this case, there is no change in the set of triplets in the configration δ (q 2 c) = (d, n). Case (iv) When c #,and d #, then the triplets (ί 1,ί 2, d) replaces the triplet (ί 1,ί 2, c) in the set of all triplets in the previos configration to get the new configration δ (q 2 c) = (d, n). Again, it has been proved that the compting power of the above-mentioned model of TM remains the same as that of the standard TM. Next, we come to the most important extension of the TM, viz 2.2.5 Extension v: Non-Deterministic Tring Machine. (NDTM) An NDTM is like the standard TM with the difference as described below. In Standard TM, to each pair of the crrent state (except the halt state) and the symbol being scanned, there is a niqe triplet comprising of the next state, niqe action in terms of writing a symbol in the cell being scanned and the motion, if any, to the right or left. However, in the case NDTM, to each pair (q, s) with q as crrent state and s as symbol being scanned, there may be a finite set of the triplets { (q i, s i, m i ) : I =1,2,.} of possible next moves. This set of triplets may be empty, i.e. for some particlar (q,s) the TM may not have any next move. Or alternatively the set {(q i, s i, m i )} may have more than one triplet, meaning thereby that the NDTM in the state q 64

and scanning symbols s, has the alternatives for next move to choose from the set {(q i, s i, m i )} of next moves. Tring Machine- Miscellany It can be easily seen that standard TM is a special case of the NDTM in which for each (q,s) the set {(q i, s i, }of next moves is a singleton set or empty. In order to define formally the concept of Non-Deterministic TM (NDTM), and a configration in NDTM etc, we assme that the tape is one-way infinite. For the extensions of the standard TM, discssed so far, we did not state the fll formal definition of each of the extension. We only discssed the definition only relative to the standard TM. Mainly we discssed configrations and partial move fnction δ for each of the extensions. However, in view of the significant thogh small, difference in the behavior of an NDTMs, we provide below fll formal definition of NDTM. Remark 2.2.5.1: An important point abot the definition of NDTM needs to the highlighted. By the definition of δ which maps an element of (q, x) of Q x to a set {(q i, x i, M i ) } means that each element (q, x) of Q x Γ has the potential of leading to more than one configrations. In other words, there are varios possible rotes to a final configration from one configration. However, dring one comptation only one of these possible vales (qi, x i, M i ) will be associated with (q, x) throgh δ. Bt we can not tell in advance which one ot of the ordered triples from the set {(q i, x i, M i )} This is why the adjective Non-Deterministic is sed for this version of the T.M. Remark 2.2.5.2: The set {(q i, x i, M i )} associated with (q, x) nder δ, may be empty. This means there is no possible next move for (q, x), a sitation that occrred even in the case of standard TM and other versions discssed so far. This is why δ was called a partial fnction from Q x to Q x x{l,r,n). Remark 2.2.5.3: In the standard TM and the versions discssed before NDTM, we allowed δ as a partial fnction to Q x x {L, R, N}. In other words, if a vale nder δ exists for (q, x) then the vale has to be niqe, i.e, can be determined. Therefore, the earlier versions are prefixed with the adjective Deterministic. The Non- Deterministic form of each of the earlier versions can be obtained by making sitable modifications in the corresponding definitions of δ etc on the lines of modifications sggested in the definition of NDTM from standard TM. Remark 2.2.5.4: Proper non-determinism means that at some stage, there are at least two next possible moves. Now, if we are engage two different persons or machines to work ot frther possible moves according to each of these two moves, the two can work independent of each other. This means Non-Determination allows parallel comptations. This characteristic of Non-Determinism, also allows is frther comptations even if some of the seqences of moves may be locked as there may not be any next moves at some stages. Definition: An Non-Deterministic Tring Machine is a sextple (Q, Σ, Γ, δ, qo, h) where Q: Set of States 65

Tring Machine and Recrsive Fnctions Σ: Set of inpt symbols Γ : Set of tape symbols q o : The initial state h: The halt state and δ: Q x Γ Power set of (Q x Γ x {L, R, N}) The concept of a configration is same as in the case of standard TM. Bt the concept of yields in one step denoted by, has different meaning. Here one m configration may yield more than one configrations. We explain these ideas throgh a sitable example, which also demonstrates the advantage of the Non- Deterministic Tring Machine over the standard Tring Machine. The advantage is in respect of the relative ease of constrction of NDTM. Remarks 2.2.5.5 Before coming to the example, showing advantage of an NDTM in solving some problems; we need to nderstand properly the concept of acceptance of a langage by an NDTM. First of all, let s recall below what is meant by acceptance of a langage L by a standard TM M. A langage L is accepted by a TM M if each string α L, is acceptable by M. Frther a string α is acceptable M, if staring in the initial state q 0 of M, with α as inpt on the tape of M, if we are able to reach halt state in a finite nmber of moves, i.e, if α= a 1 a 2 a k L for a ii Σ, the set of inpt symbols of M, then (q 0, a 1 a 2 a k ) * ( h, β ) Where β is a string of tape symbol and tape head may be on any cell of the tape. A characteristic featre of the standard TM, in this case, is that if there is to be a seqence of moves from (q 0, α)to a final state, than that seqence might the niqe. However in the case of Non-Deterministic machines, the halt state may be reached throgh any one of varios permissible seqences of moves. Therefore in this version a string α over the set of inpt symbols of an NDTM is acceptable by an NDTM M, if by at least one bt by any one of the seqences of moves halt state is reached from (q 0, α). Now we discss the example showing advantage of NDTM over standard TM. Example 2.2.5.6: Constrct an NDTM which accepts the langage { a n b m : n 1, m 1}, i.e., the langage of all strings over {a,b}, in which there is at least one a and one b and all a s precede all b s. Soltion: The diagrammatic representation of the reqired NDTM is as given below: In the proposed NDTM, as the motion of the head is always to the Right except in the Halt state. Therefore, R is not mentioned in the labels in the diagram below: a/a a/a > qo q 1 b/b 66 h

Tring Machine- Miscellany b/b where the label i/j on an arc denotes that if symbol in the crrent cell is i then contents of the cell are to be replaced by j. Formally the proposed NDTM may be defined as M={ {q 0, q 1, h}, {a, b}, { a, b, #}, δ, q o, h } Where δ is defined as follows: δ (q 0, a)= {( q 0, a, R), (q 1, a, R)} δ (q 0, b)= empty δ (q 1, a)= empty δ (q 1, b)= {(q 1, b, R), (h, b, N)} If the machine has no next move, then it halts withot accepting the string. Remarks 2.2.5.7: Thogh we have already mentioned earlier on a nmber occasions, yet, in view of the significance of non-determinism in designing TMs comparatively more easily, we again bring to notice that in the state q 0 on scanning symbol a, the TM may move in any one of the two next possible states viz to q 0 after moving the head to the right or to q 1 (after moving the head to the right). And, if the TM is implemented as a parallel compter then the compter can prsme independently both branches initiated by (q 0,a,R) and (q 1,a,R) Next, we consider another important variation: Final state Tring Machine Instead of the halt state, TM may have a set F of states designated as final states. 2.2.6 Final State Version of the Standard TM On the lines of the definitions of finite Atomata and Pshdown Atomata, we can define (standard) TM also in terms of F, a set of final states, instead of h, the halt state. The only major differences between the TM with F and the TM with h are: (ii) The TM, while being in a final state, can still have frther moves. Bt in Haltstate version the TM can not move after reaching the Halt state. In the case of Final state version a TM stops frther operations only when there is no next move at a time when the machine is scanning a symbol in some state. If there is no move and the state of TM is a final state, then the string on the tape is accepted. However, if there is no move and the state of TM is not in F, then TM halts withot accepting the string on the Tape. If when the TM is in a final state then the string formed by the contents of the whole tape (exclding the continos infinite seqences(s) of # s), is acceptable, irrespective of the position of the Head on the tape. The sitation is similar to what we have in case of Halt state version of TM It can be shown that Final State version of TM is (comptationally) eqivalent to Halt State Version of TM With these comments, we give below a formal definition of the Final State version of TM Definition: Tring machine (Final State Version) A Tring Machine is a sextple ( Q,,, δ, q 0, F) where the varios involved symbols denote varios entities as follows: 67

Tring Machine and Recrsive Fnctions Q : The set of states Σ : The set of inpt symbols : The set of Tape symbols q 0 : The initial state F : The set of finial states and δ : is a partial fnction from Qx to Q x x { L, R, N }, with L, R and N respectively denoting move to the Left, move to the Right and No move of the Head The standard TM and all the extensions of standard TM mentioned above can also be defined in terms of Final State version of the Standard TM on the lines of the above definition. Ex.2) Constrct an NDTM to accept the langage {a n b m : n 1, m 0} 2.3 UNIVERSAL TURING MACHINE (UTM) We know the general-prpose compter has the property that the same compter system is sed to solve all sorts of problems from different domains of hman experience, provided, of corse, the problem nder consideration is (algorithmically) solvable. However, from the discssion of Tring machines so far, it is observed that we have constrcted a new Tring Machine for each new problem to be solved. On closer examination of the general-prpose compter, we find that the capability of the compter in respect of solving any problem, is mainly based on the fact that the program i.e., the description of the seqence of steps (to be exected by the execting component of the compter) in some coded form alongwith the reqired data, can be stored in the memory of the compter. Later, the control nit of the compter reads the codes for the steps, one step at a time in some order, decodes the code which is read and the concerned execting nit is activated to execte the corresponding step. This process of reading of the code for a step, decoding the code and execting is repeated till the code for final reslt is delivered to the memory of the compter. By following some similar method, even we can constrct a (single) Tring Machine, which can solve all sorts of solvable problems. Sch a Tring Machine is called a Universal Tring Machine (UTM). In order to constrct a UTM, let s make the following observations: Observation I: A Tring Machine M designed to solve a particlar problem P, consists, apart from the description of the set of possible states and the set of possible inpts etc, of mainly the description of the process in some coded form of a seqence of steps reqired to solve the problem in the form of the move-fnction δ. Ths to solve the problem P, sing Universal Tring Machine, the process part involving δ of the Tring Machine M, and the inpts, are expressed in the code (i.e. langage) of the Universal Tring Machine. This code of the process (for solving the problem) along with the code of the inpt, is stored in the memory (i.e., the Tape) of the UTM. And jst on the lines of the control nit of a general-prpose compter, the control nit of UTM, reads the codes for steps, one step at a time, decodes and exectes the code for each step, ntil the code for the final reslt is stored on the Tape of the UTM. Observation (II): A Tring Machine M designed to solve a particlar problem P, can essentially be specified by (ii) The initial state say q 0M of the Tring Machine M The next-move fnction δ m of M, which can be described by the rles of the form: if the crrent state of TM M is q i and contents of cell being scanned 68

Tring Machine- Miscellany are a j then the next state of M is q k, the symbol to be written in the crrent cell is a l and move m f of the Tape Head may be :To-Left, To-Right or None. Ths, each of these rles for a particlar TM M can be specified by qintples of the form (q i, a j, q k, a l, m f ). And hence the next-move fnction δ m for machine M is completely specified by the set. {( q i, a j, q k, a l, m f ) : q i, q j Q M ; a j a l, Γ M ; m F { To-Left, To-Right, None} } Process part of the TM which is defined by the set of all moves is given by the above set. Observation 3: Next the qestion that arises in context of the constrction of Universal Tring Machine, is abot the nmber of distinct states in UTM and nmber of distinct inpts/tape symbols reqired in the UTM, so that it can solve any solvable problem. As UTM shold be able to simlate each Tring Machine, therefore, it may appear that nmber of distinct states and nmber of distinct Tape Symbols in the UTM, shold be at least as mch as is possible in any TM, becase UTM may be reqired to accomplish the task of (i.e. to simlate) any TM. However, by proper coding techniqes we may se only two symbols to represent set of symbols. This will be shown to be tre in a short while. Of Corse, if there are enogh symbols say for states, then the same symbols may be sed for different Tring Machines, if reqired, jst by renaming the states for different TMs. Thogh, for each TM, the nmber of states and the nmber of Tape Symbols, each is finite for each TM, yet there is no pper bond on each of these nmbers. Therefore, we assme each of the set of states, Q = {q 0, q 1, q 2.} and the set of Tape Symbols is = {a 1,a 2,a 3 } is contably infinite The Head-Move set M of the moves of head of corse, has only three elements viz, i.e., H mv = {L, R, N} Where L denotes Move-Left, R denotes Move-Right and N denotes No Move of the Head Observation (IV): Each of the sets Q and involves infinitely many symbols. However we cannot prodce infinitely many distinct symbols reqired for in the above mentioned entities, viz Q and. Bt, we can devise a mechanism to represent these infinite nmber of distinct entities. For this prpose, the alphabet set of {0,1} of two elements is sed to represent all these entities, where seqences of repeated 0 s denote varios elements of Q, and H mv. The symbol 1 is sed as a separator. Seqences of 1 s of different lengths, are sed to separate different coded elements. We will explain these ideas with sitable examples. First, we consider a coding scheme λ for θ, and H mv in terms of the alphabet{0,1}, as follows: λ (q i )= 0 i+1 i = 0, 1, 2,.. (for example λ (q 0 ) = 0, λ (q 3 ) = 0000, to be denoted by 0 4 etc) λ (a j )= 0 j for j = 1, 2, 3. ( for example λ (a 2 ) = 00, to be denoted by 0 2 ; λ(a 4 ) = 0000, to be denoted by 0 4 Also, λ (L)= 0, λ (R)= 00, (or 0 2 ) and λ (N) = 000 (or 0 3 ) 69

Tring Machine and Recrsive Fnctions Note that the same seqence of 0 s may represent a state, an inpt symbol or a move, e.g, 000 may represent the state q 2, the inpt symbol a 3 and N of moves. However, there is no possibility of confsion or error, becase, the strings of 0 s are placed in relatively different positions in the representation of a move to denote a state, an inpt symbol or a move. Once the basic sets involved in descriptions of the processes, are encoded, we describe the fnction δ. We are going to constrct UTM as a Deterministic Tring Machine and hence for the move (q i, a j, q k, a l, m f ) the components q k, a l and m f are niqely determined by the pair of q i and a j and hence we se the shorthand M ij for the move (q i, a j, q k, a l, m f ). By the above-mentioned coding scheme, the five components q i, a j, q k, a l and m f are respectively represented as λ (q i ), λ (a j ), λ (q k ), λ (a l ) and λ (m f ), each of which is a seqence of 0 s. Next the move M ij given by (q i, a j, q k, a l, m f ) may be coded in terms of {0,1} by replacing each, by one 1 and each parentheses also by one 1. Ths each move M ij is coded as 1 0 i+1 1 0 j 1 0 k+1 1 0 l 1 0 ξ 1, where ξ = 1, if move is to the Left, ξ = 2, if move is to the Right, and ξ = 3, if there is to the No Move. As, each of the moves will begin and end with a 1, hence, there will be two 1 s between two moves. in the representation, the therefore, moves are distingished from its components like states etc Bt there is only one 1 between varios components of a move. Frther, by beginning and ending of the code of a TM marked by three1 s, we distingish a TM from its components, i.e, its moves. Also, as mentioned earlier, a Tring Machine is completely specified by the initial state say q o and λ the Next-Move fnction. In view of these notational conventions, the code of a TM, may be given by 111 λ (q o )1 λ (M 11 )1 λ (M 12 )1 λ (M 14 ) 1 λ (M 21 )1 λ (M 22 ). 1 λ (M mn )11.. (A) We may notice that the code of a TM has only two 1 s explicitly given at the end of the code. The third 1 is contribted by the code of λ (M mn ), the last move of the machine M. We recall that Γ = {a 1, a 2.} denotes the set of contably infinite tape symbols and each of the tape symbols a j, will be coded as λ (a j )= 0 j for j = 1, 2, 3.... (B) The encoding of varios code symbols in the (initial) inpt are separated by 1 s, eg, if a 2 a 4 a 7 is the initial inpt then it may be represented as 10 2 10 4 1 0 7 1. Remark 2.3.1: From the above discssion, we make the following observations, which will play an important role, when later on, we wold be giving examples of a langage having or not having some properties: 70

(ii) (iii) Every TM can be thoght of as a niqe seqence of binary digits, bt only special types of binary seqences, e.g., seqences starting with three I s. Not a separate observation, bt a conseqence of observation above bt stated separately in view of its significance, is that not every binary seqence represents a TM. Ths every binary seqences can be interpreted as at most one TM In view of and (ii) above, if a binary word w represents a TM M then w treated only as a binary string (and not treated as representation of TM) can also be given as inpt to the TM M and hence the qestion Does M accept w? or Does a TM having w as its representation accept w as an inpt string? is a relevant qestion. This qestion may have a yes answer for some pairs of (M,w) and No answer for some other pairs of (M,w). Tring Machine- Miscellany Next, we briefly describe how the UTM will solve a problem P for which a TM M already exists. As a first step, the process component of M is encoded in terms of the alphabet set {0, 1} as given by (A) above and the (initial) inpt is encoded sing the coding given by (B). We assme the UTM is a 3-Tape Machine. The encoding of the inpt for the problem P is written on the first Tape of UTM. On the second Tape of UTM is written the process component of M as is given by (A) above. On the third Tape, the crrent state of M is stored. The control nit of UTM simlates the TM M. The control nit by conting nmber of 0 s between 1 s, finds ot the inpt symbol a j on Tape 1 and finds the crrent state q i from Tape 3 of UTM. At This stage, control of UTM knows the pair (q i, a j ). which niqely determines the move M ij = (q i,a j,a k,a l,m f ). The control nit extracts the qintple (q i, a j, q k, a l, m f ). From the qintple, the control nit of UTM extracts q k, the next state of M; a l, the next symbol to be written in the crrent cell being scanned; and m f the move of the Head. The control nit of UTM then writes q k in place of q i on Tape 3; writes a l in place of a j on Tape 1 and moves the Head on Tape 1 of UTM according to m f. Ths 3-Tape UTM is able to solve the problem P by simlating the soltion imbedded in TM M. 2.4 LANGUAGES ACCEPTED/DECIDED BY TM Problem, its instance and its langage: Let s nderstand the difference between a problem and an instance of a problem (sometimes called a qestion) from the following statement: A problem may be to find ot the roots of a (general) qadratic eqation say ax 2 + bx + c = 0, with a 0, where a, b, c R, are parameters of the problem. A set of vales one for each of the three parameters, gives an instance of the problem (i.e., a qestion). Ths finding ot the roots of a qadratic eqation 4x 2 + 3x + 2 = 0 is an instance of the problem of finding the roots of the qadratic eqation ax 2 + bx + c= 0. Hence, the problem of finding the roots of the eqation ax 2 + bx + c = 0 can be eqivalently represented by the set of all triples of the form (a 0, b, c), where each triple, which is jst a single string, say (4, 2, 0), represents an instance of the problem. Therefore, the problem of finding roots of a qadratic eqation ax 2 + bx + c with a 0, b, c R is eqivalently represented by the infinite set {(a, b, c), a, b, c R and a 0)}, where each member string (a, b, c), like (4, 2, 0), represents an instance of the problem. In general a problem is a set of its instances, where each instance is obtained by assigning vales to the parameters, from the domain, say D, over which the problem is defined. Ths a problem is eqivalently defined as a set from a domain D. Also, each of the element of a domain D can be written as a string over some alphabet. For example, in the case of the problem of finding roots of a 71

Tring Machine and Recrsive Fnctions qadratic eqation, the domain consists of triples (a, b, c) were a, b, c are integers and a 0. Bt each integer can be written as a seqence of digits from the alphabet {0, 1, 2,.., 9}. And hence each triplet can be written as a seqence over the alphabet {0 1.. 9, ), ( } Ths, we conclde that each problem can be thoght of as a set of strings over some alphabet. Also, a set of strings over an alphabet is also called a langage over the alphabet. Ths, we frther conclde that a problem can be thoght of as a langage over some alphabet. In the following discssion, nless mentioned otherwise, a langage L representing an arbitrary problem P shall be over an alphabet, which we denote by Σ. In other words, a langage L will be assmed to be a sbset of Σ *. For a problem, nmber of instances need not always be infinite. For example, in the problem, of finding roots of a qadratic eqation ax 2 + bx + c = 0 in which each of a, 0, and c is a natral nmber less than or eqal to 10, then the set of instances or the set of strings representing the problem is 1210, which is finite. However, in context of problems, we are interested, problems generally have infinite nmber of instances, i.e., the sets representing the problems have infinite strings. Definition: Tring Acceptable Langage: A langage L Σ * is said to be Tring Acceptable langage if there is a Tring Machine M which when given an inpt w ε *, sch that w also belongs to L, then halts with an otpt Y. However, if ω L, then M may not halt frther if the Tring Machine halts, on an inpt ω with L then it shold halt with an otpt different from Y. Some athors call Tring Acceptable Langage as Recrsively Enmerable langage also. Definition: Tring Decidable Langage: A langage L Σ* representing a problem over, is said to be Tring Decidable, if there is a Tring Machine M which always halts when given any inpt w Σ * whether ω L or ω L. Frther if ω L then M halts with otpt Y, indicating that the string ω is in the langage L. And if ω L, then M halts with otpt N, indicating that ω does not belong to L. Decidable/Solvable Problem: A problem P is said to be Decidable or Solvable if the langage L Σ * representing the problem is Tring Decidable. (Some athors call a Tring Decidable langage as Recrsive set or a Recrsive Langage.) Also, we know that an Algorithm is a program that terminates on all inpts. And, also it is not difficlt to see that each TM that halts for all inpts can eqivalently be expressed as a programme and vice-versa. Ths, the three statements: the statement that a langage L is Tring Decidable the statement that langage L is a recrsive set and the statement that there is an algorithm for recognizing L are eqivalent. Note: The phrase recognizing A TM a langage is different and more powerfl than the phrase A TM accepting a langage Remarks 2.4.1: It may be clearly nderstood that in the case of a langage L which is Tring Acceptable Langage bt which is not Tring Decidable, there may be a TM M which halts on large nmber of inpt strings ω, where ω L, bt there mst be at least one string ω L on which M does not halt. 72

Similarly, in the case of a langage L which is not Tring Acceptable (and hence can not be Tring Decidable), it may happen that there is a TM M which may halt for a large nmber of inpts w which belong to L. Bt there mst be at least one string w L for which M does not halt. Tring Machine- Miscellany Remark 2.4.2: In respect of the langages defined above, we make the following observations: (ii) Each Tring Decidable langage L is necessarily Tring Acceptable. However, there may be langages which are Tring Acceptable bt not Tring Decidable. (iii) Frther, there may be langages L Σ * which may neither be Tring Acceptable and hence nor Tring Decidable. For a langage L which is not Tring Acceptable, there can not be any Tring Machine M which halts for every string ω of L. Before discssing properties of the classes of Tring Acceptable langages and Tring Decidable langages, let s mention that we need to consider at least one example of each of the langages, which is (ii) Tring Decidable. Tring Acceptable bt Tring Decidable. (iii) not Tring Acceptable (and hence not Tring Decidable). However, the last two reqired examples form the backgrond of sbject-matter of the next section. Next, we discss some basic properties of the class of Tring Decidable langages and class of Tring Acceptable langages. As langages are sets (of strings), therefore, we can talk of nion, intersection, and complementation etc. of langages. Theorem 2.4.3 For two recrsive langages L 1 and L 2, each of the following langages L 1 L 2 (ii) L 1 L 2 (iii) Σ * L 1 is recrsive. We establish each part of the above Theorem by constrcting an appropriate TM deciding the langage. Proof: Let M i be a TM for deciding the langage L i for i = 1, 2, sch that if ω L i then M i retrns Y else retrns N. For establishing Part above: we first of all, constrct a newtring Machine M 3 having {Y, N} as the set of symbols. These inpt symbols are the only possible otpts of each of M 1 and M 2, and whenever these otpts are available, are written on the Tape of M 3 as inpts to M 3. The machine M 3 retrns Y as otpt, if at least one of the otpts of M 1 or of M 2 is a Y, However, if there is no Y in the inpt to M 3 then the machine retrns N. The reqired TM M-Union has M 1, M 2 and M 3 as component machines arranged as given by the following figre has The overall control is with the machine M-nion. 73

Tring Machine and Recrsive Fnctions M 1 ω Σ * M 3 M 2 Next, we briefly explain the fnctioning of the designed machine M-nion A string w ε *, when given as inpt to M-nion, is frther given by the control of M-nion, as inpts to both M 1 and M 2. As both langages are decidable, therefore, after some finite amont of time, both halt, each with an otpt as Y or N. These otpts, whenever delivered are written on the Tape of M 3. When both the otpts are written on the Tape of M 3, M 3 is activated. According to the definition of M 3, it halts with the desired otpt Y if ω L 1, or ω L 2, else the machine halts with otpt N. The otpt of M 3 is the otpt of M-nion. Ths, for each w ε *, M-nion retrns a Y or N and hence its langage L 1 U L 2 is Tring Decidable. Part (ii) In this case, first of all, we constrct a TM M4 having { Y N}as set of inpt symbols. These inpt symbols, as mentioned earlier, are the only possible otpts of each of M 1 and M 2. These otpts whenever available are written on the Tape of M 4 as inpts to M 4. The machine M 4 is designed sch that it retrns a Y if the inpt seqence consists of both Y s. However, if the inpt seqence consists of at least one N then M 4 retrns N. ω M 1 M 4 M 2 The reqired TM M-intersection has M 1, M 2, and M 4 as component machines as given by the above figre. The overall control also is nder M-intersection. The machine fnctions on the similar lines as M-nion fnctions. The only difference is that its component machine M 4 retrn Y if both M 1 and M 2 retrn a Y, else M 4 retrns N. And the otpt of m 4 is the otpt of M-nit. Ths for each ω Σ *, retrns either a Y or N in sch manner that if ω L 1 L2 then M-intersection retrns a Y as otpt, else N as otpt. Hence its langage L 1 L 2 is Tring Decidable. 74

Tring Machine- Miscellany Part (iii): In this case, we constrct a TM M 5 which on reading a Y retrns N and on reading an N retrns a Y. The reqired TM machine M-complement the following diagrammatic representation. ω Σ * M 5 M 1 The machine M-complement fnctions as follows : When a string ω Σ * is given an inpt to M-complement, its control passes the string to M 1 as inpt to M 1. As M 1 as decides the langage L 1, therefore, for ω L 1 after a finite nmber of moves, M 1 otpts Y which is then given as inpt to M 5, which in trn retrns N. Similarly, for ω L i, M 5 retrns Y. Also the otpt of M 5 is delivered as otpt of M- complement. Ths for each ω Σ * M-complement retrns either a Y or N s.t, if ω ε L 1 then M-complement retrns N, else retrns Y. Hence the langage of M- complement is Trning-Decidable. Theorem 2.4.4: If L 1 and L 2 are recrsively enmerable (i.e, Tring Acceptable) langages then L 1 L 2 is also recrsively enmerable. Proof: Let M i, i = 1, 2, be TM, that accepts all strings ω L i, bt may or may not halt if ω L i. Then a TM M-A-nion with the following configration and description accepts L 1 L 2. ω Σ * M 1 M6 M 2 The overall control in M-A-Union which may stop and start any or all of M 1, M 2 and M 6. The TM M 6 fnctions as follows: If, at any stage, there is an otpt from any one of M 1 or M 2, then on the first otpt from either M 1 or M 2, the machine M 6 is activated and the otpt from M 1 or M 2, whichever is available, is written on the tape of M 6. If the otpt is Y either from M 1 or M 2, say M 1, then the control of the overall machine M retrns a Y and halts the machine. However, if it is an N, say from M 1, then the other machine M 2 and hence the overall machine M contine operations. If at any later stage, the other machine, which we have assmed is M 2, halts and M 2 halts with a Y, then overall machine M gives the otpt Y and Halts. If M 2 halts with an N, then N is retrned. However, if either none of the two 75