Probability Distributions and Hypothesis Testing

1. Introduction to Probability Distributions

A probability distribution is a function that describes the likelihood of obtaining the possible values that a random variable can assume. In simpler terms, it tells us how probable it is for a random variable to take on each of its possible values. Understanding these distributions is crucial for modeling real-world phenomena, from the number of defects in a manufacturing process to the arrival times of customers at a service desk.

We often categorize probability distributions into two main types: discrete and continuous.

1.1 Discrete Probability Distributions

A discrete probability distribution is used when the random variable can only take on a finite number of values or a countably infinite number of values. These values are typically whole numbers.

1.1.1 Bernoulli Distribution

The simplest discrete distribution is the Bernoulli distribution. It describes an experiment with only two possible outcomes: "success" (usually denoted by 1) and "failure" (usually denoted by 0). The probability of success is denoted by 'p', and the probability of failure is '1-p'.

For a random variable X following a Bernoulli distribution, the probability mass function (PMF) is: P(X=1) = p P(X=0) = 1 - p

The mean (expected value) of a Bernoulli distribution is E(X) = p, and the variance is Var(X) = p(1-p).

Example: A single coin flip. If "heads" is a success (p=0.5), then the probability of getting heads is 0.5, and the probability of getting tails (failure) is 0.5.

1.1.2 Binomial Distribution

The binomial distribution is an extension of the Bernoulli distribution. It describes the number of successes in a fixed number of independent Bernoulli trials, where each trial has the same probability of success 'p'.

Let 'n' be the number of trials and 'k' be the number of successes. The probability mass function (PMF) for a binomial distribution is: P(X=k) = C(n, k) * pk * (1-p)(n-k) Where C(n, k) is the binomial coefficient, calculated as n! / (k! * (n-k)!).

The mean of a binomial distribution is E(X) = np, and the variance is Var(X) = np(1-p).

Example: If you flip a fair coin 10 times (n=10, p=0.5), the binomial distribution can tell you the probability of getting exactly 7 heads (k=7).

Binomial Shortcut: Think of "Binomial" as "Two outcomes per trial, repeated many times." The key parameters are 'n' (number of trials) and 'p' (probability of success on each trial).
1.1.3 Poisson Distribution

The Poisson distribution is used to model the number of events occurring in a fixed interval of time or space, given that these events occur with a known constant average rate and independently of the time since the last event. It's often used for rare events.

Let 'λ' (lambda) be the average rate of events in the interval. The probability mass function (PMF) for a Poisson distribution is: P(X=k) = (e * λk) / k! Where 'k' is the number of events, and 'e' is the base of the natural logarithm (approximately 2.71828).

For a Poisson distribution, the mean and variance are both equal to λ: E(X) = λ, Var(X) = λ.

Example: The number of phone calls received by a call center per hour (if the average rate is known). The number of accidents on a particular stretch of highway per month.

Poisson Shortcut: Use Poisson for "counts of events over time/space" when you know the average rate (λ). It's good for rare occurrences.

1.2 Continuous Probability Distributions

A continuous probability distribution is used when the random variable can take on any value within a given range. These values are not restricted to specific points.

1.2.1 Uniform Distribution

The continuous uniform distribution describes a situation where all outcomes within a given interval [a, b] are equally likely.

The probability density function (PDF) for a continuous uniform distribution is: f(x) = 1 / (b - a) for a ≤ x ≤ b f(x) = 0 otherwise

The mean of a uniform distribution is E(X) = (a + b) / 2, and the variance is Var(X) = (b - a)2 / 12.

Example: A random number generator that produces numbers between 0 and 1. The time a bus arrives within a 15-minute window, assuming it's equally likely to arrive at any point within that window.

1.2.2 Normal Distribution (Gaussian Distribution)

The normal distribution is arguably the most important continuous probability distribution. It's a symmetrical, bell-shaped curve that is defined by its mean (μ) and standard deviation (σ). Many natural phenomena approximate a normal distribution.

The probability density function (PDF) for a normal distribution is: f(x) = (1 / (σ * sqrt(2π))) * e-((x-μ)2 / (2σ2))

The mean of a normal distribution is E(X) = μ, and the variance is Var(X) = σ2.

Standard Normal Distribution: A special case of the normal distribution with a mean (μ) of 0 and a standard deviation (σ) of 1 is called the standard normal distribution. It is often denoted by Z. We can convert any normal random variable X to a standard normal variable Z using the formula: Z = (X - μ) / σ

Example: Heights of adult males, IQ scores, measurement errors.

Normal Distribution Key Facts:
  • Symmetrical bell shape.
  • Mean, Median, and Mode are equal.
  • Defined by μ (mean) and σ (standard deviation).
  • Area under the curve represents probability.
  • Approximately 68% of data falls within ±1σ of the mean.
  • Approximately 95% of data falls within ±2σ of the mean.
  • Approximately 99.7% of data falls within ±3σ of the mean. (Empirical Rule)
1.2.3 Exponential Distribution

The exponential distribution is often used to model the time until an event occurs in a Poisson process. It describes the probability of the duration of time between events.

Let 'λ' be the rate parameter (the same rate parameter as in the Poisson distribution). The probability density function (PDF) is: f(x) = λe-λx for x ≥ 0 f(x) = 0 for x < 0

The mean of an exponential distribution is E(X) = 1/λ, and the variance is Var(X) = 1/λ2.

A key property of the exponential distribution is its "memoryless" property: the probability of an event occurring in the future is independent of how much time has already passed.

Example: The time until the next customer arrives at a store, the lifespan of electronic components.

2. Introduction to Hypothesis Testing

Hypothesis testing is a statistical method used to make decisions or draw conclusions about a population based on sample data. It involves testing a claim or assumption about a population parameter (like the mean or proportion).

The process starts with formulating two competing hypotheses: the null hypothesis and the alternative hypothesis.

2.1 Null Hypothesis (H₀)

The null hypothesis is a statement of no effect, no difference, or no relationship. It represents the status quo or a baseline assumption that we aim to test against. It always contains a sign of equality (=, ≤, or ≥).

Example: H₀: The average height of adult males is 175 cm (μ = 175).

2.2 Alternative Hypothesis (H₁ or Hₐ)

The alternative hypothesis is a statement that contradicts the null hypothesis. It represents what we suspect might be true if the null hypothesis is false. It can be directional (greater than or less than) or non-directional (not equal to).

Example:

  • H₁: The average height of adult males is not 175 cm (μ ≠ 175) - Two-tailed test.
  • H₁: The average height of adult males is greater than 175 cm (μ > 175) - One-tailed test.
  • H₁: The average height of adult males is less than 175 cm (μ < 175) - One-tailed test.

Hypothesis Testing Flow: State Hypotheses → Set Significance Level (α) → Collect Data → Calculate Test Statistic → Determine P-value → Make Decision (Reject or Fail to Reject H₀).

2.3 Significance Level (α)

