Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A program takes 100 seconds to execute. 20% instructions are multiplication inst

ID: 3635250 • Letter: A

Question

A program takes 100 seconds to execute. 20% instructions are multiplication instructions,
50 % are memory accesses and 30% are reserved for other tasks. Two programmers
decided to make some changes to the program. Programmer A made the multiplication instructions 6 times faster but that caused the memory instructions to run in twice the original time (of memory instructions). Programmer B made changes to the program such that the memory accesses became two times faster than the original but that slowed down the multiplication instruction by a factor of two. Which of the programmers improved the performance the most? Calculations are required.

Explanation / Answer

Same idea as the last one: Mu: 20 * 1 Me: 50 * 1 Ot: 30 * 1 T = 20 * 1 + 50 * 1 + 30 * 1 A: Mu: 20 * 1/6 Me: 50 * 2 Ot: 30 * 1 Ta = 20 * 1/6 + 50 * 2 + 30 * 1 Ta = 3.3 + 100 + 30 = 133.3Sec B: Mu: 20 * 2 Me: 50 / 2 Ot: 30 * 1 Tb = 20 * 2 + 50 / 2 + 30 * 1 Tb = 40 + 25 + 30 = 95 Looks like programmer B actually got it to run quicker, good for him!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote