Suppose the following pairs of functions f(n) and g(n) describe the number of operations that two...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Suppose the following pairs of functions f(n) and g(n) describe the number of operations that two different algorithms would use to perform the same task. For each pair: (a) describe each function with a tight big-O bound that it uses only terms and constants appro- priate for big-O notation (for example, f(n) = 3n² +n becomes f(n) = 0(n²)); (b) tell us which function is more desirable for a running time from a big-O perspective (or if they are the same, say so); (c) Using the unsimplified formulas for both f(n) and g(n), calculate the amount of time it would take to perform the algorithm on n 10000 inputs, if each operation took 1/1,000,000,000 of a sec- ond. (That would be a processor with a speed of 1 Gigahertz, or a billion operations per second-in the ballpark of modern processors, but a little slow.) Give your answer in seconds unless it would take at least a day, in which case, give your answer in days. (There are 86,400 seconds in a day.) You can leave answers in scientific notation as long as they have the correct units (seconds or days). Note that the Google search bar's calculator can handle all computations necessary for this problem, if you lack a calculator that can handle the numbers. i. f(n) = n°/2 g(n) = 2n? %3D ii. f(n) = 1.01"/1000 g(n) = 1000n2 %3D iii. f(n) = 5n g(n) = 4n %3D %3D Suppose the following pairs of functions f(n) and g(n) describe the number of operations that two different algorithms would use to perform the same task. For each pair: (a) describe each function with a tight big-O bound that it uses only terms and constants appro- priate for big-O notation (for example, f(n) = 3n² +n becomes f(n) = 0(n²)); (b) tell us which function is more desirable for a running time from a big-O perspective (or if they are the same, say so); (c) Using the unsimplified formulas for both f(n) and g(n), calculate the amount of time it would take to perform the algorithm on n 10000 inputs, if each operation took 1/1,000,000,000 of a sec- ond. (That would be a processor with a speed of 1 Gigahertz, or a billion operations per second-in the ballpark of modern processors, but a little slow.) Give your answer in seconds unless it would take at least a day, in which case, give your answer in days. (There are 86,400 seconds in a day.) You can leave answers in scientific notation as long as they have the correct units (seconds or days). Note that the Google search bar's calculator can handle all computations necessary for this problem, if you lack a calculator that can handle the numbers. i. f(n) = n°/2 g(n) = 2n? %3D ii. f(n) = 1.01"/1000 g(n) = 1000n2 %3D iii. f(n) = 5n g(n) = 4n %3D %3D
Expert Answer:
Answer rating: 100% (QA)
Time taken number of operations time taken by 1 operation ie 11000000000 seconds 1 fn n ... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
For each of the following pairs of functions f and g, give two possible forms for A that will allow the relation g(x) = A f(x) to be satisfied. (a) f = 2x4, g = 8x3; (b) f = 2x, g = x2; (c) f = x4, g...
-
Each of the following pairs of compounds undergoes a Bronsted acidbase reaction for which the equilibrium lies to the right. Give the products of each reaction, and identify the acid, the base, the...
-
Calculate the distance between the following pairs of points: (a) (2, 1, 5) and (6, 1, 2) (b) (3, /2, 1) and (5, 3 /2, 5) (c) (10, /4, 3/4) and (5, /6, 7/4).
-
There are three general methods of allocating overhead costs: plantwide rates, rates for each expense category, and departmental rates. Describe when each is the most useful.
-
Green Gooey Company is evaluating all of its internal control processes. Betty Webit, the controller, believes that overall the processes are fairly decent, but she is concerned that there is a lack...
-
The car has a mass of 1.50 Mg and a mass center at G. Determine the maximum acceleration it can have if power is supplied only to the rear wheels. Neglect the mass of the wheels in the calculation,...
-
A randomly oriented, short-fiber-reinforced composite plate having a central through-thickness crack of length \(2 a\) is subjected to a uniaxial stress \(\sigma\), as shown in Figure 9.1. If the...
-
1. Tell Carolyn Clark that employee volunteerism is important to the company and that while her performance evaluation will not be affected by her decision, she should consider helping Harris because...
-
Explain how advanced computational methods, such as Monte Carlo simulation and Bayesian networks, can be applied to improve hazard analysis accuracy and reduce uncertainty in risk assessment .
-
The proposed rates were not in the range the CEO expected given the pricing analysis. The CEO has asked the pricing actuary to verify the total projected loss cost excluding potential large storm...
-
The ACM (Association for Computer Machinery) has a created a list of commandments or moral values that computer professionals should have. The International Council of E-Commerce Consultants created...
-
Define global advertising and identify the top-ranked companies in terms of worldwide ad spending.
-
What are some of the effects of dumping on the country of origin?
-
List the major innovations and trends that contributed to the digital revolution.
-
Describe the three classifications that may be given to a new product or idea.
-
Explain the contingency factors that must be considered when making decisions about sales force nationality.
-
Two equal charges are situated on the x axis at 40.0 cm on either side of the origin as shown in the figure below. Location A is on the perpendicular bisector at a distance of 27.0 cm from the origin...
-
Below is a sample of the data in the file NFLAttendance which contains the 32 teams in the National Football League, their conference affiliation, their division, and their average home attendance....
-
The enzyme aconitase catalyzes the hydration of aconitic acid to two products: citric acid and isocitric acid. Isocitric acid is optically active; citric acid is not. What are the respective...
-
Identify the following compounds on the basis of the information provided: (a) C9H12O: Its infrared and 1H NMR spectra are shown in Figure 24.5. (b) C9H11BrO: Its infrared and 1H NMR spectra are...
-
Knowing what to look for with respect to isotopic clusters can aid in interpreting mass spectra. How many peaks would you expect to see for the molecular ion in each of the following compounds? At...
-
T/F: BOs are internally stable and externally adaptable.
-
T/F: BOs is the middle layer of stability model.
-
T/F: BOs are semi-tangible and mostly conceptual.
Study smarter with the SolutionInn App