Docsity

Theory Computer Science, Lecture notes of Computer Science

Partial preview of the text

Download Theory Computer Science and more Lecture notes Computer Science in PDF only on Docsity!

BCS 2143 Theory of

Computer Science

Part II: Computability

Topic 4: The Church-Turing Thesis

Introduction

 So far, we have seen several models of

computing devices.

 (^) finite automata : models for devices with small amount of memory.  (^) pushdown automata : models for devices with an unlimited memory that is usable only in the last in, first out manner of stack.

 we have also shown the capabilities of

those models, they are too restricted to

serve as models of general purpose

computers.

Input tape

 (^) A Turing machine also uses an one directional infinite tape as its unlimited memory.  (^) Tape head can read and write symbols and move around on the tape. (Left/Right).  (^) If the head is commanded to move left from the left- ended position, it’ll stay still at the same place for that move automatically.  (^) Initially, the tape contains only input string and is blank everywhere else. control a b a b    …

Halting States

 TM continues computing until it

decides to produce an output.

 Outputs are obtained by entering the

designated states:

 (^) accepting state  output = accept  (^) rejecting state  output = reject

 If it doesn’t enter these halting

states then it will go on forever,

never halting.

Algorithm of M

  1. Scan the input to be sure that it contains a single # symbol. If not, reject.
  2. Check on either side of # symbol whether these positions have the same symbol. If not, reject. Cross off symbols as they are checked.
  3. When all symbols to the left of # have been crossed off, check for any remaining symbols on the right side. If any, reject. Otherwise, accept.

Pictorial

x 1 1 0 0 0 # 0 1 1 0 0 0… x 1 1 0 0 0 # x 1 1 0 0 0… x x 1 0 0 0 # x 1 1 0 0 0… x x x x x x # x x x x x x…

accept

Configuration

During the computation of TM,

changes occur in

 (^) the current state  (^) the current tape  (^) the current head location.

A setting of these 3 items is called a

configuration of the TM.

Representation of

Configuration I

for a state q and 2 string u and v over

 (input tape alphabet)

we write uqv as a configuration, where

 (^) the current state is q  (^) the current tape contents is uv  (^) the current head location is over the first symbol of v q 7 1 0 1 1 0 1 1… configuration : 1011q 7

u v

Start/Accepting/Rejecting

Configurations

Consider a machine M on input w

 Start Configuration : q

0 w

machine starts from state q 0 with its head a the leftmost position on the tape.

 Halting Configurations : don’t yield

further configurations.

 (^) Accepting Configuration : q accept  (^) Rejecting Configuration : q reject

Acceptation

A TM (M) accepts input w if a

sequence of configurations

C 1 , C 2 ,…, Ck

exists where

  1. C 1 is the start configuration of M on input w,
  2. each Ci yields Ci+1, and
  3. Ck is an accepting configuration.

Decidable

 3 possible outcome when we put a

string into M

 (^) accept  (^) reject  (^) loop : machine does not halt. (not necessarily repeating the same steps in the same way forever)

 TM can fail to accept an input by

entering reject state or by looping.

Turing-decidable

 (^) Hard to deal with looping outcome.  (^) So, we prefer TM which can make always a decision to accept or reject on all inputs.  (^) Machines are called deciders.  (^) A decider that recognizes some language also is said to decide that language.  (^) “Call a language Turing-decidable or simply decidable if some Turing machine decides it.”  (^) Demonstrate a language that is Turing- recognizable but not decidable is difficult.  (^) We will do it on the next chapter.

Example: Convert

Algorithm to TM (cont.)

 (^01) = 0 = x  (^02) = 00 = x (contain a single 0  accept)  08 = 00000000 = x0x0x0x = xxx0xxx = xxxxxxxx  010 = 0000000000 = x0x0x0x0x (odd : reject)

= x0x0x0x0x0x0x0x = xxx0xxx0xxx0xxx = xxxxxxx0xxxxxxx = xxxxxxxxxxxxxxxx  018 = 000000000000000000 = x0x0x0x0x0x0x0x0x (odd : reject)

Example: Convert

Algorithm to TM (cont.)

 M

2 =^ (Q,,,,q 1 ,qaccept,qreject)^ where

  1. Q = {q 1 , q 2 , q 3 , q 4 , q 5 , qaccept, qreject}
  2.  = {0}
  3.  = {0, x, }
  4.  is shown with a state diagram in the following slide.