SlideShare a Scribd company logo
1 of 42
P, NP, PS, and NPS
By Muhannad Harrim
Class P
 P is the complexity class containing decision problems which
can be solved by a Deterministic Turing machine (DTM) using a
polynomial amount of computation time, or polynomial time.
 P is often taken to be the class of computational problems
which are "efficiently solvable" or "tractable“.
 But P also contains problems which are intractable in practical
terms; for example, some require at least n¹ºººººº operations
Deterministic Turing machine (DTM)
DTM is:
 A Turing machine model (basic symbol-manipulating
device which, despite its simplicity, can be adapted
to simulate the logic of any computer).
 Consists of a finite state control, a read/write head,
and a tape made up of a two-way infinite sequence
of tape squares (or cells).
Deterministic Turing machine (DTM)
Deterministic Turing machine (DTM)
 Hopcroft and Ullman define a one-tape Turing
machine formula: M=(Q, Γ, b, ∑, δ, qo, F) where:
 Q is a finite set of states
 Γ is a finite set of the tape alphabet/symbols
 b is the blank symbol (the only symbol allowed to occur on the tape
infinitely often at any step during the computation) - Delimiter
 Σ, a subset of Γ not including b is the set of input symbols
 δ = Q x Γ  Q x Γ x {L,R} is a partial function called the transition
function, where L is left shift, R is right shift.
 qo is the initial state
 F is the set of final or accepting states
Deterministic Turing machine (DTM)
 A DTM program M with alphabet ∑ accepts
any x: x є ∑* iff M halts in the acceptance
final state (qY) when applied input x.
 The language LM recognized by the
program M as the following:
LM = { x є ∑* : M accepts x }
Class P & DTM
A formal definition for Class P with respect to
DTM would be given as follows:
P = { L: there is a polynomial time DTM
program M for which L = LM }
Class P & DTM
Conclusion:
A decision problem π belongs to P under the
encoding scheme e if L(π, e) belongs to P,
that is if there is a polynomial time DTM that
solves π under encoding scheme e.
Class NP
The class NP is defined informally to be the class of
all decision problems π which, under reasonable
encoding schemes, can be solved “verified” by
polynomial time using Non-Deterministic Turing
machines (NDTM).
- Polynomial time verifiability doesn’t imply
polynomial time solvability.
Nondeterministic Turing machine
(NDTM)
NDTM model has exactly the same structure
of DTM except it’s featured with a guessing
module that has its own write only head.
The guessing module’s main purpose is
providing the means for writing down the
“guess” into the tape.
Nondeterministic Turing machine
(NDTM)
Nondeterministic Turing machine
(NDTM)
NDTM is also specified exactly the same way
as DTM with respect to tape alphabet, input
alphabet, blank symbol, states set, initial and
final states, and the transition function.
However, It differs from DTM in the
computation process, where in NDTM it
takes two stages: the guessing and the
checking.
Nondeterministic Turing machine
(NDTM)
If NDTM program stops at a qY then, then the
computation is considered as an accepting
computation.
Otherwise, All other computations (halting or
not) are considered to be a non-accepting
computation.
Nondeterministic Turing machine
(NDTM)
Also, a NDTM will have an infinite number of
possible computations for a given input
string x.
NDTM accepts x iff at least one of the
possible structures (computations) is an
accepting one.
LM = { x є ∑* : M accepts x }
Class NP and NDTM
A formal definition for Class NP in respect to
NDTM :
NP = { L : there is a polynomial time NDTM
program M for which LM = L }
Class NP and NDTM
Conclusion :
A decision problem π belongs to NP under
the encoding scheme e if L(π, e) belongs to
NP, that is if there is a polynomial time NDTM
that “solves” (verifies) π under encoding
scheme e.
Class P and Class NP
Class P and Class NP
A controversial question:
Is P = NP ?
Polynomial Space (PS)
 The emphasis on the computation resources
is usually on the time used to perform the
computation process (especially when
measuring a performance issue or
complexity).
 However, the amount of space required is
often just as important ( called the space
requirement ).
Polynomial Space (PS)
In any Turing machine:
– the time used is the number of steps taken before
halting or entering a final state.
– The space required is defined as the number of
distinct tape squares (cells) “visited” by the
read/write head.
Polynomial Space (PS)
Proof
Since the time taken to visit all cells < = the time used, then
the number of cells visited < = the time used.
 the number of cells visited cannot be more than the steps of
computation
This implies:
Any Polynomial Solvable in polynomial time, It’s
solvable in polynomial space.
Polynomial Space (PS)
Although all problems solvable in polynomial
time can be solved in polynomial space, it is
still a controversial and unresolved question
whether there exist problems solvable in
polynomial space which cannot be solved in
polynomial time.
- This is so difficult to conclude since all problems in NP,
including P and NP-C problems are solved in both polynomial
space and polynomial time.
Polynomial Space (PS)
 PS
