today time complexity defn examples robustness admin ps1 out tonight, due 01-31 sign up for piazza --- defn TM picture prop: TM M with L(M)={0^n1^n} pf Q. how many steps does this take? eg, # of iterations of transition function n=input length n^2 Q. can we do better? not just (n^2)/10, but asymptotically better? Fact: cannot run in time O(n) Sipser #7.47 Prop: TM M with L(M)={0^n1^n} in O(n\lg n) steps idea check for 0*1* count check equality of \lg n bits each \lg n sweeps of entire tape n steps each count parity of 0's vs parity of 1's cross off half of 0's and half of 1's Fact: cannot run in time o(n\lg n) Sipser 7.47 so this is tight Prop: two-tape TM M with with L(M)={0^n1^n} in O(n) steps Pf defn of two-tape TM by picture algo check for 0*1* copy 0's to second tape compare 0's to 1's in real-time using tapes in parallel rmk time complexity changed with model but not by much defn TIME picture of heirarchy theorem Prop: TIME_{2-tape TM}(t(n))\subseteq TIME((t(n)+n)^2) pf simulate all updates in sweeps use larger tape alphabet to encode head position rmk two-tape and one-tape models are polynomially related in time complexity \-> also applies to all known realistic deterministic models of computational Extended Church Turing thesis says this extends to all known realistic models potentially falsified by quantum computing defn of P rmk: model invariant worst case notion roughly corresponds to theoretical efficiency big Oh due to model invariance closed under subroutines often efficient in practice many natural algo run in ~n^3 n^1000 is not efficient problems outside P are usually not efficiently solvable Q. What is in P? ex graph connectivity do algo Q. encoding issues? PRIMES is in P in unary is in P in binary, but this is harder HAMPATH not known to be in P --- today: time complexity robustness of P defn of P next time: non-determinism NP