Question

a) Suppose that a particular algorithm has time complexity T(n) = 3 x 2^n, and that...

a) Suppose that a particular algorithm has time complexity T(n) = 3 x 2^n, and that executing an implementation of it on a particular machine takes t seconds for n inputs. Now suppose that we are presented with a machine that is 64 times as fast. How many inputs could we process on the new machine in t seconds?

b) Suppose that another algorithm has time complexity T(n) = n^2, and that executing an implementation of it on a particular machine takes t seconds for n inputs. Now suppose that we are presented with a machine that is 64 times as fast. How many inputs could we process on the new machine in t seconds?

c) A third algorithm has time complexity T(n) = 8n. Executing an implementation of it on a particular machine takes t seconds for n inputs. Given a new machine that is 64 times as fast, how many inputs could we process on the new machine in t seconds?

Homework Answers

Answer #1

The key to working these problems is observing that the runtime T tells you roughly the
number of instructions executed. For example, suppose T = 1000 seconds and the old machine
will execute 106 instructions/second. Then in T seconds, the old machine will execute 106 ×103 = 109
instructions, and the new machine will execute 64 × 109 instructions. Thus, in
any given period of time the new machine will do 64 times as much work as the old machine.
Hence, if Told(n) is the runtime of a program on the old machine, its runtime will be

Tnew(n) = 1/64*Told(n)
  
A). We have Tnew(n) = 3 · 2n, and Told(n0) = T. We want to know for what value of n = n1
will we have Tnew(n1) = T. Using our formulas, we have
3 · 2n0 =1/64*3 · 2n1
.
So
64 · 2n0 = 2n1
,
and since 64 = 26
, we have
26+n0 = 2n1
.
Thus, n1 = 6 + n0. If, for example, we could previously solve a problem of size 100, we
can now solve a problem of size 106.

B).  Using reasoning similar to that in part (a),

we have n02 = 1/64 *n12 . So n02 =n12 , and 8n0 = n1. So we can

solve a problem 8 times larger on the new machine.

C). ) Reasoning as in part (a) again, we have 8n0 = 1/64 *8n1, and 64n0 = n1.

So we can solve a problem 64 times larger on the new machine.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
   1)T(n) = 27 T (n/3) + n3 2)Calculate the running time for the following code...
   1)T(n) = 27 T (n/3) + n3 2)Calculate the running time for the following code fragment. Algorithm test int counter, i, j; counter := 0; for (i:= 1; i < n; i*=2) { for (j:= 0; j < i; j++) { counter := counter +1 } } 3)Let f(n) = 2lg 8n + 3 be a function.
An exponential algorithm requires 4^n (four to the power n) steps to solve a problem with...
An exponential algorithm requires 4^n (four to the power n) steps to solve a problem with an input of size n. Suppose it has been found that using today's computer, a direct implementation of that algorithm would be able to handle an input size of 30 in 10 years. If the computer is speeded up by a factor of 100 (with no other changes), what input size can be processed in the same time? Explain your answer. (Hint: speeding up...
1. Given an n-element array A, Algorithm X executes an O(n)-time computation for each even number...
1. Given an n-element array A, Algorithm X executes an O(n)-time computation for each even number in A and an O(log n)-time computation for each odd number in A. What is the best-case running time of Algorithm X? What is the worst-case running time of Algorithm X? 2. Given an array, A, of n integers, give an O(n)-time algorithm that finds the longest subarray of A such that all the numbers in that subarray are in sorted order. Your algorithm...
discrete structures problems 1. A program P takes time proportional to logn where n is the...
discrete structures problems 1. A program P takes time proportional to logn where n is the input size. If the program takes 1 minute to process input of size 1,000,000, how many seconds does it take to process input of size 100? 2. When the best possible algorithm to solve a problem is exponential-time, or in general in nonpolynomial (not in O(np) for any p) we call such a problem ___________________. 3. f(x) is O(x 2) and g(x) is O(x...
1. For a particular operation, the setup time is 10 minutes and the run time is...
1. For a particular operation, the setup time is 10 minutes and the run time is 50 minutes to produce a standard lot of 40 parts. It takes three additional hours to circulate a container of parts after production is completed. The demand rate is 20,000 parts per month. There are 160 production hours in a month. a. How many standard containers are needed? n = D(T) / C Use the following inputs: Demand rate (D) = ________ parts /...
Suppose 50 people come to a fast food take-out restaurant each hour. There are four employees,...
Suppose 50 people come to a fast food take-out restaurant each hour. There are four employees, one at the register, two making the food, and one packaging the food. Suppose on average, each order takes 30 seconds at the register, and it takes one employee an average of 1.5 minutes to make the food, and it takes 1 minute on average to package the food. Assume exponential arrivals and service times. 1) How many people typically are waiting in line...
Mobile Security, Inc. (MSI) has been an audit client of Leo & Lee, LLP for the...
Mobile Security, Inc. (MSI) has been an audit client of Leo & Lee, LLP for the past 12 years. MSI is a small, publicly traded aviation company based in Cleveland, Ohio, where it manufactures high-tech unmanned aerial vehicles (UAV), also known as drones, and other surveillance and security equipment. MSI's products are primarily used by the military and scientific research institutions, but there is growing demand for UAVs for commercial and recreational use. MSI must go through an extensive bidding...
Suppose today is Dec 31st, 2020, and as always, today is time t=0. Prithu wants to...
Suppose today is Dec 31st, 2020, and as always, today is time t=0. Prithu wants to buy a $20 million yacht. The dealer is offering the following scheme. Pay $2 million as down payment today and borrow $18 million from the dealership at 18% per year and payoff the loan in 4 yearly installments, the first installment is due one year from now, meaning December 31, 2021. If he agrees to the scheme, he will receive the delivery of the...
Mobile Security, Inc. Mobile Security, Inc. (MSI) has been an audit client of Leo & Lee,...
Mobile Security, Inc. Mobile Security, Inc. (MSI) has been an audit client of Leo & Lee, LLP for the past 12 years. MSI is a small, publicly traded aviation company based in Cleveland, Ohio, where it manufactures high-tech unmanned aerial vehicles (UAV), also known as drones, and other surveillance and security equipment. MSI’s products are primarily used by the military and scientific research institutions, but there is growing demand for UAVs for commercial and recreational use. MSI must go through...
3D printing started in the early 1980s. There are many different processes and many different patents,...
3D printing started in the early 1980s. There are many different processes and many different patents, so it is difficult to say who actually invented it or first brought 3D printing to the market. Let’s suppose we could. Consider the first 3D printing company, which we’ll call 3DisUs, selling 3D printers to industries to use to create intricate plastic parts that might otherwise take much more money to create. A. Suppose 3DisUs commissioned a market research company to survey a...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT