I have written a single piece of code that consists of a single for loop with...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
I have written a single piece of code that consists of a single "for" loop with a simple calculation within the loop. I run the code two different times on the same computer, timing the execution for each run. The only change that is made between the two different runs is changing the number of loops that are executed. (10 points) If run number 1 is expected to loop 1 million times, and run number 2 is expected to loop 1 billion times, which run should take longer (assume CPIs are identical)? (Please justify your answer using the performance equation). b. (10 points) If both runs were found to take the identical amount of time, how many instructions were executed for each program? (assume that the time measurements are perfectly accurate and the CPIs are identical) (5 points) how long did the program run in each case? d. (5 points extra credit) Please explain what might have caused this? (you must correctly answer 3.a-3.c to receive this extra credit) I have written a single piece of code that consists of a single "for" loop with a simple calculation within the loop. I run the code two different times on the same computer, timing the execution for each run. The only change that is made between the two different runs is changing the number of loops that are executed. (10 points) If run number 1 is expected to loop 1 million times, and run number 2 is expected to loop 1 billion times, which run should take longer (assume CPIs are identical)? (Please justify your answer using the performance equation). b. (10 points) If both runs were found to take the identical amount of time, how many instructions were executed for each program? (assume that the time measurements are perfectly accurate and the CPIs are identical) (5 points) how long did the program run in each case? d. (5 points extra credit) Please explain what might have caused this? (you must correctly answer 3.a-3.c to receive this extra credit) I have written a single piece of code that consists of a single "for" loop with a simple calculation within the loop. I run the code two different times on the same computer, timing the execution for each run. The only change that is made between the two different runs is changing the number of loops that are executed. (10 points) If run number 1 is expected to loop 1 million times, and run number 2 is expected to loop 1 billion times, which run should take longer (assume CPIs are identical)? (Please justify your answer using the performance equation). b. (10 points) If both runs were found to take the identical amount of time, how many instructions were executed for each program? (assume that the time measurements are perfectly accurate and the CPIs are identical) (5 points) how long did the program run in each case? d. (5 points extra credit) Please explain what might have caused this? (you must correctly answer 3.a-3.c to receive this extra credit) I have written a single piece of code that consists of a single "for" loop with a simple calculation within the loop. I run the code two different times on the same computer, timing the execution for each run. The only change that is made between the two different runs is changing the number of loops that are executed. (10 points) If run number 1 is expected to loop 1 million times, and run number 2 is expected to loop 1 billion times, which run should take longer (assume CPIs are identical)? (Please justify your answer using the performance equation). b. (10 points) If both runs were found to take the identical amount of time, how many instructions were executed for each program? (assume that the time measurements are perfectly accurate and the CPIs are identical) (5 points) how long did the program run in each case? d. (5 points extra credit) Please explain what might have caused this? (you must correctly answer 3.a-3.c to receive this extra credit)
Expert Answer:
Answer rating: 100% (QA)
Assuming the number of instructions per loop IPL and clock cycles per instruction CPI remain constant we can use the performance equation to analyze t... View the full answer
Related Book For
Spreadsheet Modeling & Decision Analysis A Practical Introduction to Management Science
ISBN: 978-0324656633
5th edition
Authors: Cliff T. Ragsdale
Posted Date:
Students also viewed these accounting questions
-
Identify the main points for the firm to be able to meet its CSR objectives
-
Three steel spheres of equal mass are suspended from the ceiling by cords of equal length which are spaced at a distance slightly greater than the diameter of the spheres. After being pulled back and...
-
Suppose n is divisible by 6. Let (,P) be the space = {1,...,n} with the uniform probability P, let A be the event consisting of all even numbers, and let B be the event of all numbers divisible by...
-
How much work is needed for a 73-kg runner to accelerate from rest to 7.7 m/s?
-
A gauge repeatability and reproducibility study at NEW Gauge, Inc., collected the data for three operators, two trials, and eight parts, as found in the worksheet Prob04-08 in the Excel file...
-
Explain how and why the method of instrumental variables allows us to estimate the labor demand elasticity.
-
1. Stone Inc. is a company that purchases goods (e.g., chess sets, pottery) from overseas and resells them to gift shops in the United States. Stone Inc. is which of the following? a. Retailer b....
-
Viejol Corporation has collected the following information after its first year of sales. Sales were $1,600,000 on 100,000 units, selling expenses $250,000 (40% variable and 60% fixed), direct...
-
Enlightened Eats in Anchorage, Alaska, has six employees who are paid semimonthly. Calculate the net pay from the information provided below for the November 15 pay date. Assume that all wages are...
-
Make research the differences between clinical quality and customer service quality, specifically in long-term care. Using the Medicare Nursing Home Compare website, research one nursing home that...
-
Calculate: (1) Centroid (x, y) with O as origin, (2) Center of Gravity (or Mass) with O as origin, (3) Second moment of inertia (I and I) with centroid as origin, and (4) Radius of gyration with...
-
What are the financial ratios to be used for analysis in an aviation industry.
-
Please work on the conclusion and abstract based on authentic leadership and servant leadership from the 8 edition on youtube. Just do the conclusion, and abstract, please don't do authentic...
-
Explainsome virtual machine configuration options ? Explain some optimizations for a Linux virtual machine?
-
Edinburgh Diving School is investing in a new boat to expand its operations.The boat costs 200,000 today.The investment in this project is expected to generate net cash flows of 40,000 in perpetuity,...
-
Verify the divergence theorem for the vector field over the region bounded by the planes z = 0, z = 2, x = 0, x = 1, y = 0, y = 4. F = z+z+yk
-
1. Using the information from Problem 16-4B, prepare a statement of cash flows for Lim Garden Supplies Inc. using the direct method of presenting cash flows from operating activities. 2. How does Lim...
-
a. Formulate an NLP model for this problem. b. Implement your model in a spreadsheet and solve it. c. How much money should Roger spend in each state? d. How many campaign stops should the candidate...
-
Bob Davidson owns a newsstand outside the Waterstone office building complex in Atlanta, near Hartsfield International Airport. He buys his papers wholesale at $0.50 per paper and sells them for...
-
Refer to the previous question. Another type of option is the Asian option. Its payoff is not based on the price of the stock on the expiration date but, instead, on the average price of the stock...
-
A mercury manometer is connected between two points in a piping system that contains water. The downstream tap is $6 \mathrm{ft}$ higher than the upstream tap, and the manometer reading is $16...
-
The same suspension as that in Problem 39 above was subsequently tested in a $28 \mathrm{~mm}$ internal diameter pipe, and the following data reported: $\Gamma\left(\mathrm{s}^{-1} ight)$ 127 200 289...
-
The manometer equation is $\Delta \Phi=-\Delta ho g \Delta h$, where $\Delta \Phi$ is the difference in the total pressure plus static head $(P+ho g z)$ between the two points to which the manometer...
Study smarter with the SolutionInn App