From 3e039c853ee1e7e82619a730c0a23b1ffb0e44ca Mon Sep 17 00:00:00 2001 From: andyeisenberg <125768484+andyeisenberg@users.noreply.github.com> Date: Thu, 1 Jan 2026 22:19:38 +0000 Subject: [PATCH] Adding more exercises throughout --- source/ch-Confidence-Intervals.ptx | 182 +++++++++++++++- source/ch-Expected-Value.ptx | 75 ++++++- source/ch-Hypothesis-Testing.ptx | 327 +++++++++++++++++++++++++++-- source/ch-Linear-Regression.ptx | 263 ++++++++++++++++++++++- 4 files changed, 806 insertions(+), 41 deletions(-) diff --git a/source/ch-Confidence-Intervals.ptx b/source/ch-Confidence-Intervals.ptx index e90f44c..009ea2c 100644 --- a/source/ch-Confidence-Intervals.ptx +++ b/source/ch-Confidence-Intervals.ptx @@ -4,25 +4,187 @@ Confidence Intervals -

Text before the first section.

+

+ Text before the first section. +

-
- Central Limit Theorem + Central Limit Theorem -

Text of section.

+

+ Text of section. +

+ + + +

+ Suppose a coin has probability 0.4 of coming up heads, and we flip the coin 100 times. + Let S be the number of heads. + Estimate the probability that 34 \leq S \leq 44. +

+
+
+ + + +

+ Suppose a fair die is rolled 100 times, and let m be the average value of the rolls. + Estimate the probability that 3.45 \leq m \leq 3.55. +

+
+
+ + + +

+ The heights of men in the US have a mean of 69 in and a variance of about 9 in^2, and the heights of women in the US have a mean of 63.5 in with a variance of 6.25 in^2. +

+
+ + + + +

+ Suppose the heights of 30 men are sampled, and a sample mean m is taken. + Find the expected value and variance of m. +

+
+
+ + + + +

+ Estimate the probability that m \geq 69.5. +

+
+
+ + + + +

+ What if the sampled group was women? +

+
+
+
+
- -
- Confidence Intervals + Confidence Intervals -

Text of section.

+

+ Text of section. +

+ + + +

+ Suppose we flip a coin 100 times and count 60 heads. + Let p be the (unknown) probability that the coin comes up heads on a flip. + Give an approximate 95% confidence interval for the value of p. +

+
+
+ + + +

+ Suppose in a sample of 100 people, 12 are left-handed. +

+
+ + + + +

+ Give a 95% confidence interval for the proportion p of left-handed people. +

+
+
+ + + + +

+ Give a 90% confidence interval. +

+
+
+
+ + + +

+ The weights of five mice are measured and recorded below. + Give a 95% confidence interval for the sample mean weight of mice. + (Pretend 5 measurements is large enough for the CLT to apply.) +

+ + + + + + + mouse i + 1 + 2 + 3 + 4 + 5 + + + + weight \widetilde{w}_i (g) + 26 + 32 + 33 + 20 + 29 + + +
+
+
+ + + +

+ The heights of five plants are measured and recorded below. + Give a 95% confidence interval around the sample mean for the heights of the plants. + (Pretend 5 measurements is large enough for the CLT to apply.) +

+ + + + + + + plant i + 1 + 2 + 3 + 4 + 5 + + + + height \widetilde{h}_i (in) + 15 + 14 + 18 + 21 + 17 + + +
+
+
+
- - \ No newline at end of file diff --git a/source/ch-Expected-Value.ptx b/source/ch-Expected-Value.ptx index 7dbdeb7..aeee8ad 100644 --- a/source/ch-Expected-Value.ptx +++ b/source/ch-Expected-Value.ptx @@ -1,7 +1,6 @@ - Expected Value and Variance @@ -880,6 +879,80 @@

+ Calculate the covariance of X and Y: +

+ + + + + + + + X = 1 + X = 2 + + + + Y = 0 + 0.12 + 0.24 + + + + Y = 1 + 0.3 + 34 + + +
+
+
+ + + +

+ Calculate the covariance of X and Y: +

+ + + + + + + + X = 0 + X = 1 + X = 2 + + + + Y = 0 + 0.08 + 0.16 + 0.1 + + + + Y = 1 + 0.14 + 0.2 + 0.32 + + +
+
+
+ + + +

+ Suppose we roll a fair, 4-sided die two times. + Let X be the sum of the rolls, and let Y be the product of the rolls. + Find the covariance of X and Y. +

+ +

+ [Note: Somewhat tedious.]

diff --git a/source/ch-Hypothesis-Testing.ptx b/source/ch-Hypothesis-Testing.ptx index 4d7479e..9acc1de 100644 --- a/source/ch-Hypothesis-Testing.ptx +++ b/source/ch-Hypothesis-Testing.ptx @@ -4,45 +4,332 @@ Hypothesis Testing -

