hwsol1.1 - CSci 5403, Spring 2010 Homework 1 due: Feb 2,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSci 5403, Spring 2010 Homework 1 due: Feb 2, 2010 Chung-I Lin Ruoyu Sun Yun Zhang 1. Question 1 Given f ( n ) and g ( n ) are time constructible, there are two Turing Machine M 1 and M 2 that compute f ( n ) and g ( n ) on input 1 n in time O ( f ( n )) and O ( g ( n )) respectively. We assume that both M 1 and M 2 use Γ = { 0 , 1 , ± , B } , have k tapes including input and output tapes and use LSB-first representation. (a) f ( n ) + g ( n ) We prove that there is a new Turing Machine M which has k+2 tapes and computes f ( n ) + g ( n ) using the following steps: 1. M simulates the computation of M 1 and outputs f ( n ) to (k+1)st tape, then simulates the computation of M 2 and outputs g ( n ) to (k+2)nd tape. 2. M moves the heads to left end of (k+1)st and (k+2)nd tapes. 3. Set the Carry Flag to 0. 4. Read a digit from (k+1)st and (k+2)nd tapes respectively and move the heads to right. Read Carry Flag. Write the computed result back to the output tape. Update the Carry Flag. Move the head of the output tape to the right. 5. Repeat Step 4, until both heads read
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

hwsol1.1 - CSci 5403, Spring 2010 Homework 1 due: Feb 2,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online