In the realm of hypothesis testing, the concepts of Type I and Type II errors are fundamental. These errors relate to incorrectly rejecting a true hypothesis or failing to reject a false one, respectively. This section is dedicated to exploring these errors, particularly focusing on how their probabilities are calculated in various statistical distributions such as normal, binomial, or Poisson. Understanding these concepts is crucial for students to accurately interpret the results of hypothesis tests.

## Error Probabilities in Hypothesis Testing

**Key Concepts:**

**1. Type I Error (α):** Incorrect rejection of a true null hypothesis.

- Set by the researcher (commonly 0.05).
- Indicates a false positive.

**2. Type II Error (β):** Failure to reject a false null hypothesis.

- Depends on the actual value of the population parameter.
- Indicates a false negative.

## Examples

### Example 1. Coin Toss: Type I Error Calculation

A researcher is testing if a coin is biased. The null hypothesis $(H_0)$ states the coin is fair (P(heads) = 0.5). The alternative hypothesis $(H_1)$ states the coin is biased towards heads (P(heads) > 0.5). If the researcher decides to reject $H_0$ if there are more than 55 heads in 100 tosses, what's the probability of a Type I error?

**Solution:**

**Distribution:**Binomial (n=100, p=0.5).**Calculate:**P(X > 55.**Method**: Use formula $P(X = k) = \binom{100}{k} (0.5)^k (0.5)^{100-k}$ for $k = 56$ to $100$, sum probabilities.**Result:**Probability of Type I error $\alpha \approx 13.56\%$.

**Conclusion**: Rejecting $H_0$ when observing more than 55 heads results in a 13.56% chance of Type I error.

### Example 2. Coin Toss: Type II Error Calculation

Assuming the coin is biased with P(heads) = 0.6, what is the probability of a Type II error if the same rejection criterion is used?

**Solution:**

**Distribution:**Binomial (n=100, p=0.6).**Calculate:**$P(X \leq 55)$.**Result:**Probability of Type II error $\beta \approx 17.9\%$.

**Conclusion**: With the coin actually biased $(P(\text{heads}) = 0.6)$, there's a 17.9% chance of a Type II error using the criterion of more than 55 heads for rejection, indicating a failure to detect the bias.

### Example 3. Lightbulb Lifespan: Type II Error Calculation

Given a sample of 30 lightbulbs with an average lifespan of 790 hours (standard deviation = 10 hours), what is the Type II error probability if the true average lifespan is 795 hours, using a 0.05 significance level?

**Solution**:

**Null Hypothesis (**$H_0$**)**: Mean lifespan $\mu = 800$ hours.**Alternative Hypothesis (**$H_1$**)**: Mean lifespan \mu < 800 hours.**Test Statistic**: Calculated as $-5.48$ under $H_0$.**Critical Value**: $-1.64$ for a 0.05 significance level.**Power of the Test**: The probability of detecting the true mean (795 hours) is approximately 0.86.**Type II Error Probability (**$\beta$**)**: Approximately 13.7%.

**Conclusion**: With the true average lifespan at 795 hours, the chance of not detecting this difference (thus making a Type II error) is about 13.7%.