The machines in the exercise work as follows:

Similar documents
Chapter 4. The Laplace Transform Method

7.2 INVERSE TRANSFORMS AND TRANSFORMS OF DERIVATIVES 281

Lecture 21. The Lovasz splitting-off lemma Topics in Combinatorial Optimization April 29th, 2004

A Study on Simulating Convolutional Codes and Turbo Codes

Problem Set 8 Solutions

Digital Control System


Moment of Inertia of an Equilateral Triangle with Pivot at one Vertex

Codes Correcting Two Deletions

CS 170: Midterm Exam II University of California at Berkeley Department of Electrical Engineering and Computer Sciences Computer Science Division

TMA4125 Matematikk 4N Spring 2016

Chapter 2 Sampling and Quantization. In order to investigate sampling and quantization, the difference between analog

Comparing Means: t-tests for Two Independent Samples

Jul 4, 2005 turbo_code_primer Revision 0.0. Turbo Code Primer

Lecture 17: Analytic Functions and Integrals (See Chapter 14 in Boas)

Convex Hulls of Curves Sam Burton

Lecture 9: Shor s Algorithm

Lecture 15 - Current. A Puzzle... Advanced Section: Image Charge for Spheres. Image Charge for a Grounded Spherical Shell

Solving Differential Equations by the Laplace Transform and by Numerical Methods

Lecture 8: Period Finding: Simon s Problem over Z N

Correction for Simple System Example and Notes on Laplace Transforms / Deviation Variables ECHE 550 Fall 2002

Bogoliubov Transformation in Classical Mechanics

SECTION x2 x > 0, t > 0, (8.19a)

Homework #7 Solution. Solutions: ΔP L Δω. Fig. 1

Social Studies 201 Notes for November 14, 2003

Clustering Methods without Given Number of Clusters

Solutions for homework 8

ME 375 EXAM #1 Tuesday February 21, 2006

Nonlinear Single-Particle Dynamics in High Energy Accelerators

CSE 355 Homework Two Solutions

DIFFERENTIAL EQUATIONS

Physics 741 Graduate Quantum Mechanics 1 Solutions to Final Exam, Fall 2014

Exercise set 1 Solution

into a discrete time function. Recall that the table of Laplace/z-transforms is constructed by (i) selecting to get

CHAPTER 8 OBSERVER BASED REDUCED ORDER CONTROLLER DESIGN FOR LARGE SCALE LINEAR DISCRETE-TIME CONTROL SYSTEMS

CHAPTER 4 DESIGN OF STATE FEEDBACK CONTROLLERS AND STATE OBSERVERS USING REDUCED ORDER MODEL

Dimensional Analysis A Tool for Guiding Mathematical Calculations

Practice Problems - Week #7 Laplace - Step Functions, DE Solutions Solutions

Lectures on Markov models in life and sickness insurance.

Linear Motion, Speed & Velocity

p. (The electron is a point particle with radius r = 0.)

Control Systems Analysis and Design by the Root-Locus Method

MATHEMATICAL MODELS OF PHYSICAL SYSTEMS

Social Studies 201 Notes for March 18, 2005

Singular perturbation theory

A Note on the Sum of Correlated Gamma Random Variables

The Laplace Transform (Intro)

MATEMATIK Datum: Tid: eftermiddag. A.Heintz Telefonvakt: Anders Martinsson Tel.:

Chapter 5 Consistency, Zero Stability, and the Dahlquist Equivalence Theorem

2.7.2 Limits to Parallelism

Laplace Transformation

IEOR 3106: Fall 2013, Professor Whitt Topics for Discussion: Tuesday, November 19 Alternating Renewal Processes and The Renewal Equation

Suggested Answers To Exercises. estimates variability in a sampling distribution of random means. About 68% of means fall

Math Skills. Scientific Notation. Uncertainty in Measurements. Appendix A5 SKILLS HANDBOOK

Introduction to Laplace Transform Techniques in Circuit Analysis

Preemptive scheduling on a small number of hierarchical machines

Demonstration of Riemann Hypothesis

Fair Game Review. Chapter 6 A B C D E Complete the number sentence with <, >, or =

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Midterm Review - Part 1

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Solving Radical Equations

A Constraint Propagation Algorithm for Determining the Stability Margin. The paper addresses the stability margin assessment for linear systems

March 18, 2014 Academic Year 2013/14

RELIABILITY OF REPAIRABLE k out of n: F SYSTEM HAVING DISCRETE REPAIR AND FAILURE TIMES DISTRIBUTIONS

Notes on the geometry of curves, Math 210 John Wood

Chapter 7. Root Locus Analysis

One Class of Splitting Iterative Schemes

Computation Histories

Online Appendix for Managerial Attention and Worker Performance by Marina Halac and Andrea Prat

DIFFERENTIAL EQUATIONS Laplace Transforms. Paul Dawkins

Computers and Mathematics with Applications. Sharp algebraic periodicity conditions for linear higher order

Reading assignment: In this chapter we will cover Sections Definition and the Laplace transform of simple functions

Avoiding Forbidden Submatrices by Row Deletions

Math 201 Lecture 17: Discontinuous and Periodic Functions

Linear Momentum. calculate the momentum of an object solve problems involving the conservation of momentum. Labs, Activities & Demonstrations:

NCAAPMT Calculus Challenge Challenge #3 Due: October 26, 2011

Given the following circuit with unknown initial capacitor voltage v(0): X(s) Immediately, we know that the transfer function H(s) is

New index matrix representations of operations over natural numbers

Tight Timing Estimation With the Newton-Gregory Formulae

MAE140 Linear Circuits Fall 2012 Final, December 13th

e st t u(t 2) dt = lim t dt = T 2 2 e st = T e st lim + e st

Solutions to homework #10

DIFFERENTIAL EQUATIONS

Learning Multiplicative Interactions

PHYSICS LAB Experiment 5 Fall 2004 FRICTION

Theoretical Computer Science. Optimal algorithms for online scheduling with bounded rearrangement at the end

Analysis of Step Response, Impulse and Ramp Response in the Continuous Stirred Tank Reactor System

ME 375 FINAL EXAM SOLUTIONS Friday December 17, 2004

Bayesian Learning, Randomness and Logic. Marc Snir

arxiv: v1 [hep-th] 10 Oct 2008

Hylleraas wavefunction for He. dv 2. ,! r 2. )dv 1. in the trial function. A simple trial function that does include r 12. is ) f (r 12.

Lecture 7: Testing Distributions

Overflow from last lecture: Ewald construction and Brillouin zones Structure factor

SOME RESULTS ON INFINITE POWER TOWERS

Exercises for lectures 19 Polynomial methods

LECTURE 12: LAPLACE TRANSFORM

CALIFORNIA INSTITUTE OF TECHNOLOGY Control and Dynamical Systems

CSE 105 THEORY OF COMPUTATION

A Simplified Methodology for the Synthesis of Adaptive Flight Control Systems

Transcription:

Tik-79.148 Spring 2001 Introduction to Theoretical Computer Science Tutorial 9 Solution to Demontration Exercie 4. Contructing a complex Turing machine can be very laboriou. With the help of machine chema it i poible to combine imple Turing machine to obtain more complex one. The imple baic machine are: For every ymbol in Σ there i a machine that write the ymbol in the tape and then top with out moving it read/write head. Machine R and L that move the head one tep to right or left, repectively, and then top. The machine in the exercie work a follow: (a) The machine move the head to the right in an eternal loop. (b) The machine firt move it head one tep to the right. If it now can an a, it will replace it by a b. If it can a b, it will replace by an a. (c) The machine move it head two tep to the right. Note that if the head already i in the left end of the tape, the behaviour of the machine i not well defined. (The tarting mark alway caue the head to move one tep to the right.) (d) The machine firt move it head one tep to the left, and if it now can a non-empty ymbol it move the head back to the right. 5. The three mot fundamental term related to Turing machine are: Turing decidable Turing acceptable, emi-decidable Turing computable A language L i Turing decidable if there exit a Turing machine M o that { (, w) (h, Y ), if w L M (h, N), if w / L For all tring w Σ it i poible to determine whether they belong to the language or not. A language L i Turing acceptable if there exit a Turing machine M o that M top with the input w w L Turing machine that accept (or emidecide) a language top if and only if the input tring belong to the language. In other cae the machine continue it computation forever. There are language that are Turing acceptable but not Turing decidable. For example: 1

L = {M M i a Turing machine that halt on the input e} i uch a language. You can think that a Turing machine that decide a language L actually compute the function f : Σ {y, n}. Thi can be generalized to arbitrary function on tring g : Σ Σ. We get the definition: a Turing machine compute a function g, if f(w) = u (, w) M (h, u) The machine ha a tring x a input, an in the end of the computation there i the tring f(x) in the tape. Function with everal argument can be defined in a imilar way. In thi cae, the argument are eparated by one blank from each other and written one after another in the beginning of the tape. Thi i the initial configuration of the machine M. (Example: w 1 w 2 w n ). (a) Turing machine that accept the language a ba b: M = (K, Σ, δ, ) K = {q 0, q 1, q 2, q 3 } Σ = {a, b, } = q 0 q σ δ(q, σ) q 0 (q 1, L) q 1 a (q 1, a) q 1 b (q 2, L) q 1 (q 1, ) q 2 a (q 2, L) q 2 b (q 3, L) q 2 (q 2, ) q 3 a (q 3, L) q 3 b (q 3, b) q 3 (h, ) The tarting point of the contruction of the machine wa a correponding tate machine. The machine can top only when the input tring belong to the language (by the definition of emideciding), o the machine i left to an eternal loop every time a wrong type of tring i found. In fact, the language given in the exercie i decidable. That i, it i poible to contruct a machine that alway halt and expree whether the input tring belonged to the language or not (compare to the next exercie). (b) You are aked to contruct a machine that get a input (w), and after the computing the tape contain (Y ), if w L or (N), if w / L. In the contruction, the beginning of the tape i firt marked with a ymbol S. After that the machine compare the firt letter of the word to the lat letter, erae them and repeat. 2

# R # L a,# b # L # L # S b R a a # R # L b,# C i,j : L #RYR #L RNR A machine L σ can the tape to the left until it find the firt occurrence of the ymbol σ. (c) We contruct a machine that compute the function f(m, n) = m+n. The input of the machine i of the form (I m I n ), and after the computation the tape contain (I m+n ). The eaiet way to accomplih thi i to move the tring I n one tep to the left: L # R # L I #LIR 6. Firt we define machine C i,j that copie the ymbol on the right ide of the head in the tape i to the tape j, until the firt blank i canned. R i,j σ i i σ j For example: The configuration 1 0 1 0 i tranformed to 1 0 1 0 1 0 M L : R Next we define another auxiliary machine M L that move the tring on the right ide of the head one tep to the left, and leave the head to the right end of the moved tring. L σ LσR 3

For example, the configuration 0 1 0 i tranformed to 0 1 0 E : An auxiliary machine E move tring on the right ide of the head to the beginning of the tape. L R M L L R L For example, the configuration 0 1 1 0 i tranformed to 1 0 With the help of the auxiliary machine we contruct a 2-tape machine 1,2 that um two binary number. The machine i baed on the text book example 4.3.2 and it i relatively complex 1 The machine in the example of the book only work correctly, if the two number have equal number of bit. Additionally, the machine leave the tape in an erroneou configuration. Correcting thee mitake take quite an effort. Example: Starting from the configuration 1 0 1 0 1 The machine 1,2 mark the beginning of the tape by ymbol, copie the firt word of the input to the econd tape, and move the head to the end of the tape: 1 0 1 0 1 0 1 1 If any of the reader find a impler olution, the aitant of the coure would be very grateful if it were not told to them. 4

After that the machine can both number from their end to the beginning, and calculate their um bit by bit. At the ame time, the econd tape i being cleaned. 1 0 1 1 1 Calculation end when either of the number end. In thi example, the upper number ended firt. The anwer, 111, i moved to the beginning of the firt tape, and ymbol are removed. 1 1 0 0 1 2 1,2 : 0 1 0 2 0 1 1 2, 1 1 0 2 L 1,2 1,2 C 1,2 R 2 R 1 L 1,2 1 1 2 1 σ 2 1 2 1 1 1 2 σ 1 2 0 1 2 1 1 2 σ 2 L 1,2 2 1,2 E 1 R 1 L 1 1 1 1 1 2 0 1 2 0 2 1 1 2 0 1 2 L 1,2 1 2 1 1 1 2 L 1,2 2 01 2 0 1 0 2 0 1 1 2, 1 1 0 2 1 1 1 2 1 1 2 0 1 2 1 1 L 1 1 0 1 2 L 1,2 0 1 1 1 2 L 1 1 1 1 Before implementing multiplication, two more auxiliary machine are needed: D i,j and W L. The machine D i,j compute the number of zero in 5

the end of the number in the firt tape, and multiplie the number in the econd tape by 2 for each zero. For example 1 0 i tranformed to 1 0 1 0 0 1 0 0 0 1 0 1 0 0 D i,j : L i 0 1 0 i 0 j R j R i W L : The machine W L clean the tape by removing the tring on the left ide of the head. L Multiplication of binary number can be accomplihed by erie of ummation and multiplication by two. For example: 101 2 110 2 = 101 2 2 2 + 101 2 2 1 Thu, multiplication can be accomplihed by the next algorithm and a 3-tape Turing machine: 1. Write 0 in the beginning of the econd tape. 2. Copy the firt factor to the econd tape. 3. Go through the econd factor from the end to the beginning. For each zero in the end of the number multiply the factor in the econd tape by two. 4. If there have been found a 1-bit in the econd factor in the end of the third tep, replace the 1-bit by a 0-bit. If the number only contained zero, multiplication i ready and the reult can be found in the beginning of the econd tape. 5. Compute the um of the number in the econd tape with the help of the third tape, and return to the tep 2. 6

1,2,3 : R 2 0 2 R 2 L 1,2 C 1,2 R 1 D 1,2 1 1 0 1 R 1 1,2 1 RW 1 1,2 L L2 WL 1C 2,1WL 2L2 Even if the machine 1,2,3 ha three tape, it only ue two tape explicitly, and the third tape erve only a an auxiliary tape for the ummation. Finally, let tudy how the machine calculate 2 3 (that i, 10 2 11 2 ). In the beginning the firt two tape contain: 1 0 1 1 The product i initialized to zero, and the firt factor i copied to the econd tape. 0 1 0 1 0 1 1 Becaue the lat bit of the econd factor i not zero, there i no need for multiplication by two but the ummation can be done directly. 1 0 1 0 1 0 The firt factor i copied to the econd tape again. 1 0 1 0 1 0 1 0 Thi time, the firt factor end with a 0-bit, o the other factor will be multiplied by two. 1 0 1 0 0 1 0 1 0 Next, the lat 1-bit in the firt tape i replaced by a zero, and the number in the econd tape will be ummed. 1 1 0 1 0 0 0 7

During the next iteration the product i ready and it will be copied to the beginning of the firt tape. 1 1 0 8