Question

Approximate how large of a problem instance you need before algorithm A is faster than algorithm...

Approximate how large of a problem instance you need before algorithm A is faster than algorithm B? How much time does the algorithm take on that instance?

Algorithm A takes n(n + 10) hours to solve a problem of size n

Algorithm B takes n^3 seconds on the same problem

Homework Answers

Answer #1

Hey here is answer to your question.

SO as per given question

Algo A takes n(n+10) hours means n(n+10)*3600 seconds.

Algo B takes n^3 seconds.

if we start comparing that till which point algo B is good means n^3 <  n(n+10)*3600 so we get that

till the size of n < 3609 algo B will take less time
but right on n = 3610 and futher algo A will become better in case of time taken.

there is not much calculation just comaping both expression to compare at which point one takes over another.

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
Suppose you implemented a quadratic time (that is an O(n^2) algorithm for a problem P. On...
Suppose you implemented a quadratic time (that is an O(n^2) algorithm for a problem P. On a test run, your algorithm takes 50 seconds on inputs of size 1000. Your friend found a clever algorithm which solves the same problem with a running time O(n^(3/2)). However, the faster algorithm takes 150 seconds on inputs of size 1000. How could this be? If you need to solve a problem of size 4000, which algorithm you should use? What about inputs of...
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...
A systems analyst tests a new algorithm designed to work faster than the currently-used algorithm. Each...
A systems analyst tests a new algorithm designed to work faster than the currently-used algorithm. Each algorithm is applied to a group of 49 sample problems. The new algorithm completes the sample problems with a mean time of 19.11 hours. The current algorithm completes the sample problems with a mean time of 21.00 hours. The standard deviation is found to be 5.896 hours for the new algorithm, and 3.674 hours for the current algorithm. Conduct a hypothesis test at the...
A systems analyst tests a new algorithm designed to work faster than the currently-used algorithm. Each...
A systems analyst tests a new algorithm designed to work faster than the currently-used algorithm. Each algorithm is applied to a group of 44 sample problems. The new algorithm completes the sample problems with a mean time of 14.97 hours. The current algorithm completes the sample problems with a mean time of 17.81 hours. The standard deviation is found to be 4.448 hours for the new algorithm, and 3.520 hours for the current algorithm. Conduct a hypothesis test at the...
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. Suppose you are given 3 algorithms A1, A2 and A3 solving the same problem. You...
1. Suppose you are given 3 algorithms A1, A2 and A3 solving the same problem. You know that in the worst case the running times are T1(n) = (10^4)n, T2(n) = 10n , T3(n) = (10^3)(n^3) log10 n (a) Which algorithm is the fastest for very large inputs? Which algorithm is the slowest for very large inputs? (Justify your answer.) (b) For which problem sizes is A1 the best algorithm to use (out of the three)? Answer the same question...
How to measure the time complexity of an algorithm? Identify an important operation in the algorithm...
How to measure the time complexity of an algorithm? Identify an important operation in the algorithm that is executed most frequently. Express the number of times it is executed as a function of N. Convert this expression into the Big-O notation. A. For each of the three fragments of code, what is its worst-case time complexity, in the form "O(…)". (Use the given solution to the first problem as a model)                 //----------------- This is a sample problem – solved ------...
You are an algorithm designer and you came up with four different divide-and-conquer algorithms for some...
You are an algorithm designer and you came up with four different divide-and-conquer algorithms for some problem Q. Those four algorithms are described below in parts (1), (2), (3), and (4). You wrote those descriptions a long time ago so now you want to remind yourself, for each one of them, what was the corresponding recurrence relation and provide an upper bound on the running time. So first give the recurrence then solve it using any method of your choice...
The time taken for healthy Canadian adults to complete a logic problem is believed to have...
The time taken for healthy Canadian adults to complete a logic problem is believed to have a mean 40 seconds. It is of interest to investigate whether UBC students perform better on average than healthy adult Canadians, so the logic problem is given to a sample of 80 UBC students, and their times to solution are recorded. The sample mean and standard deviation are 36 seconds and 17 seconds. Part a) What is/are the parameters of interest relevant to this...
In a particular week, a human resource officer at a large company is given the assignment...
In a particular week, a human resource officer at a large company is given the assignment of phoneinterviewing 36 candidates for a job opening. Suppose a randomly selected phone-interview takes an average of µ = 25 minutes with standard deviation σ = 5 minutes. (a) Find the approximate probability that the average time of these 36 interviews will take more than 25 minutes. (10 pts.) (b) Find the approximate probability that the total time of these 36 interviews will take...