Exercises¶
Exercise 1: Capture-Recapture Method¶
We aim to estimate the total number of fish, \(N\), in a pond using the capture-recapture method.
- First Capture: Researchers captured \(M = 50\) fish, marked them, and released them back into the pond.
- Second Capture: A week later, they captured \(n = 40\) fish. Among these, \(m = 10\) fish were found to be marked.
(a) Derive the probability \(P(N)\) of observing the given outcome as a function of \(N\).
(b) Determine the maximum likelihood estimate (MLE) of \(N\).
Solution¶
Part (a): Deriving the Probability \(P(N)\)
The number of marked fish in the second sample follows a hypergeometric distribution:
Substituting the given values (\(M = 50\), \(n = 40\), \(m = 10\)):
Part (b): Finding the MLE of \(N\)
The log-likelihood is:
The term \(\ln \binom{50}{10}\) is constant. Expanding the remaining terms and differentiating:
Exercise 2: Estimation of Probability of Heads¶
A coin with probability \(p\) of landing heads is tossed 100 times. The coin lands on heads 40 times.
(a) Express the likelihood function \(P(p)\).
(b) Find the value of \(p\) that maximizes \(P(p)\).
Solution¶
Part (a): The likelihood (ignoring \(\binom{100}{40}\)):
Part (b): The log-likelihood:
Derivative:
Exercise 3: Mean of the Sample Mean¶
If a random sample of 9 is taken from a population with mean 75 and standard deviation 18, what is the mean of the sampling distribution of the sample mean?
Solution¶
The mean of the sampling distribution is the same as the population mean: 75.
Exercise 4: Standard Error of the Sample Mean¶
A random sample of 9 observations is taken from a population with a mean of 75 and a standard deviation of 18. What is the standard error?
Solution¶
Exercise 5: Probability of Sample Mean Exceeding a Given Weight¶
The weights of apples in a large orchard follow a normal distribution with a mean of 150 grams and a standard deviation of 20 grams. A random sample of 25 apples is selected. What is the probability that the sample mean weight exceeds 155 grams?
Solution¶
The probability is approximately 10.56%.
from scipy import stats
print(f"{stats.norm().sf(1.25) = :.4f}")
Exercise 6: Probability of Sample Mean Falling Within a Range¶
The average number of hours a student sleeps per night is 7 hours, with a standard deviation of 1.5 hours. A random sample of 49 students is selected. What is the probability that the sample mean sleep duration is between 6.8 and 7.2 hours?
Solution¶
The probability is approximately 64.76%.
from scipy import stats
print(f"{stats.norm().cdf(0.93) - stats.norm().cdf(-0.93) = :.4f}")
Exercise 7: Probability of Sample Mean Weight Exceeding 72 kg¶
The weights in a population are normally distributed with a mean of 70 kg and a standard deviation of 10 kg. If a random sample of 5 individuals is selected, what is the probability that the sample mean weight will be greater than 72 kg?
Solution¶
Since the population weight is normally distributed, we can use the exact result even for \(n = 5\).
The probability is approximately 32.74%.
from scipy import stats
print(f"{stats.norm().sf(0.447) = :.4f}")
Exercise 8: Uncertainty of Sample Mean Exceeding 810 Hours Without Normality Assumption¶
The average lifespan of a certain type of lightbulb is 800 hours, with a standard deviation of 100 hours. For a sample of 5 lightbulbs, what can be said about the probability that the sample mean lifespan will be greater than 810 hours, without assuming that the population distribution is normal?
Solution¶
However, since the sample size is small (\(n = 5\)) and we do not assume that the population distribution is normal, the Central Limit Theorem (CLT) does not apply. Without assuming normality, we cannot accurately determine the probability that the sample mean will be greater than 810 hours. Further information about the population's shape would be needed.
Exercise 9: Probability of Sample Proportion Exceeding 65% Preference¶
In a large population, 60% prefer brand A over brand B. If a sample of 100 individuals is selected, what is the probability that more than 65% of the sample will prefer brand A?
Solution¶
The probability is approximately 15.39%.
from scipy import stats
print(f"{stats.norm().sf(1.02) = :.4f}")
Exercise 10: Comparing Exact and Normal Approximation for Sample Proportion¶
A survey indicates that 30% of a town's population prefers public transport. If a sample of 10 residents is selected, what can be said about the probability that more than 35% of the sample will prefer public transport?
Solution¶
Exact Binomial Calculation
Since \(\hat{p} > 0.35\) with \(n = 10\) means \(X \geq 4\) (where \(X \sim \text{Binomial}(10, 0.3)\)):
Normal Approximation (questionable since \(np = 3 < 5\))
Comparison:
| Method | Result |
|---|---|
| Exact binomial | 0.3504 |
| Normal approximation | 0.3650 |
The normal approximation is reasonably close despite the small sample.
from scipy import stats
print(f"{stats.norm().cdf(0.345) = :.4f}")
print(f"{stats.norm().sf(0.345) = :.4f}")
Exercise 11: Distribution of the Sample Variance¶
A sample of size 10 is drawn from a normal distribution with a known variance of 25. What is the expected value and variance of the sample variance?
Use the fact that for a chi-square distribution with \(k\) degrees of freedom: mean is \(\mu = k\) and variance is \(\sigma^2 = 2k\).
Solution¶
For \(Y \sim \chi^2_{n-1}\), we have \(EY = n - 1\) and \(\text{Var}(Y) = 2(n-1)\).
Exercise 12: Probability of Sample Variance Exceeding 30¶
A sample of size 10 is drawn from a normal distribution with a known population variance of 25. What is the probability that the sample variance will be greater than 30?
Solution¶
The probability is approximately 28.97%.
from scipy import stats
print(f"{stats.chi2(9).sf(10.8) = :.4f}")
Exercise 13: Assessing Probability of Sample Variance Without Normality Assumption¶
A sample of size 10 is drawn from a population with a known variance of 25. What can be said about the probability that the sample variance will be greater than 30, without assuming that the population distribution is normal?
Solution¶
Without normality, \((n-1)S^2/\sigma^2\) does not follow a chi-square distribution. We know \(E(S^2) = 25\), but we cannot determine \(P(S^2 > 30)\).
Chebyshev's Inequality could provide a bound:
However, to use it we need \(\text{Var}(S^2)\), which depends on higher moments of the non-normal population that we don't have.
Conclusion: Without assuming normality, we cannot determine the probability using typical methods.
Exercise 14: Standard Error of the Difference in Sample Means¶
We draw two independent samples: population A with \(\sigma_A = 15\) (\(n_A = 36\)) and population B with \(\sigma_B = 20\) (\(n_B = 49\)). Find the standard error of \(\bar{X}_A - \bar{X}_B\).
Solution¶
Exercise 15: Probability of Sample Mean Exceeding $45,000 Using t-Distribution¶
The annual salaries of employees in a company are normally distributed with a mean of $40,000. A random sample of 9 employees is selected, and the sample standard deviation is $8,000. What is the probability that the sample mean annual salary will be $45,000 or more?
Solution¶
With \(\text{df} = 8\):
The probability is approximately 4.8%.
from scipy import stats
print(f"{stats.t(8).sf(1.875) = :.4f}")
Exercise 16: Probability of F-Ratio Exceeding 1.5¶
Two independent samples from two normal populations with common variance \(\sigma^2 = 20\). First sample: \(n_1 = 15\). Second sample: \(n_2 = 10\). What is \(P(S_1^2 / S_2^2 > 1.5)\)?
Solution¶
Under equal variances, \(F = S_1^2 / S_2^2 \sim F_{n_1-1, \, n_2-1} = F_{14, 9}\).
Starting from \(S_i^2 \sim \frac{\sigma^2 \chi^2_{n_i-1}}{n_i - 1}\):
The probability is approximately 27.4%.
from scipy import stats
n1 = 15
n2 = 10
print(f"{stats.f(n1-1, n2-1).sf(1.5) = :.4f}")
Exercise 17: Probability of Sample Mean Between 48 and 52¶
A population has a mean of 50 and a standard deviation of 12. If a sample of size 36 is drawn, what is the probability that the sample mean will be between 48 and 52?
Solution¶
The probability is approximately 68.27%.
from scipy import stats
print(f"{stats.norm().cdf(1) - stats.norm().cdf(-1) = :.4f}")
Exercise 18: The Law of Large Numbers¶
A population has a mean of 100 with a standard deviation of 20. If you take increasingly larger samples, what happens to the mean of the sampling distribution?
Solution¶
According to the Law of Large Numbers, as the sample size increases, the mean of the sampling distribution approaches the population mean of 100.
Exercise 19: Shape of Sampling Distribution for a Skewed Population¶
A population has a skewed distribution with a mean of 50 and a standard deviation of 10. If a sample of size 100 is drawn, what is the approximate shape of the sampling distribution of the sample mean?
Solution¶
By the Central Limit Theorem (CLT), since \(n = 100\) is large (greater than 30), the sampling distribution of the sample mean will be approximately normal, even though the original population distribution is skewed.
Exercise 20: Probability of Sample Mean Exceeding $2100 for Skewed Sales¶
A company's daily sales are skewed to the right with a mean of $2000 and a standard deviation of $500. If a random sample of 100 days is selected, what is the probability that the sample mean daily sales will exceed $2100?
Solution¶
The probability is approximately 2.28%.
from scipy import stats
print(f"{stats.norm().sf(2) = :.4f}")
Exercise 21: Effect of Increasing Sample Size on Standard Error¶
If the standard deviation of a population is 50 and the sample size is increased from 25 to 100, what happens to the standard error?
Solution¶
The standard error is reduced by half when the sample size increases from 25 to 100.
Exercise 22: Standard Error and Sample Size¶
If the standard error of the mean for a sample of size 16 is 5, what would be the standard error if the sample size increased to 64?
Solution¶
From \(\sigma / \sqrt{16} = 5\), we get \(\sigma = 20\). For a sample size of 64:
Exercise 23: Expected Value and Variance of the Sample Variance (Repeat for Emphasis)¶
A sample of size 10 is drawn from a normal distribution with a known variance of 25. What is the expected value and variance of the sample variance?
Use the fact that for a chi-square distribution with \(k\) degrees of freedom: mean is \(\mu = k\) and variance is \(\sigma^2 = 2k\).