is the class of all languages recognizable by
polynomial space bounded DTM that halts
on all inputs.
i.e. All and Only the languages that are LM
for some polynomial space bounded DTM M.
Nondeterministic Polynomial Space
(NPS)
 NPS
is the class of all languages recognizable by
polynomial space bounded NDTM that halts
on at least one of the possible input
structures.
i.e. All and Only the languages that are LM
for some polynomial space
bounded NDTM M.
PS and NPS
Evidently, PS є NPS, since every DTM is
technically NDTM.
However, The surprising result is that:
PS = NPS
PS and NPS
Theorem
If M is a polynomial-space bounded TM
(deterministic or nondeterministic), and p(n)
is its polynomial space bound, then there is a
constant c such that if M accepts its input w
of length n, it does so within c1 + p(n) moves
PS and NPS
Proof
The essential idea is that M must repeat an ID (cell index) before
making more than c1 + p(n) moves
Having a constant c implies that there is a limited number of ID’s if
already there is a limited space used in the TM.
Let t be the number of tape symbols of M
Let s be the number of states of M
Then the number of different ID’s of M when only p(n) tape cells are
visited is at most s x p(n) x t p(n)
PS and NPS
if c = t + s, then the binomial expansion of
(t + s)1 + p(n) is t1+ p(n) + (1 + p(n)) s t p(n) + …
In the expression, notice that the underlined
term is at least as large as s p(n) t p(n)
This proves that c1 + p(n) is at least equal to
the number of possible ID’s of M
PS and NPS
M accepts w of length n with sequence of
moves that doesn’t repeat any ID
So  M accepts inputs by a sequence of
moves that is less or equal to the number of
distinct ID’s, which is c1 + p(n)
PS and NPS
Savitch’s Theorem
PS = NPS
PS and NPS
To be more accurate
Savitch’s Theorem states that any
p(n)-space NDTM can be converted to a
p2(n)-space DTM
one of the earliest results on space complexity
PS and NPS
Proof
The core of the proof lies on simulating a
NDTM that has a polynomial space bound
p(n) into a DTM with polynomial space bound
of complexity O( p2(n) )
PS and NPS
This is done through a recursive program that
tries to test whether a NDTM N can move
from ID I to ID J in at most m moves
Let’s have a function called reach(I, J, m)
that decides if I can yield to J in m moves
PS and NPS
PS and NPS
PS and NPS
Assumptions
– If NDTM N accepts, it does it within c1 + p(n) steps
– Given input w of length n
– DTM D discovers what N does with input w by
calling the function reach(I0,J,m) recursively where:
 I0 is the initial ID of N with input w
 J is any accepting ID that uses at most p(n) tape cells
 m = c1 + p(n)
PS and NPS
the recursive function imposes that there will never be
more than log2 m recursive calls that are active
simultaneously
i.e one with m/2, one with m/4, … , down to 1
 So, the upper bound of the number of stack
frames is no more than log2(m) on the stack
 log2(m) is O( p(n) )
PS and NPS
 So, D contains at most log2(m) stack frames = (O( pn ))
 The stack frames themselves require log2(m) space,
the reason is that the two ID’s each require only 1+p(n)
cells to write down m, and m in binary requires log2
c1 + p(n)  log2(m) = (O( pn ))
 The total space required in D to simulate N is
log2
2(m)  which is also O( p2(n) )
PS and NPS
 The space bound of complexity O( p2(n) ) is
polynomial iff p(n) is polynomial
 p(n) is polynomial
 Then there is a polynomial space bound
DTM that corresponds to a polynomial space
bound NDTM
PS and NPS
 So, after all:
PS = NPS
PS and NPS
At the End, we conclude that:
PS and NPS

More Related Content

Similar to P-NP-and-the-Polynomial-Space.ppt

2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
vafopoulos
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
chidabdu
 
Marcov chains and simple queue ch 1
Marcov chains and simple queue ch 1Marcov chains and simple queue ch 1
Marcov chains and simple queue ch 1
Guru Nathan
 

Similar to P-NP-and-the-Polynomial-Space.ppt (20)

2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練
 
QB104545.pdf
QB104545.pdfQB104545.pdf
QB104545.pdf
 
9. chapter 8 np hard and np complete problems
9. chapter 8   np hard and np complete problems9. chapter 8   np hard and np complete problems
9. chapter 8 np hard and np complete problems
 
Fractal Dimension of Space-time Diagrams and the Runtime Complexity of Small ...
Fractal Dimension of Space-time Diagrams and the Runtime Complexity of Small ...Fractal Dimension of Space-time Diagrams and the Runtime Complexity of Small ...
Fractal Dimension of Space-time Diagrams and the Runtime Complexity of Small ...
 
