-- Apr 20 In-Class Exercise Thread
Let COMPOSITE be the set of binary strings x which when viewed as a natural number are evenly divisible by some other natural number >1
We say a language L belongs to NP if there exists a two input polynomial-time algorithm A and a constant c such that
L={xβ{0,1}β:βy,β£β£yβ£β£=O(β£β£xβ£β£c) and A(x,y)=1}
A (n,x) can be given as
L = { <n,x> | n%x ==0}
So for composite we get that n is a composite number and A( n,x) = 1 ,
we can also argue that using a the grade school division algorithm this can be obtained within polynomial time. So Composite is in NP.
Let COMPOSITE be the set of binary strings x which when viewed as a natural number are evenly divisible by some other natural number >1
We say a language L belongs to NP if there exists a two input polynomial-time algorithm A and a constant c such that
L={xβ{0,1}β:βy,β£β£yβ£β£=O(β£β£xβ£β£c) and A(x,y)=1}
A (n,x) can be given as
L = { <n,x> | n%x ==0}
So for composite we get that n is a composite number and A( n,x) = 1 ,
we can also argue that using a the grade school division algorithm this can be obtained within polynomial time. So Composite is in NP.