LectureNotes26

LectureNotes26 - ECS 120 Lesson 26 – Space Complexity...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: ECS 120 Lesson 26 – Space Complexity Oliver Kreylos Friday, June 1st, 2001 The last couple of lectures, we analyzed the time complexity of Turing Machines; in other words, we counted the number of computation steps a Turing Machine performs of an input word of given length. Another impor- tant property of Turing Machines is the amount of space they use, or, more exactly, the number of tape cells they ever look at during a computation. If this number is known in advance, it is not necessary to actually give a machine an infinitely long tape, but to only give it as many tape cells as it really needs. 1 Space Complexity The definition of the space complexity of a Turing Machine is very similar to the definition of time complexity (just replace every occurrence of “time” by “space:” Definition 1 (Space Complexity) Let f : N → N be a function, and let M be a deterministic Turing Machine. If, on an input word of length n , the machine never moves its tape head past the first f ( n ) cells on its tape, the space complexity of M is f ( n ) . We also say that M runs in space f ( n ) , or that M is an f ( n ) space Turing Machine . If N is a nondeterministic Turing Machine, and no branch of computation of N on input word w scans past the first f ( n ) tape cells, then the space complexity of N is f ( n ) . We also say that N runs in space f ( n ) , or that N is an f ( n ) space nondeterministic Turing Machine . In our discussion of time complexity, we also introduced the complex- ity classes TIME ( f ( n ) ) as the set of all problems that can be decided by 1 O ( f ( n ) ) time Turing Machines. We define a classification of problems based on space complexity in the same way: Definition 2 (Space Complexity Classes) Let f : N → N be a function. Then the class SPACE ( f ( n ) ) is the set of all problems that can be solved by deterministic Turing Machines with space complexity O ( f ( n ) ) , and the class NSPACE ( f ( n ) ) is the set of all problems that can be solved by nonde- terministic Turing Machines with space complexity O ( f ( n ) ) . 2 Space Complexity Analysis To analyze the space complexity of Turing Machines, we use the same tech- niques introduced in the chapter about time complexity: Counting of tape cells and asymptotic analysis using the big-O notation. As an example, let us reconsider the satisfiability problem for boolean formulas and analyze its space complexity. To recall, the algorithm to decide SAT is as follows: Algorithm SAT On input h φ i , 1. Create all possible assignments of the variables of φ to the values true/false....
View Full Document

This note was uploaded on 05/20/2010 for the course ECS 120 taught by Professor Filkov during the Spring '07 term at UC Davis.

Page1 / 6

LectureNotes26 - ECS 120 Lesson 26 – Space Complexity...

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

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