Professional Documents
Culture Documents
S&P Handson
S&P Handson
mean = round(statistics.mean(arr), 2)
median = round(statistics.median(arr), 2)
mode = round(statistics.mode(arr), 2)
std_deviation = round(statistics.pstdev(arr), 2)
variance = round(statistics.pvariance(arr), 2)
Second:
no_of_perm = 0
no_of_comb = 0
Third:
Just put ans 200
Fourth:
prob = stats.binom.pmf(0, 4, 0.60)
ans = round(1 - prob, 2)
Fifth:
averagepass = 10
prob = stats.poisson.pmf(15, averagepass)
ans= round(prob, 2)
Sixth:
prob_seoul = 0.25
prob_paris = 0.25
prob_dubai = 0.25
prob_switzerland = 0.25
Seventh:
prob_accident = 0.09
prob_intoxicated = 0.32
prob_accident_and_intoxicated = 0.15
last
table=[[18,36,21,9,6],[12,36,45,36,21],[6,9,9,3,3],[3,9,9,6,3]]
stat,p_val,dof,res=chi2_contingency(table)
prob=0.95
critical=chi2.ppf(prob, dof)
if abs(stat) >= critical:
res = 'Reject the Null Hypothesis'
else:
res= 'Failed to reject the Null Hypothesis'
alpha=1.0-prob
if p_val <= alpha:
res = 'Reject the Null Hypothesis'
else:
res = 'Failed to reject the Null Hypothesis'
stat = round(stat,2)
dof = round(dof,2)
p_val = round(p_val,2)
return stat,dof,p_val,res