The significance level, denoted by α (alpha), is the probability of rejecting the null hypothesis when it is actually true. This is also known as the Type I error rate. Common values for α are 0.05 (5%), 0.01 (1%), or 0.10 (10%). A lower α means a lower chance of making a Type I error, but it also increases the chance of making a Type II error (failing to reject H₀ when it's false).

2.4 Test Statistic

A test statistic is a value calculated from sample data that summarizes how far the sample results deviate from what is expected under the null hypothesis. The type of test statistic depends on the parameter being tested and the distribution assumed.

Common test statistics include:

  • z-statistic: Used for testing means or proportions when the population standard deviation is known, or for large sample sizes (due to the Central Limit Theorem).
  • t-statistic: Used for testing means when the population standard deviation is unknown and the sample size is small. It follows a t-distribution.
  • Chi-squared (χ²) statistic: Used for testing variances, independence of categorical variables, or goodness-of-fit.
  • F-statistic: Used in ANOVA (Analysis of Variance) to compare means of three or more groups, or in regression analysis.

2.5 P-value

The P-value is the probability of observing a test statistic as extreme as, or more extreme than, the one calculated from the sample data, assuming the null hypothesis is true.

Decision Rule based on P-value:

  • If P-value ≤ α, we reject the null hypothesis (H₀). The results are statistically significant.
  • If P-value > α, we fail to reject the null hypothesis (H₀). The results are not statistically significant.

It's important to remember that "failing to reject H₀" does not mean H₀ is true; it simply means the sample data did not provide sufficient evidence to reject it at the chosen significance level.

2.6 Types of Errors in Hypothesis Testing

There are two types of errors that can occur in hypothesis testing:

Decision H₀ is True H₀ is False
Fail to Reject H₀ Correct Decision Type II Error (β)
Reject H₀ Type I Error (α) Correct Decision

Type I Error: Rejecting a true null hypothesis. The probability of this error is α.

Type II Error: Failing to reject a false null hypothesis. The probability of this error is β.

Memory Trick for Errors:
  • Type I: You claim something is happening (reject H₀) when it's not. (False Positive)
  • Type II: You fail to claim something is happening (fail to reject H₀) when it actually is. (False Negative)

3. Common Hypothesis Tests

3.1 Z-test

Used to test hypotheses about a population mean (μ) when the population standard deviation (σ) is known, or when the sample size is large (n ≥ 30) and σ is unknown (using sample standard deviation 's' as an estimate).

Test Statistic Formula: z = (x̄ - μ₀) / (σ / √n) Where: x̄ = sample mean μ₀ = hypothesized population mean (from H₀) σ = population standard deviation (or sample s for large n) n = sample size

Example: A manufacturer claims their light bulbs last 1000 hours on average (μ₀ = 1000). The population standard deviation is known to be 50 hours (σ = 50). A sample of 100 bulbs (n=100) has a mean lifespan of 980 hours (x̄ = 980). We want to test if the true mean is different from 1000 hours at α = 0.05.

3.2 T-test

Used to test hypotheses about a population mean (μ) when the population standard deviation (σ) is unknown and the sample size is small (n < 30). It assumes the population is approximately normally distributed.

Test Statistic Formula: t = (x̄ - μ₀) / (s / √n) Where: x̄ = sample mean μ₀ = hypothesized population mean (from H₀) s = sample standard deviation n = sample size

The t-statistic follows a t-distribution with (n-1) degrees of freedom.

Example: A new teaching method is implemented in a class of 20 students (n=20). Their test scores have a mean of 85 (x̄ = 85) and a standard deviation of 8 (s = 8). We want to test if the average score is significantly higher than a historical average of 80 (μ₀ = 80) at α = 0.05.

Z vs. T Test: Use Z when σ is known or n is large. Use T when σ is unknown and n is small. T-distributions are wider and flatter than Z-distributions, especially for small n, accounting for the extra uncertainty from estimating σ.

3.3 Chi-Squared (χ²) Test

The Chi-squared test has several applications:

3.3.1 Goodness-of-Fit Test

Used to determine if a sample distribution matches a hypothesized theoretical distribution (e.g., uniform, normal, or a specific discrete distribution).

Test Statistic Formula: χ² = Σ [(Oᵢ - Eᵢ)² / Eᵢ] Where: Oᵢ = Observed frequency in category i Eᵢ = Expected frequency in category i under the null hypothesis The test statistic follows a χ² distribution with (k-1) degrees of freedom, where 'k' is the number of categories.

Example: Rolling a die 120 times. We expect each face (1-6) to appear 20 times (Eᵢ=20). We observe the actual frequencies (Oᵢ) and use the χ² test to see if the die is fair.

3.3.2 Test for Independence

Used to determine if there is a statistically significant association between two categorical variables.

Test Statistic Formula: Same as goodness-of-fit: χ² = Σ [(Oᵢⱼ - Eᵢⱼ)² / Eᵢⱼ] Where Oᵢⱼ is the observed frequency in cell (i,j) and Eᵢⱼ is the expected frequency in cell (i,j). Expected frequency Eᵢⱼ = (Row Total × Column Total) / Grand Total. Degrees of freedom = (number of rows - 1) × (number of columns - 1).

Example: Is there an association between smoking status (Smoker/Non-smoker) and lung cancer (Yes/No)? We collect data and compare observed counts with expected counts under the assumption of independence.

3.4 F-test (ANOVA)

Analysis of Variance (ANOVA) is used to compare the means of three or more independent groups to determine if there is a statistically significant difference between them. The F-test is the core of ANOVA.

Null Hypothesis (H₀): All group means are equal (μ₁ = μ₂ = ... = μ<0xE2><0x82><0x96>). Alternative Hypothesis (H₁): At least one group mean is different.

The F-statistic is the ratio of the variance between groups to the variance within groups. F = (Variance between groups) / (Variance within groups)

A large F-value suggests that the variation between group means is significantly larger than the variation within the groups, leading to the rejection of H₀.

Example: Comparing the effectiveness of three different fertilizers on crop yield. We measure the yield for crops treated with each fertilizer and use ANOVA to see if there's a significant difference in average yield across the three fertilizer groups.

4. Relationship between Probability Distributions and Hypothesis Testing

Probability distributions are the foundation upon which hypothesis testing is built.

  • Sampling Distributions: When we take samples from a population, the distribution of sample statistics (like the sample mean) forms a sampling distribution. The Central Limit Theorem states that for large sample sizes, the sampling distribution of the sample mean will be approximately normal, regardless of the population's distribution. This normality allows us to use z-tests and t-tests.
  • Determining P-values: To calculate the P-value, we need to know the probability of obtaining our observed test statistic (or a more extreme one) under the assumption that the null hypothesis is true. This probability is found using the relevant probability distribution (e.g., normal distribution for z-tests, t-distribution for t-tests, χ² distribution for chi-squared tests, F-distribution for F-tests).
  • Assumptions of Tests: Many hypothesis tests rely on assumptions about the underlying probability distribution of the data (e.g., normality for t-tests, specific distributions for goodness-of-fit tests). Violating these assumptions can invalidate the test results.

In essence, hypothesis testing uses the properties of probability distributions to quantify the evidence against a null hypothesis. We are essentially asking: "How likely is it to observe these sample results if the null hypothesis were true?" If the probability (P-value) is very low, we conclude the null hypothesis is unlikely.