Will Barkoff, Phil Pozdnyakov, Gabe Taylor, Thien Vo
import numpy as np
import matplotlib as mp
import math
First, let's define functions to calculate the standard deviation, the $t'$ value, and the standard uncertianty of the mean
def standard_deviation(data):
N = len(data)
return np.sqrt(np.sum((data - np.mean(data))**2)/(N-1))
def t_prime(A, dA, B, dB):
return abs(A - B) / np.sqrt(dA**2 + dB**2)
def stand_unc_of_mean(data):
N = len(data)
return standard_deviation(data) / np.sqrt(N)
Next, let's input our data
acc_phone = [.11, .11, .24, .09, .11]
acc_box = [.27, .28, .27, .30, .28]
Let's then calculate the mean of each data set, and the uncertianty of each mean.
mean_phone = np.mean(acc_phone)
mean_box = np.mean(acc_box)
unc_phone = stand_unc_of_mean(acc_phone)
unc_box = stand_unc_of_mean(acc_box)
Finally, let's calculate the $t'$ value
t_prime(mean_phone, unc_phone, mean_box, unc_box)
5.319750144702964