Teori pnp
Teori pnpTeori pnp
Teori pnp
 
Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5
 
lect5-1.ppt
lect5-1.pptlect5-1.ppt
lect5-1.ppt
 
Basic_concepts_NP_Hard_NP_Complete.pdf
Basic_concepts_NP_Hard_NP_Complete.pdfBasic_concepts_NP_Hard_NP_Complete.pdf
Basic_concepts_NP_Hard_NP_Complete.pdf
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
 
practice-final-soln.pdf
practice-final-soln.pdfpractice-final-soln.pdf
practice-final-soln.pdf
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 3
Unit 3Unit 3
Unit 3
 
Np completeness h4
Np completeness  h4Np completeness  h4
Np completeness h4
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 
class23.ppt
class23.pptclass23.ppt
class23.ppt
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
 
Marcov chains and simple queue ch 1
Marcov chains and simple queue ch 1Marcov chains and simple queue ch 1
Marcov chains and simple queue ch 1
 
Introducción al Análisis y diseño de algoritmos
Introducción al Análisis y diseño de algoritmosIntroducción al Análisis y diseño de algoritmos
Introducción al Análisis y diseño de algoritmos
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
 
Alg1
Alg1Alg1
Alg1
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Recently uploaded (20)

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 

P-NP-and-the-Polynomial-Space.ppt

  • 1. P, NP, PS, and NPS By Muhannad Harrim
  • 2. Class P  P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine (DTM) using a polynomial amount of computation time, or polynomial time.  P is often taken to be the class of computational problems which are "efficiently solvable" or "tractable“.  But P also contains problems which are intractable in practical terms; for example, some require at least n¹ºººººº operations
  • 3. Deterministic Turing machine (DTM) DTM is:  A Turing machine model (basic symbol-manipulating device which, despite its simplicity, can be adapted to simulate the logic of any computer).  Consists of a finite state control, a read/write head, and a tape made up of a two-way infinite sequence of tape squares (or cells).
  • 5. Deterministic Turing machine (DTM)  Hopcroft and Ullman define a one-tape Turing machine formula: M=(Q, Γ, b, ∑, δ, qo, F) where:  Q is a finite set of states  Γ is a finite set of the tape alphabet/symbols  b is the blank symbol (the only symbol allowed to occur on the tape infinitely often at any step during the computation) - Delimiter  Σ, a subset of Γ not including b is the set of input symbols  δ = Q x Γ  Q x Γ x {L,R} is a partial function called the transition function, where L is left shift, R is right shift.  qo is the initial state  F is the set of final or accepting states
  • 6. Deterministic Turing machine (DTM)  A DTM program M with alphabet ∑ accepts any x: x є ∑* iff M halts in the acceptance final state (qY) when applied input x.  The language LM recognized by the program M as the following: LM = { x є ∑* : M accepts x }
  • 7. Class P & DTM A formal definition for Class P with respect to DTM would be given as follows: P = { L: there is a polynomial time DTM program M for which L = LM }
  • 8. Class P & DTM Conclusion: A decision problem π belongs to P under the encoding scheme e if L(π, e) belongs to P, that is if there is a polynomial time DTM that solves π under encoding scheme e.
  • 9. Class NP The class NP is defined informally to be the class of all decision problems π which, under reasonable encoding schemes, can be solved “verified” by polynomial time using Non-Deterministic Turing machines (NDTM). - Polynomial time verifiability doesn’t imply polynomial time solvability.
  • 10. Nondeterministic Turing machine (NDTM) NDTM model has exactly the same structure of DTM except it’s featured with a guessing module that has its own write only head. The guessing module’s main purpose is providing the means for writing down the “guess” into the tape.
  • 12. Nondeterministic Turing machine (NDTM) NDTM is also specified exactly the same way as DTM with respect to tape alphabet, input alphabet, blank symbol, states set, initial and final states, and the transition function. However, It differs from DTM in the computation process, where in NDTM it takes two stages: the guessing and the checking.
  • 13. Nondeterministic Turing machine (NDTM) If NDTM program stops at a qY then, then the computation is considered as an accepting computation. Otherwise, All other computations (halting or not) are considered to be a non-accepting computation.
  • 14. Nondeterministic Turing machine (NDTM) Also, a NDTM will have an infinite number of possible computations for a given input string x. NDTM accepts x iff at least one of the possible structures (computations) is an accepting one. LM = { x є ∑* : M accepts x }
  • 15. Class NP and NDTM A formal definition for Class NP in respect to NDTM : NP = { L : there is a polynomial time NDTM program M for which LM = L }
  • 16. Class NP and NDTM Conclusion : A decision problem π belongs to NP under the encoding scheme e if L(π, e) belongs to NP, that is if there is a polynomial time NDTM that “solves” (verifies) π under encoding scheme e.
  • 17. Class P and Class NP
  • 18. Class P and Class NP A controversial question: Is P = NP ?
  • 19. Polynomial Space (PS)  The emphasis on the computation resources is usually on the time used to perform the computation process (especially when measuring a performance issue or complexity).  However, the amount of space required is often just as important ( called the space requirement ).
  • 20. Polynomial Space (PS) In any Turing machine: – the time used is the number of steps taken before halting or entering a final state. – The space required is defined as the number of distinct tape squares (cells) “visited” by the read/write head.
  • 21. Polynomial Space (PS) Proof Since the time taken to visit all cells < = the time used, then the number of cells visited < = the time used.  the number of cells visited cannot be more than the steps of computation This implies: Any Polynomial Solvable in polynomial time, It’s solvable in polynomial space.
  • 22. Polynomial Space (PS) Although all problems solvable in polynomial time can be solved in polynomial space, it is still a controversial and unresolved question whether there exist problems solvable in polynomial space which cannot be solved in polynomial time. - This is so difficult to conclude since all problems in NP, including P and NP-C problems are solved in both polynomial space and polynomial time.
  • 23. Polynomial Space (PS)  PS is the class of all languages recognizable by polynomial space bounded DTM that halts on all inputs. i.e. All and Only the languages that are LM for some polynomial space bounded DTM M.
  • 24. Nondeterministic Polynomial Space (NPS)  NPS is the class of all languages recognizable by polynomial space bounded NDTM that halts on at least one of the possible input structures. i.e. All and Only the languages that are LM for some polynomial space bounded NDTM M.
  • 25. PS and NPS Evidently, PS є NPS, since every DTM is technically NDTM. However, The surprising result is that: PS = NPS
  • 26. PS and NPS Theorem If M is a polynomial-space bounded TM (deterministic or nondeterministic), and p(n) is its polynomial space bound, then there is a constant c such that if M accepts its input w of length n, it does so within c1 + p(n) moves
  • 27. PS and NPS Proof The essential idea is that M must repeat an ID (cell index) before making more than c1 + p(n) moves Having a constant c implies that there is a limited number of ID’s if already there is a limited space used in the TM. Let t be the number of tape symbols of M Let s be the number of states of M Then the number of different ID’s of M when only p(n) tape cells are visited is at most s x p(n) x t p(n)
  • 28. PS and NPS if c = t + s, then the binomial expansion of (t + s)1 + p(n) is t1+ p(n) + (1 + p(n)) s t p(n) + … In the expression, notice that the underlined term is at least as large as s p(n) t p(n) This proves that c1 + p(n) is at least equal to the number of possible ID’s of M
  • 29. PS and NPS M accepts w of length n with sequence of moves that doesn’t repeat any ID So  M accepts inputs by a sequence of moves that is less or equal to the number of distinct ID’s, which is c1 + p(n)
  • 30. PS and NPS Savitch’s Theorem PS = NPS
  • 31. PS and NPS To be more accurate Savitch’s Theorem states that any p(n)-space NDTM can be converted to a p2(n)-space DTM one of the earliest results on space complexity
  • 32. PS and NPS Proof The core of the proof lies on simulating a NDTM that has a polynomial space bound p(n) into a DTM with polynomial space bound of complexity O( p2(n) )
  • 33. PS and NPS This is done through a recursive program that tries to test whether a NDTM N can move from ID I to ID J in at most m moves Let’s have a function called reach(I, J, m) that decides if I can yield to J in m moves
  • 36. PS and NPS Assumptions – If NDTM N accepts, it does it within c1 + p(n) steps – Given input w of length n – DTM D discovers what N does with input w by calling the function reach(I0,J,m) recursively where:  I0 is the initial ID of N with input w  J is any accepting ID that uses at most p(n) tape cells  m = c1 + p(n)
  • 37. PS and NPS the recursive function imposes that there will never be more than log2 m recursive calls that are active simultaneously i.e one with m/2, one with m/4, … , down to 1  So, the upper bound of the number of stack frames is no more than log2(m) on the stack  log2(m) is O( p(n) )
  • 38. PS and NPS  So, D contains at most log2(m) stack frames = (O( pn ))  The stack frames themselves require log2(m) space, the reason is that the two ID’s each require only 1+p(n) cells to write down m, and m in binary requires log2 c1 + p(n)  log2(m) = (O( pn ))  The total space required in D to simulate N is log2 2(m)  which is also O( p2(n) )
  • 39. PS and NPS  The space bound of complexity O( p2(n) ) is polynomial iff p(n) is polynomial  p(n) is polynomial  Then there is a polynomial space bound DTM that corresponds to a polynomial space bound NDTM
  • 40. PS and NPS  So, after all: PS = NPS
  • 41. PS and NPS At the End, we conclude that: