import numpy as np
import matplotlib.pyplot as plt
import scipy as sp7
The CLT describes the shape (as a distribution) of the mean of random variables. The distribution of the original random variables doesn’t really matter so long as the variance of the original random variables’ distribution is finite.
The location of the distribution of the mean of random variables is the mean of the original distribution.
The scale of the distribution of the mean of random variables convergesn to zero as the number of random variables goes off to infinity.
The shape of the mean of the random variables is Normal, where the shape looks more Normal as the number of random variables increases.
# 6
X = sp.stats.norm(loc = 12, scale = 1.8)# 6d
X.mean() - 3
X.var()np.float64(9.0)
# 6e
expectation = (9/5) * X.mean() - 3 * 9 / 5 + 32
variance = X.var() * (9/5) ** 2
scale = X.std() * 9/5
F = sp.stats.norm(loc = expectation,
scale = scale)# 9
X = sp.stats.poisson(6)# 9a
X.cdf(4) - X.cdf(3)np.float64(0.13385261753998332)
X.pmf(4)np.float64(0.13385261753998332)
# 9b
# P[X > 8] =
1 - X.cdf(8)np.float64(0.15276250601543884)
# made up, cause Edward can't read good
# P[X >= 8]
1 - X.cdf(7)np.float64(0.25602023954628295)
# 9c
Y = sp.stats.poisson(3)
1 - Y.cdf(4)np.float64(0.1847367554762278)
# 4a
X = sp.stats.binom(30, 0.04)# 4b
X.pmf(2)np.float64(0.2219237409815226)
X.cdf(2) - X.cdf(1)np.float64(0.22192374098152245)
# 4c
1 - X.cdf(2)np.float64(0.11689656174938934)
np.sum(X.pmf(np.arange(3, 31)))np.float64(0.11689656174938938)
# 4d
1 - X.cdf(3)np.float64(0.030592884701019507)
np.sum(X.pmf(np.arange(4, 31)))np.float64(0.030592884701019486)