****************************** Solution A ****************************** The raw time for each benchmark to execute on each computer is as follows: T(prime, lab): 0.0728 ms T(gauss, lab): 313.82 ms T(prime, grendel): 0.1238 ms T(gauss, grendel): 681.26 ms T(prime, ozark): 0.1883 ms T(gauss, ozark): 987.08 ms Based on the results, operations involving floating-point arithmetic take much longer than integer arithmetic. At each computer, it took at least 4000 times as long to complete the benchmark with floating point arithmetic (Guassian integral) than integer arithmetic (prime testing). Ratios between execution times for each computer are as follows: T(prime, grendel)/T(prime, lab): 1.70 T(prime, ozark)/T(prime, lab): 2.59 T(gauss, grendel/T(gauss, lab): 2.171 T(gauss, ozark)/T(gauss, lab): 3.145 The T(grendel)/T(lab) and T(ozark)/T(lab) ratios for both the prime testing and Gaussian integral benchmarks indicate that the lab computer is fastest, being 1.70 times faster than grendel and 2.59 faster than ozark in the primes benchmark and 2.171 times faster than grendel and 3.145 times faster than ozark in the Gaussian integral benchmark. These ratios also indicate that grendel is faster than ozark in both benchmarks. Specifically, grendel is 1.5 times faster than ozark in the primes benchmark and 1.45 times faster in the Gaussian integral benchmark. These results were obtained by timing a computer running the benchmark some number of times and determining the average time. In the prime testing benchmark, 10000 numbers were selected randomly and tested for primality. In the Gaussian integral benchmark, 100 numbers were selected randomly and used to calculate the integral. Program execution times were obtained by entering the following terminal commands: time python prime.py time python gaussian.py The user time given by these commands was recorded as the program execution time. User time was selected because it does not include time spent by the processor in other applications. Although it includes system time, these benchmarks were computationally based and did not use software interrupts. Thus, system time was negligable. Appendix #prime testing import random def primeTest(): for i in range(0, 10000): isPrime(random.randint(0, 100000000)) def isPrime(n): d = 2 while d*d < n: if n%d == 0: return False d = d + 1 return True primeTest() #Gaussian integral import random import math def f(x): return math.exp((-1*x*x)/2) def gaussian(n): sum = f(-2.0) + f(2.0) delta = 4.0 / n for i in range (1, n): sum = sum + 3*f(-2 + i * delta) return delta * (sum / 3.0) def gaussTest(): for i in range(100): gaussian(random.randint(0, 1000000)) gaussTest()