1. let f(n) = 2 and g(n) = n. Asymptotically, which one grows faster? Prove it....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. let f(n) = 2 and g(n) = n. Asymptotically, which one grows faster? Prove it. 2. Use induction to prove that the following equation is true for every positive integer n. Show all three steps. 3. Given the following code: a and b are integers k (k + 1) = k=1 n is the size of the input basic op is a basic operation myfun (a, b) { if (a == b) { n(n + 1)(n+2) 3 for (x 1 to n+n) basic op; for (x 1 to n*n) basic op; } else { for (x = 1 to 10) for (y = 1 to x) basic op; } } a) What is the worst case running time, i.e., f(n)=0(?) Show your work/calculation for determining this? b) What is the best case running time, i.e., f(n) = 2 (?) Show your work/calculation for determining this? c) Can we describe the average case running time, i.e., f(n) = (?)? If yes, what is it? If no, explain why you can't. 1. let f(n) = 2 and g(n) = n. Asymptotically, which one grows faster? Prove it. 2. Use induction to prove that the following equation is true for every positive integer n. Show all three steps. 3. Given the following code: a and b are integers k (k + 1) = k=1 n is the size of the input basic op is a basic operation myfun (a, b) { if (a == b) { n(n + 1)(n+2) 3 for (x 1 to n+n) basic op; for (x 1 to n*n) basic op; } else { for (x = 1 to 10) for (y = 1 to x) basic op; } } a) What is the worst case running time, i.e., f(n)=0(?) Show your work/calculation for determining this? b) What is the best case running time, i.e., f(n) = 2 (?) Show your work/calculation for determining this? c) Can we describe the average case running time, i.e., f(n) = (?)? If yes, what is it? If no, explain why you can't.
Expert Answer:
Answer rating: 100% (QA)
1 To determine which function grows faster asymptotically we need to compare their growth rates as n approaches infinity In this case we are comparing ... View the full answer
Related Book For
College Algebra
ISBN: 978-0134697024
12th edition
Authors: Margaret L. Lial, John Hornsby, David I. Schneider, Callie Daniels
Posted Date:
Students also viewed these programming questions
-
Suppose we are interested in bidding on a piece of land and we know one other bidder is interested. The seller announced that the highest bid in excess of $9,900 will be accepted. Assume that the...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Were Napoleon's territorial ambitions significantly different from pre-1799 conquests? If so, where?What were Napoleon's most significant domestic accomplishments in France? Consider the interesting...
-
The [Co(en)3]3+ ion has a yellow color, but the [CoF6]3 ion has a blue color. Is the shift from yellow to blue expected when ethylenediamine ligands are replaced by F ligands? Explain.
-
For the government to be a holder, which method must have been used to transfer the instrument from the bank to the government? Robert Durbin, a student, borrowed funds from a bank for his education...
-
Consider the daily log returns of GE stock from July 3, 1962 to December 31, 1999. The data can be obtained from CRSP or the file "d-geln.dat." Suppose that you hold a long position on the stock...
-
Use Pareto analysis to investigate the following data collected on a printed-circuit-board assembly line: Number of Defect Defect Occurrences Components not adhering............ 143...
-
Find the future value of the following ordinary annuities 2.) a.) $400 per year for 10 years at 10% b.) $200 per year for 5 years at 5% c.) $400 per year for 5 years at 3%
-
A B D E F G H 1 2 Player Company acquired 60 percent ownership of Scout Company's voting shares on January 1, 20X2. During 20X5, Player purchased inventory for $20,000 and sold the full amount to...
-
2.1.1 12 13 14 15 16 17 18 1 .91 10 111 112 113 14 15 MULTIPLE CHOICE. Please highlight your answer. 1) Materiality and risk are A) reasonable concepts in planning the audit and designing an audit...
-
Your uncle offers to sell you his vintage Rolls Royce. He suggests a payment plan where you pay just $12,000 today, $7100 in 8 months and $100,000 in exactly 23 months from today. If the interest...
-
In your career, you have worked with various clients including large corporations, and private citizens and have also taken on more pro bono cases than you have commercial ones. In practice, you are...
-
You were testing 300 units of a product using accelerated life testing equivalent to 2,000 hours of normal use. One of your units failed after 500 hours, another after 1,000 hours, and another after...
-
A solid circular titanium alloy rod with a length of 2.5 meters and a shear modulus of 45 GPa must have adequate resistance to a torque of 3 kN-m without twisting more than 5 or exceeding a shear...
-
Apply what you have learned in this module about AFCS and Heli SAS. Compare and contrast the applicability of these particular systems to light, medium, and heavy-lift helicopters. Does one size fit...
-
18. Cul de los siguientes debe tener un auditorindependiente?A. Experiencia en muchas disciplinas diferentesB. Capacitacin tcnica adecuada para cumplir con los requisitosde un profesional 1 answer
-
Draw two scatterplots, one for which r = 1 and a second for which r = 21.
-
Identify cost behavior (Learning Objective 1) The chart below shows three different costs: Cost A, Cost B, and Cost C. For each cost, the chart shows the total cost and cost per unit at two different...
-
Classify cost behavior (Learning Objective 3)} Ariel builds innovative loudspeakers for music and home theater. Identify the following costs as variable or fixed: a. Depreciation on equipment used to...
-
Predict and graph total mixed costs (Learning Objectives 1, 2) Suppose World-Link offers an international calling plan that charges \(\$ 5.00\) per month plus \(\$ 0.35\) per minute for calls outside...
Study smarter with the SolutionInn App