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...
-
Companies are moving away from traditional marketing approaches (eg. TV, radio, print ads) and are now spending more on digital marketing (social media, blogging, email marketing, push notifications)...
-
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...
-
Locate the 2011 financial statements for The Walt Disney Company on the Internet. 1. Did Disney have any below-the-line items in 2011? Explain. 2. Disney's net income increased from $3,963 million in...
-
Watts Company makes various electronic products. The company is divided into a number of autonomous divisions that can either sell to internal units or sell externally. All divisions are located in...
-
Papa and Mamae Ltd buys 667/3 per cent of the shares in Son and Daughter Ltd. You are to draw up the consolidated balance sheet from the following balance sheets constructed immediately control had...
-
English Motors, Ltd. (EML), developed a new all-wheel-drive sports utility vehicle. As part of the marketing campaign, EML produced a video tape sales presentation to send to both owners of current...
-
NEEDASAP PLEASEWholesale banners pays 320,000 cash for a group purchase of land,building, and equipment. At the time of acquisition, the land has amarket value of 34,000, the building 221,0 Banners...
-
Rio Ferinand, the owner of Ferdinand Gold Mining, is evaluating a new gold mine in Fort McMurray. Paul Pogba, the company's geologist, has just finished his analysis of the mine site. He has...
-
Suppose H and K are subgroup of a group G. If o (H)=16 and o(K) = 63. Then o (HK) is 4 1 8 9
-
Explain what is Model, Strategy, Algorithm in math teaching? How is it similar/compare to 'algorithm' language of borrow or carry over in subtraction
-
Solve the Equation 3 x + 7 8 + x + 1 7 8 = x + 1 0 6
-
(b) Domain of 1 x2 - 26 = 1 (c) Domain of 4+
-
Given f(x) 2 = x + 4x 2, - A) Fill in the table of values by finding the output for each of the inputs. x -2 0 3 f(x) |-7 -2 19 B) Graph the function based on the top two rows of points from the...
-
Solve | 2 x + 3 | + 5 < 4 and write the solution in interval notation. ( If there is no solution, enter your answer as . )
-
RESEARCH TITLE/TOPIC: Customer satisfaction in home handmade beauty soap in terms of whitening complexion. FORMAT: INTRODUCTION PROBLEM OF THE STUDY BODY/METHODS CONCLUSION include the references
-
Rowland Textile Inc. manufactures two products: sweatshirts and T-shirts. The manufacturing process involves two activities: cutting and sewing. Expected overhead costs and cost drivers are as...
-
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...
-
1.14 Euro Virtual's EPS Sensitivity to Exchange Rates (A). On January 15, 2015 the Swiss National Bank (SNB) decided to unpeg the franc, which was fixed at CHF1.20/ since 2011. Suppose the SNB was to...
-
1.15 Euro Virtual's EPS Sensitivity to Exchange Rates (B). Assume a major weather crisis hits Switzerland, reducing its agricultural and food industries and sub- sequently leading to a macroeconomic...
-
1.16 Euro Virtual's EPS and Euro Appreciation/Depre- ciation. Since its introduction in 2003, the euro has been fluctuating against major global currencies. a. What is the impact of 15% appreciation...
Study smarter with the SolutionInn App