The string r w is accepted by m if and only if w l

This preview shows page 15 - 21 out of 22 pages.

The string r ( w ) is accepted by M if, and only if, w L The time complexity includes i) time required to transform the instances of L , and ii) time required by the solution to Q . Defn. 15.6.1 Let L and Q be languages over alphabets 1 and 2 , respectively. L is reducible in polynomial time to Q if there is a polynomial-time computable function r : 1 2 15.6 Polynomial-Time Reduction
Image of page 15

Subscribe to view the full document.

16 Example 15.6.1 (p. 349, 478) Reduces L = { x i y i z k | i 0, k 0 } to Q = { a i b i | i 0} by transforming w { x , y , z } * to r ( w ) {a, b}*. If w x * y * z * , replace each ‘ x ’ by ‘ a ’ and ‘ y ’ by ‘ b ’, and erase the z ’s otherwise, replace w by a single ‘ a The following TM transforms multiple strings in L to the same string in Q (i.e., a many-to-one reduction): 15.6 Polynomial-Time Reduction Reduction Input Condition L w { x , y , z }* w L r if and only if Q r ( w ) { a , b }* r ( w ) Q
Image of page 16
17 Theorem 15.6.2 Let L be reducible to Q in polynomial time and let Q P . Then L P . Proof . Let R denote the TM that computes the reduction of L to Q and M the TM that decides Q . L is accepted by a TM that sequentially run R and M . A computation of M processes at most tc M ( k ) transitions, where k is the length of its input string. The number of transitions of the composite TM (i.e., R and M ) is bounded by the sum of the estimates of R and M . 15.6 Polynomial-Time Reduction The time complexities tc R and tc M combine to produce an upper bound on the number of transitions of a computation of the composite TM. The computation of R with input string w generates the string r ( w ), which is the input to M . The function tc R can be used to establish a bound on the length of r ( w ). If the input string w to R has length n , then the length of r ( w ) cannot exceed the max( n , tc R ( n )). tc R ( n ) + tc M ( tc R ( n )) O( n st ) If tc R O( n s ) and tc M O( n t ), then
Image of page 17

Subscribe to view the full document.

18 Example 15.6.1 (Continued) Reduces L = { x i y i z k | i 0, k 0 } to Q = { a i b i | i 0 }: For string n of length 0 , tc R (0) = 2, tc R (1) = 4, tc R (2) = 8, etc. The worst case occurs for the remainder of the strings when an ‘ x or ‘ y ’ follows a ‘ z’ , i.e., when w is read in q 1 , q 2 , and q 3 , and erased in q 4 . The computation is completed by setting r ( w ) = a , and for n > 1, tc R ( n ) = 2 n + 4 . Combining R and M The combined TM accepts Q with tc M ( n ) = ( n 2 + 3 n + 2) / 2 . Worst-case( tc M ): input a n /2 b n /2 , if n is even, or a ( n +1)/2 b ( n -1)/2 , if n is odd Thus, tc R ( n ) + tc M ( tc R ( n )) = (2 n + 4) + ( n 2 + 3 n + 2) / 2 O( n 2 ). 15.6 Polynomial-Time Reduction The upper bound in Theorem 15.6.2, i.e., tc R ( n ) + tc M ( tc R ( n )) O( n st ).
Image of page 18
19 Example . A TM M that accepts Q = { a n b n | n 0 } and its tc : 15.6 Polynomial-Time Reduction q 0 > B / B R q f a / a R , b / b R q 1 a / B R q 2 B / B L q 3 b / B L q 4 a / a L , b / b L B / B R B / B L tc M ( n ) = 2 n 2 + 3n + 2 O( n 2 ) BB q 0 q 1 q f n = 0 BabB q 0 q 1 q 2 q 2 q 4 q 3 q f q 1 n = 1 BaabbB q 0 q 1 q 2 q 2 q 2 q 2 q 4 q 4 q 4 q 3 q 1 q 2 q 2 q 4 q 3 q f q 1 n = 2 B / B / B / B / B / B / 0 2 1 7 2 16 n tc M ( n ) 3 29 4 46 Iteration Move Steps 1 R 2 n +1 L 2 n 2 R 2 n -1 L 2 n-2
Image of page 19

Subscribe to view the full document.

20 A language accepted in polynomial time by DTM with multi- track or -tape is in
Image of page 20
Image of page 21
You've reached the end of this preview.
  • Winter '12
  • DennisNg
  • Computational complexity theory, polynomial time, Ntm

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern