Space comlexity Flashcards
Define the space complexity model
Let M : haltm
the space complexity of M is measured by a function
F : N –> N
where f(n) returns the maximal number of tape cells used
for an input n
1: define space(f(n))
2: define Nspace(f(n))
1 : { L | L is a language decided by an O(f(n)) space DTM }
2 : { L | L is a language decided by an O(f(n)) space NDTM }
how to solve All NFA
input : A ==> NFA
question : L(A) = Σ* (does there exist a run)
classical solution:
L(A) = Σ* iff ¬L(A) = ∅
∀ f(n) >= n then NPspace (0(f(n))) = Pspace (0(f2(n)))
Nspace = Pspace
can be proved through the yieldability problem
what is psapce completness
B is pspace complete
is B in Pspace
every problem A is Pspace we can
A <=p B
what is savitch theorem
NDTM can simulate DTM in f^2(n)
space(f(n)) ⊆ Nspace(f(n)) , for All n-> R+ | f(n) >= n
By relying on the Yieldability problem :
checking whether c1 yields to c2 in t steps
where c1 : initial state
c2: accept state
let N be a turning machine, deciding a language in space f(n) , m is a middle configuration
CANYIELD= on input c1 ,c2 , t steps
if t == 1 then chacking whether c1 yields to c2
if t2 >1 , let cm of N deciding w in f(n) space
run CANYIELDS(c1 , cm , t/2)
run CANYIELDS(cm, c2 , t/2)
if accept then accept
else reject
M =on Input w run CANYIELD(c1, c2 , 2^df(n)) D is the number of configuration
prove Savitch theorem
the naive way is to simulate f(n) on each branch and keeping track of branches solving it using yieldability problem C1 is the start config c2 is the accept config is the max number of steps
what is yieldability problem
Given two configs c1 c2 and checking whether C1 can go to c2 in t steps
it operates, such that, it searches for an intermediate config Cm with t/2 step sand checking:
C1 –> Cm in t/2 step
Cm -> Caccept in t/2
space is reused for each
can sat be solved in a linear time
on the Input < Φ >, where Φ is a boolean formula
for each truth assignment to the variables x1…xm
evaluate Φ
if Φ is true accept else, reject
that clearly shows that the SAT problem has linear space since the tap can be reused on each evaluation
CAn ALL nfa be solved on a linear space
N = on the input where M is ALLnfa
put the marker on the initial state of M
repeat 2^q of M where is the number of M’s states
nondeterministically choose input and update
the market position
if at some point the marker lies on the accepted state of M then accept else reject
what is the issue that can arise with CANYIELD of Savitch theorem?
the issue is the fact the f(n) should know the value of f((n), this can be fixed by setting up the value f(n) = 1,2,3,…. for each I
What is the PSACE class
It is the class of languages that are decided by DTM in polynomial space
what is Pspace complete
A problem B is called Pspace complete :
if B is in Psapce
every A ∈ Pspace , A <=p B
why is it important to solve a complete problem
because solving a complete problem allows solving all the problems in the class because a complete problem can be easily reduced to other problems
explain TQBF problem (Turing quantified boolean formula )
TQBF { | Q is a fully quantified boolean formula that can either be true or false }
Example of fully qualified boolean formula:
∀ x ∃y [(X ∨ y )⋀(X ∨ y )]