Question: We can test for primes in something like time O ( log ( n ) 1 2 ) . Assume, perhaps unrealistically for anything but

We can test for primes in something like time O(log(n)
12). Assume, perhaps unrealistically for anything but the RAM model, that we can compute 2
n 1 for any n in
time O(log(n)). Assume f_0(n) takes time O(n
24). Consider the following algorithm,
which takes a positive integer as input:
1 def function(n):
2 if is_prime(2**n -1):
3 return f_0(n)
What is the best upper and lower bound you can give on the asymptotic runtime of
the above algorithm,
(a) assuming LPWC is true? (Use O,,\Theta as appropriate.)
(b) assuming LPWC is false? (Use O,,\Theta as appropriate.)
(c) assuming LPWC remains unknown? (Use O,,\Theta as appropriate.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!