Assigned: | Thursday, November 3 |
Due: | Tuesday, November 8 at the beginning of class |
Exercises are from Sipser, third edition, beginning on page page 239 for Chapter 5 and on page 322 for Chapter 7.
Here is a definition of a function that decides whether an integer x ≥ 2 is prime.
prime(x) for i = 2,...,x-1 do if i is a factor of x return false end if end for return true
Is that a polynomial-time algorithm to determine if an integer x > 2 is prime?
Can you conclude that the set of prime numbers is in P based solely on that algorithm?
Can you conclude that the set of prime numbers is not in P based solely on that algorithm?
Is P closed under union? Justify your answer.