Text before the first section.

+

+ Text before the first section. +

-
- One Sample Tests + One Sample Tests -

Text of section.

+

+ Text of section. +

+ + + +

+ In each of the following scenarios, determine whether we should use a 1-tailed test or a 2-tailed test. +

+
+ + + + +

+ We have a coin which we've flipped many times, seeing an above-average number of heads. + We suspect the coin comes up heads more often than a fair coin would. +

+
+
+ + + + +

+ We find a coin on the street and wonder whether or not it's a fair coin. +

+
+
+ + + + +

+ We suspect there will be a difference in average weight of mice caught during the summer versus during the winter. +

+
+
+ + + + +

+ In a medical study, a group of patients are gathered and the proportion experiencing particular symptoms is measured. + A new drug intended to eliminate these symptoms is administered, after which the proportion experiencing symptoms is measured again. +

+
+
+
+ + + +

+ Suppose we find a coin and wonder whether it's fair. + As a first test, we decide to flip the coin 200 times and count the number of heads. + If we see 112 heads, should we accept or reject the null hypothesis of a fair coin at a significance level of 0.05? +

+
+
+ + + +

+ Suppose we have a coin which we suspect comes up heads more often than a fair coin would. + As a first test, we decide to flip the coin 200 times and count the number of heads. + If we see 112 heads, should we accept or reject the null hypothesis of a fair coin at a significance level of 0.05? +

+
+
+ + + +

+ Suppose we find a six-sided die and wonder whether it's fair. + As a first test, we decide to roll the die 100 times and count the number of times it comes up 1. + If we roll 22 1's, should we accept or reject the null hypothesis of a fair die at a significance level of 0.05? +

+
+
+ + + +

+ Suppose a particular plant when grown outdoors has an average height of 39 in with a variance of 20 in^2. + We suspect that growing this plant in a greenhouse will increase its height. + A sample of 50 plants grown in a greenhouse has an average height of 40 in. + Is this significant enough data to reject the null hypothesis of equal means at the p = 0.05 significance level? +

+
+
+
- -
- Two Sample Tests + Two Sample Tests -

Text of section.

+

+ Text of section. +

+ + + +

+ A farmer is testing an experimental new plant fertilizer that is supposed to increase the weight of a particular apple variety. + A control sample of 25 apples grown using the usual fertilizer have a mean weight of 75 grams and a sample variance of 90 grams^2 (for an individual apple). + An experimental sample of 25 apples grown using the new fertilizer have a mean weight of 79 grams and a sample variance of 90 grams^2. +

+
+
+ + + +

+ We have an established factory which produces coins that are close to fair. + We're opening up a second factory, and we'd like to ensure the machines are calibrated to produce coins which behave similarly to the ones produced in the established factory. + We pick one sample coin from each factory, and flip each sample coin 100 times. + The coin from the established factory flips 52 heads in 100 flips. + The coin from the new factory flips 62 heads in 100 flips. + Is this strong enough evidence to reject the null hypothesis that the two factories produce similar coins at a 0.05 significance level? +

+
+
+
- -
- Power of a Test + Power of a Test -

Text of section.

+

+ Text of section. +

+ + + +

+ Suppose we find a coin and wonder whether it's fair. + As a first test, we decide to flip the coin 200 times and count the number of heads, S. + What values of S would be extreme enough to reject the null hypothesis of a fair coin? If the coin actually has a 0.6 probability of coming up heads, what is the power of this test? +

+
+
+ + + +

+ Suppose we have a coin which we suspect comes up heads more often than a fair coin would. + As a first test, we decide to flip the coin 200 times and count the number of heads, S. + What values of S would be extreme enough to reject the null hypothesis of a fair coin? If the coin actually has a 0.6 probability of coming up heads, what is the power of this test? +

+
+
+ + + +

+ Suppose we find a six-sided die and wonder whether it's fair. + As a first test, we decide to roll the die 100 times and count the number of times it comes up 1. + The expected number of 1's is 50/3, with a variance of 125/9. +

+
+ + + + +

+ Using a normal approximation, what is the smallest number of 1's greater than 50/3 that would be extreme enough to reject the null hypothesis of a fair die? +

+
+
+ + + + +

+ Using a normal approximation, what is the greatest number of 1's less than 50/3 that would be extreme enough to reject the null hypothesis of a fair die? +

+
+
+ + + + +

+ Suppose that this die is weighted so that it rolls a 1 with probability 0.2. + What would be the power of our test? +

+
+
+ + + + +

+ Suppose we roll the die 100 times and see 23 1's. + Use the maximum likelihood value for the probability of rolling a 1 to calculate the power of the test. +

+
+
+
+ + + +

