-- Apr 20 In-Class Exercise Thread
The language L belongs to the complexity class P if
there exists an algorithm A such that
A(x) accepts for the language L
Otherwise A(x) rejects for the language L.
where X runs in polynomial time, ie, O(|X|^k)
We are trying to prove that:
L = { | n%x == 0} is in P
COMPOSITE = { | belongs to L}
A composite number represented as a binary string can be
divided by another number within polynomial time using the
grade school division algorithm. Since, at each iteration we process
a single digit further in the number x, it is about quadratic in time.
This means that COMPOSITE belongs to P.
Which implies COMPOSITE belongs to NP.
(
Edited: 2022-04-20)
<nowiki>
The language L belongs to the complexity class P if
there exists an algorithm A such that
A(x) accepts for the language L
Otherwise A(x) rejects for the language L.
where X runs in polynomial time, ie, O(|X|^k)
We are trying to prove that:
L = {<n, x> | n%x == 0} is in P
COMPOSITE = {<x, n> | <x, n> belongs to L}
A composite number represented as a binary string can be
divided by another number within polynomial time using the
grade school division algorithm. Since, at each iteration we process
a single digit further in the number x, it is about quadratic in time.
This means that COMPOSITE belongs to P.
Which implies COMPOSITE belongs to NP.
</nowiki>