All the computational problems we have described are defined as
languages, i.e. yes/no questions. Given a function f:{0,1}* ->
{0,1}* we say that f is computable in polynomial time iff there
is some TM
that computes f
whose running time is O(nk) for some k.
Define the language Lf={< x,i,b > | the i-th bit of f(x) is b}.
Note that if f(x) has length m then neither
< x,m+1,0 > nor <x,m+1,1 > will be in Lf.
Show that
- If f is polynomial-time computable then Lf
is in P.
- If Lf is in P then f is polynomial-time computable.