+ Suppose a particular plant when grown outdoors has an average height of 39 in with a variance of 20 in^2. + We suspect that growing this plant in a greenhouse will increase its height. + We take the average height of a sample of 50 plants grown in a greenhouse. + What is the minimum average height of this sample that would be extreme enough to reject the null hypothesis of equal means at the p = 0.05 significance level? If the plants, when grown in a greenhouse, would truly have an average height of 41 in, what is the power of our test? +

+
+
+
- -
- <m>\chi^2</m> Test + <m>\chi^2</m> Test -

Text of section.

+

+ Text of section. +

+ + + +

+ A store owner wants to determine how much shelf space to allocate to each of the drinks that they sell. + They survey their customers about their favorite drinks. + Is the data below consistent with the null hypothesis that each type of drink will be equally preferred? +

+ + + + + + + drink type + water + soda + tea + coffee + energy drinks + + + + favorite + 28 + 17 + 15 + 26 + 14 + + +
+
+
+ + + +

+ A particular drug is administered in 100 independent trials. + In each trial, the drug is administered to four people, and we count how many respond to the drug. + The table below shows how many trials have each different count of people who respond to the drug. +

+ + + + + + + # who respond to drug + 0 + 1 + 2 + 3 + 4 + + + + # of trials + 3 + 11 + 31 + 34 + 21 + + +
+
+ + + + +

+ Is the data consistent with a binomial distribution with parameter p = 0.7? +

+
+
+ + + + +

+ What is the total number of people who have been administered the drug? What is the total number who have responded to it? What is the maximum likelihood estimation for the probability p that a person will respond to the drug? +

+
+
+ + + + +

+ Is the data consistent with a binomial distribution with the MLE value of p? +

+
+
+
+
- - - -
\ No newline at end of file diff --git a/source/ch-Linear-Regression.ptx b/source/ch-Linear-Regression.ptx index d963da3..fb3c9ba 100644 --- a/source/ch-Linear-Regression.ptx +++ b/source/ch-Linear-Regression.ptx @@ -4,25 +4,268 @@ Linear Regression -

Text before the first section.

+

+ Text before the first section. +

-
- Correlation + Correlation -

Text of section.

+

+ Text of section. +

+ + + +

+ Calculate the correlation of X and Y: +

+ + + + + + + + X = 1 + X = 2 + + + + Y = 0 + 0.12 + 0.24 + + + + Y = 1 + 0.3 + 34 + + +
+
+
+ + + +

+ Calculate the correlation of X and Y: +

+ + + + + + + + X = 0 + X = 1 + X = 2 + + + + Y = 0 + 0.08 + 0.16 + 0.1 + + + + Y = 1 + 0.14 + 0.2 + 0.32 + + +
+
+
+ + + +

+ Suppose we roll a fair, 4-sided die two times. + Let X be the sum of the rolls, and let Y be the product of the rolls. + Find the correlation of X and Y. +

+ +

+ [Note: Somewhat tedious.] +

+
+
+
-
- Linear Regression + Linear Regression -

Text of section.

+

+ Text of section. +

+ + + +

+ A survey of local companies collects information about marketing budgets X and revenue Y (each measures in thousands of dollars), shown below. + A linear regression gives the best linear fit as Y = 18.28 X + 29.69. + What is the coefficient of determination r^2? +

+ + + + + + + x_i + y_i + (y_i - \text{avg})^2 + \text{pred } y_i + \text{res}^2 + + + + 200 + 4300 + 2073600 + 3686 + 377377 + + + + 420 + 7700 + 3841600 + 7707 + 53 + + + + 270 + 4500 + 1537600 + 4965 + 216495 + + + + 380 + 7000 + 1587600 + 6976 + 572 + + + + 300 + 5200 + 291600 + 5514 + 98401 + + + + sum: + 28700 + 9332000 + 28848 + 692898 + + +
+
+
+ + + +

+ A sample of 100 measurements are taken and a best fit line is calculated, resulting in the data below (the final line shows the sums for each column). + Find the coefficient of determination. +

+ + + + + + + x_i + y_i + \text{pred } y_i + (y - \text{avg})^2 + \text{res}^2 + + + + 38.00 + 121.00 + 93.17 + 11.83 + 774.33 + + + + 87.00 + 241.00 + 238.95 + 13586.23 + 4.22 + + + + 30.00 + 61.00 + 69.37 + 4024.63 + 70.12 + + + + 35.00 + 85.00 + 84.25 + 1555.51 + 0.57 + + + + + + + + + + + + 33.00 + 108.00 + 78.30 + 270.27 + 882.19 + + + + 26.00 + 32.00 + 57.47 + 8545.15 + 648.91 + + + + sum: + 12444.00 + 12444.00 + 515206.64 + 29789.80 + + +
+
+
+
- - - \ No newline at end of file