Homework 8 Key

CHE 116: Numerical Methods and Statistics

2/21/2019


1. Short Answer (12 Points)

  1. [2 points] If you sum together 20 numbers sampled from a binomial distribution and 10 from a Poisson distribution, how is your sum distribted?

  2. [2 points] If you sample 25 numbers from different beta distributions, how will each of the numbers be distributed?

  3. [4 points] Assume a HW grade is determined as the sample mean of 3 HW problems. How is the HW grade distributed if we do not know the population standard deviation? Why?

  4. [4 points] For part 3, how could not knowing the population standard deviation change how it's distributed? How does knowledge of that number change the behavior of a random variable?

1.1

Normal

1.2

We are not summing, no NLT. Beta distributed

1.3

t-distribution, since we do not know population standard deviation and N < 25

1.4

We have to estimate the standard error using sample standard deviation, which itself is a random variable. If we have the exact number, then we no longer have two sources of randomness.

2. Confidence Intervals (30 Points)

Report the given confidence interval for error in the mean using the data given for each problem and describe in words what the confidence interval is for each example. 6 points each

2.1

80% Double.

data_21 = [65.58, -28.15, 21.17, -0.57, 6.04, -10.21, 36.46, 10.67, 77.98, 15.97]

2.2

99% Upper (lower bound, a value such that the mean lies above that value 99% of the time)

data_22 = [-8.78, -6.06, -6.03, -6.9, -13.57, -18.76, 1.5, -8.21, -3.21, -11.85, -2.72, -10.38, -11.03, -10.85, -7.6, -7.76, -5.99, -10.02, -6.32, -8.35, -19.28, -11.53, -6.04, -0.81, -12.01, -3.22, -9.25, -4.13, -7.22, -11.0, -14.42, 1.07]

2.3

95% Double

data_23 = [14.62, 10.34, 7.68, 15.81, 14.48]

2.4

Redo part 3 with a known standard deviation of 2

2.5

95% Lower (upper bound)

data_25 = [2.47, 2.03, 1.82, 6.98, 2.41, 2.32, 7.11, 5.89, 5.77, 3.34, 2.75, 6.51]

2.1

The 80% confidence interval is $19 \pm 14$


In [19]:
import scipy.stats as ss
data_21 = [65.58, -28.15, 21.17, -0.57, 6.04, -10.21, 36.46, 10.67, 77.98, 15.97]
se = np.std(data_21, ddof=1) / np.sqrt(len(data_21))
T = ss.t.ppf(0.9, df=len(data_21) - 1)
print(np.mean(data_21), T * se)


19.494000000000003 14.329405730739305

2.2

The 99% confidence interval is $\mu > -10.1$


In [20]:
data_22 = [-8.78, -6.06, -6.03, -6.9, -13.57, -18.76, 1.5, -8.21, -3.21, -11.85, -2.72, -10.38, -11.03, -10.85, -7.6, -7.76, -5.99, -10.02, -6.32, -8.35, -19.28, -11.53, -6.04, -0.81, -12.01, -3.22, -9.25, -4.13, -7.22, -11.0, -14.42, 1.07]
se = np.std(data_22, ddof=1) / np.sqrt(len(data_22))
Z = ss.norm.ppf(1 - 0.99)
print(Z * se + np.mean(data_22))


-10.142829382908278

2.3

The 85% confidence interval is $12.5 \pm 4.3$


In [21]:
data_23 = [14.62, 10.34, 7.68, 15.81, 14.48]
se = np.std(data_23, ddof=1) / np.sqrt(len(data_23))
T = ss.t.ppf(0.975, df=len(data_23) - 1)
print(np.mean(data_23), T * se)


12.586000000000002 4.266697893878013

2.4

The 95% confidence interval is $12.5 \pm 2.5$


In [23]:
data_23 = [14.62, 10.34, 7.68, 15.81, 14.48]
se = 2 / np.sqrt(len(data_23))
Z = ss.norm.ppf(0.975)
print(np.mean(data_23), T * se)


12.586000000000002 2.483327996407533

2.5

The 95% upper bound is $\mu < 5.2$


In [28]:
data_25 = [2.47, 2.03, 1.82, 6.98, 2.41, 2.32, 7.11, 5.89, 5.77, 3.34, 2.75, 6.51]
se = np.std(data_25, ddof=1) / np.sqrt(len(data_25))
T = ss.t.ppf(0.95, df=len(data_25) - 1)
print(np.mean(data_25) +  T * se)


5.2188256940959175

3. Identifiying Distributions (12 Points)

For each problem state if it is a t or normal distribution and reports the distribution's $\mu$ and $\sigma$. Note that $\mu, \sigma$s listed below are the population sigmas. Report your answer like: $T(0, 4.3, 4)$ to indicate a $t$-distribution with $\mu = 0$, $\sigma = 4.3$ and degrees of freedom of 3. 2 Points each

  1. $P(\mu)$, $\bar{x} = -2$, $\sigma = 4$, $N = 30$
  2. $P(\bar{x})$, $\mu = 1$, $\sigma = 2$, $N = 5$
  3. $P(\mu - \bar{x})$, $\sigma = 4.3$, $N = 2$
  4. $P(\mu)$, $\bar{x} = 4$, $\sigma_x = 1.7$, $N = 50$
  5. $P(\mu)$, $\bar{x} = 5.5$, $\sigma_x = 2.1$, $N = 9$
  6. $P(\mu - \bar{x})$, $\sigma_x = 4.3$, $N = 5$

3.1

$Z(-2, 4 / \sqrt{30})$

3.2

$Z(1, 2 / \sqrt{5})$

3.3

$Z(0, 4.3 / \sqrt{2})$

3.4

$Z(4, 1.7 / \sqrt{50})$

3.5

$T(5.5, 2.1 / \sqrt{9}, 8)$

3.5

$T(0, 4.3 / \sqrt{5}, 4)$