Question: Suppose the time that Java takes to sort a 1,000,000 length array is approximately N( = 46,2 = 62)milliseconds (ms), since it uses the (randomized)
Suppose the time that Java takes to sort a 1,000,000 length array is approximately N( = 46,2 = 62)milliseconds (ms), since it uses the (randomized) QuickSort Algorithm.
(a) Python initially implements a (deterministic) MergeSort Algorithm, and it always fin- ishes in = 49 ms. What is the probability that Java sorts a single 1,000,000 length array faster than Python does? Show your work and give your answer rounded to 4 decimal places. (b) Python attempts to implement QuickSort as well, but did it less efficiently. Its runtime is approximately N( = 55,2 = 82). What is the probability that Java sorts a single 1,000,000 length array faster than Python does? Show your work and give your answer rounded to 4 decimal places. (c) Keep the updated Python runtime assumptions from part (b). We compare Python and Java in a marathon race. We have 9 independent "games", and each game consists of sorting a 1,000,000 length array. The winner is the language who wins in at least 5 of 9 games. What is the probability that Java wins? Show your work and give your answer rounded to 4 decimal places. (d) Keep the updated Python runtime assumptions from part (b). We compare Python and Java in a marathon race. We have 9 arrays, and we ask Java and Python to sort all 9 arrays, sequentially one at a time (independently). What is the probability that Java sorts 9 arrays before Python does? Show your work and give your answer rounded to 4 decimal places.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
