STA 112 Note

📚 STA 112 Note.pdf

Brief overview

This document introduces fundamental statistical concepts, covering probability theory, random variables, and their distributions. It provides the foundational knowledge required for statistical analysis and data interpretation.

Key points

  • Introduction to probability theory and counting principles.
  • Combinations of events and axioms of probability.
  • Understanding random variables and their distributions.
  • Properties of random variables and common probability distributions.
  • Continuous distributions, sampling, and data analysis methods.

1. Introduction to probability and counting principles

1.1 Probability basics

  • Probability: The logic of uncertainty, measuring how likely an event is to happen. It's also known as chance.
  • Purpose: Probability provides tools to understand and explain variations in random or nondeterministic experiments.
  • Applications: Useful in fields like physics, engineering, medicine, biology, finance, and political science.
  • Foundation: Probability theory is built upon set theory 4.

1.1.1 Key definitions

  • Experiment: A procedure to evaluate a hypothesis, investigate a phenomenon, or validate a theory.
  • Random experiment: An experiment whose outcome cannot be predicted beforehand. It generates a set of possible outcomes.
  • Sample space (S): The set of all possible outcomes of a random experiment.
  • Sample point: A single outcome that is an element of the sample space.
  • Event (A): A set of outcomes; a subset of the sample space.
  • Elementary event: An event containing only one sample point.
  • Impossible event (∅): The empty set, an event that cannot occur.
  • Certain event (S): The sample space itself, an event that is sure to occur 5.

1.1.2 Visualizing outcomes

  • Tree diagrams: Help find the product of sets, showing ordered triples of outcomes 6.
  • Contingency tables: Also called cross-tabulations, they list all possible outcomes for two or more events.

📝 Example: Outcomes of tossing two coins.

COIN 1COIN 2
H
HHH
TTH

Sample space: S={HH,HT,TH,TT}S = \{HH, HT, TH, TT\} 7.

1.1.3 Calculating probability

  • The probability P(A)P(A) of an event A is the ratio of the number of ways A can occur to the total number of equally likely outcomes in the sample space. P(A)=an=number of elements in Anumber of elements in SP(A) = \frac{a}{n} = \frac{\text{number of elements in } A}{\text{number of elements in } S} 8.
  • Equally likely: Implies fairness, meaning each outcome has an equal chance or probability.

📝 Example: Probability of rolling an even number on a fair die.

  • Event E (even number) = {2, 4, 6}. Number of ways n(E)=3n(E) = 3.
  • Sample space S = {1, 2, 3, 4, 5, 6}. Number of ways n(S)=6n(S) = 6.
  • P(E)=n(E)n(S)=36=12P(E) = \frac{n(E)}{n(S)} = \frac{3}{6} = \frac{1}{2} 9.

1.2 Principles of counting

  • Combinatorial analysis: Techniques to determine the number of possible outcomes without direct enumeration. This is crucial for calculating probabilities 10.

1.2.1 Factorial

  • Factorial (n!): The product of all positive integers from 1 to nn. n!=n×(n−1)×(n−2)×⋯×3×2×1n! = n \times (n-1) \times (n-2) \times \dots \times 3 \times 2 \times 1
  • By definition, 0!=10! = 1.

📝 Example:

  • 5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120
  • 8!=8×7×6×5×4×3×2×1=40,3208! = 8 \times 7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1 = 40,320 11.

1.2.2 Permutations

  • Permutation: An arrangement of objects in a specific order.
  • n-permutation: An arrangement of all nn objects.
  • r-permutation: An arrangement of rr objects chosen from nn objects, where order matters. Denoted as nPr^nP_r or P(n,r)P(n, r). nPr=n!(n−r)!^nP_r = \frac{n!}{(n-r)!}.

🔑 Important: nPn=n!^nP_n = n!.

1.2.3 Types of permutations

  • Permutations with repetitions: For nn objects with n1n_1 alike, n2n_2 alike, ..., nrn_r alike:
\dots n_r!}$$ * <span style="color: #ff9f29; font-weight: 700;">Circular permutations</span>: $n$ objects can be arranged in a circle in $(n-1)!$ ways. * <span style="color: #ff9f29; font-weight: 700;">Sampling without replacement</span>: An ordered sample of size $r$ from $n$ objects is an $r$-permutation, with $^nP_r$ possibilities. * <span style="color: #ff9f29; font-weight: 700;">Sampling with replacement</span>: There are $n^r$ different ordered samples of size $r$ from $n$ objects [13](#page=13). > **📝 Example:** Choosing students from a class of 25. > * (i) With replacement: $25 \times 25 = 625$ ways. > * (ii) Without replacement: $25 \times 24 = 600$ ways [14](#page=14). > **📝 Example:** Arranging letters in "NIGERIAN". > * The word has 8 letters: N I G E R A [1](#page=1) [2](#page=2). > * Arrangements: $\frac{8!}{2!2!} = \frac{40320}{4} = 10,080$ ways. > **📝 Example:** Arranging 9 people. > * (i) In a row: $9! = 362,880$ ways. > * (ii) Around a circular table: $(9-1)! = 8! = 40,320$ ways [15](#page=15). ### 1.2.4 Combinations * <span style="color: #ff9f29; font-weight: 700;">Combination</span>: A selection of $r$ elements from a collection of $n$ objects where order <span style="color: #ff9f29; font-weight: 700;">does not</span> count. Denoted as $^nC_r$, $C(n,r)$, or $\binom{n}{r}$. $$\binom{n}{r} = \frac{n!}{ (n-r)! r! } = \frac{^nP_r}{r!}$$. > **🔑 Important:** Combination is a permutation where the order of selected items does not matter. ### 1.2.5 Ordered partitions * <span style="color: #ff9f29; font-weight: 700;">Ordered partitions</span>: If a set A has $n$ elements, and $n_1 + n_2 + \dots + n_r = n$, there are $\frac{n!}{n_1! n_2! \dots n_r!}$ ways to divide A into $r$ ordered subsets (partitions) with specific sizes. This is identical to permutations with repetitions. > **📝 Example:** Forming a committee. > * Choose 3 men from 9 and 2 women from 5. > * Number of ways = $\binom{9}{3} \times \binom{5}{2} = 84 \times 10 = 840$ ways. > **📝 Example:** Answering exam questions. > * (i) A student answers 8 out of 10 questions: $\binom{10}{8} = 45$ choices. > * (ii) If the first 3 questions are mandatory, choose 5 from the remaining 7: $\binom{7}{5} = 21$ choices [17](#page=17). > **🔑 Belangrijk:** Understanding the difference between permutations (order matters) and combinations (order doesn't matter) is critical for correctly counting outcomes in probability problems. [12](#page=12) [16](#page=16). # 2. Combinations of events and axioms of probability ## 2.1 Combining events Events can be combined using set operations to form new events. * `<span style="color: #ff9f29; font-weight: 700;">Union (A∪B)</span>`: The event that occurs if A occurs, or B occurs, or both. * `<span style="color: #ff9f29; font-weight: 700;">Intersection (A∩B)</span>`: The event that occurs if both A and B occur. * `<span style="color: #ff9f29; font-weight: 700;">Complement (A')</span>`: The event that occurs if A does not occur. * `<span style="color: #ff9f29; font-weight: 700;">Mutually exclusive events</span>`: Events that cannot occur simultaneously (their intersection is the empty set, $A \cap B = \emptyset$). * `<span style="color: #ff9f29; font-weight: 700;">Independent events</span>`: Events where the occurrence of one does not affect the probability of the other. > The core idea: set operations let us describe complex outcomes from simpler ones. ### 2.1.1 Examples of event combinations Here are examples illustrating event combinations with a die roll and coin tosses. * <span style="color: #ff9f29; font-weight: 700;">Die Roll:</span> * Sample space $S = \{1, 2, 3, 4, 5, 6\}$. * Event A (even number) = $\{2, 4, 6\}$. * Event B (odd number) = $\{1, 3, 5\}$. * Event C (prime number) = $\{2, 3, 5\}$. * Event (even or prime): $A \cup C = \{2, 3, 4, 5, 6\}$. * Event (odd prime): $B \cap C = \{3, 5\}$. * Event (not prime): $C' = \{1, 4, 6\}$. * $A \cap B = \emptyset$ (mutually exclusive). * <span style="color: #ff9f29; font-weight: 700;">Coin Tosses (3 times):</span> * Sample space $S = \{HHH, HHT, HTH, HTT, THH, THT, TTH, TTT\}$. * Event A (two or more consecutive heads) = $\{HHH, HHT, THH\}$. * Event B (same tosses) = $\{HHH, TTT\}$. * $A \cup B = \{HHH, HHT, THH, TTT\}$. * $A \cap B = \{HHH\}$. ## 2.2 Axioms of probability These fundamental rules define what a probability function $P$ must satisfy for any event A in a sample space S. * <span style="color: #ff9f29; font-weight: 700;">Non-negativity:</span> $0 \le P(A) \le 1$. Probabilities are between 0 and 1. * <span style="color: #ff9f29; font-weight: 700;">Certainty:</span> $P(S) = 1$. The probability of the entire sample space occurring is 1. * <span style="color: #ff9f29; font-weight: 700;">Impossibility:</span> $P(\emptyset) = 0$. The probability of an impossible event is 0. * <span style="color: #ff9f29; font-weight: 700;">Addition Rule (Mutually Exclusive):</span> If A and B are mutually exclusive, then $P(A \cup B) = P(A) + P(B)$. For a sequence of mutually exclusive events $A_1, A_2, \dots$, $P(A_1 \cup A_2 \cup \dots) = P(A_1) + P(A_2) + \dots$. > Axioms are the bedrock rules that all valid probability calculations must follow. ### 2.2.1 Properties derived from axioms Several useful properties can be derived from the basic axioms. * <span style="color: #ff9f29; font-weight: 700;">General Addition Rule:</span> For any two events A and B, $P(A \cup B) = P(A) + P(B) - P(A \cap B)$. * <span style="color: #ff9f29; font-weight: 700;">Complement Rule:</span> For any event A, $P(A') = 1 - P(A)$. * <span style="color: #ff9f29; font-weight: 700;">Inclusion-Exclusion for Three Events:</span> $P(A \cup B \cup C) = P(A) + P(B) + P(C) - P(A \cap B) - P(A \cap C) - P(B \cap C) + P(A \cap B \cap C)$. * <span style="color: #ff9f29; font-weight: 700;">Monotonicity:</span> If $A \subseteq B$, then $P(A) \le P(B)$. * <span style="color: #ff9f29; font-weight: 700;">Difference Rule:</span> $P(A \setminus B) = P(A) - P(A \cap B)$. > Key takeaway: the probability of a union involves adding individual probabilities and subtracting their overlap to avoid double-counting. ## 2.3 Calculating probabilities Probabilities can be calculated using different definitions and formulas. ### 2.3.1 Classical definition This definition applies when all outcomes in a sample space are equally likely. * <span style="color: #ff9f29; font-weight: 700;">Formula:</span> $P(E) = \frac{k}{n}$, where $k$ is the number of outcomes in event E and $n$ is the total number of outcomes in the sample space S. ### 2.3.2 Relative frequency definition This definition is used when outcomes are not equally likely. * <span style="color: #ff9f29; font-weight: 700;">Formula:</span> $P(E) = \frac{f}{n}$, where $f$ is the frequency (number of times) event E occurs in $n$ trials. > Example: A bent coin tossed 50 times yields heads 35 times. The probability of heads is $35/50 = 0.7$. ### 2.3.3 Marginal and joint probabilities These terms describe probabilities in multi-event scenarios. * <span style="color: #ff9f29; font-weight: 700;">Marginal probability:</span> The probability of a single event occurring independently, e.g., $P(A)$. * <span style="color: #ff9f29; font-weight: 700;">Joint probability:</span> The probability of two or more events occurring together, e.g., $P(A \cap B)$. > **Decision Table: Marginal vs. Joint Probability** > | Type | Description | Example | > | :---------------- | :----------------------------------------- | :-------------------- | > | Marginal Probability | Probability of one event alone. | P(Female) | > | Joint Probability | Probability of two or more events together. | P(Female and First Class) | ## 2.4 Conditional probability Conditional probability measures the likelihood of an event occurring given that another event has already occurred. * <span style="color: #ff9f29; font-weight: 700;">Definition:</span> $P(B|A) = \frac{P(A \cap B)}{P(A)}$, provided $P(A) > 0$. > **Important:** Conditional probability changes the "universe" of possible outcomes to only those where the given event has occurred. ### 2.4.1 Examples of conditional probability * <span style="color: #ff9f29; font-weight: 700;">Two Dice:</span> Probability of one die being a 2 given the sum is 6. * $A = \{\text{at least a 2}\}$, $B = \{\text{sum is 6}\} = \{(1,5), (2,4), (3,3), (4,2), (5,1)\}$. * $A \cap B = \{(2,4), (4,2)\}$. * $P(A|B) = \frac{P(A \cap B)}{P(B)} = \frac{2/36}{5/36} = \frac{2}{5}$. * <span style="color: #ff9f29; font-weight: 700;">Two Children:</span> Probability both are boys given the younger is a boy. * $S = \{bb, bg, gb, gg\}$. * $A = \{\text{both boys}\} = \{bb\}$. * $B = \{\text{younger child is a boy}\} = \{bb, gb\}$. * $P(A|B) = \frac{P(A \cap B)}{P(B)} = \frac{1/4}{2/4} = \frac{1}{2}$. ## 2.5 Multiplication theorem This theorem relates joint and conditional probabilities. * <span style="color: #ff9f29; font-weight: 700;">For two events:</span> $P(A \cap B) = P(A) P(B|A)$. * <span style="color: #ff9f29; font-weight: 700;">For n events:</span> $P(A_1 \cap A_2 \cap \dots \cap A_n) = P(A_1) P(A_2|A_1) P(A_3|A_1 \cap A_2) \dots P(A_n|A_1 \cap \dots \cap A_{n-1})$. > This theorem allows us to calculate the probability of a sequence of events occurring by multiplying conditional probabilities. ## 2.6 Bayes' theorem Bayes' theorem allows us to update the probability of a hypothesis (event $A_i$) based on new evidence (event B). It is particularly useful for reversing conditional probabilities. * <span style="color: #ff9f29; font-weight: 700;">Formula:</span> $$ P(A_i|B) = \frac{P(A_i) P(B|A_i)}{\sum_{j=1}^{n} P(A_j) P(B|A_j)} $$ where $A_1, A_2, \dots, A_n$ form a partition of the sample space. > **Important:** Bayes' theorem is fundamental for updating beliefs as new information becomes available. ### 2.6.1 Example of Bayes' theorem Three machines (A, B, C) produce items with different defect rates. * Machine A: 50% of items, 3% defective. * Machine B: 30% of items, 4% defective. * Machine C: 20% of items, 5% defective. * <span style="color: #ff9f29; font-weight: 700;">a) Probability an item is defective:</span> $P(D) = P(A)P(D|A) + P(B)P(D|B) + P(C)P(D|C)$ $P(D) = (0.50)(0.03) + (0.30)(0.04) + (0.20)(0.05) = 0.015 + 0.012 + 0.010 = 0.037$. * <span style="color: #ff9f29; font-weight: 700;">b) Probability a defective item came from machine A:</span> $P(A|D) = \frac{P(A)P(D|A)}{P(D)}$ $P(A|D) = \frac{(0.50)(0.03)}{0.037} = \frac{0.015}{0.037} \approx 0.405$. ## 2.7 Independence of events Two events A and B are independent if the occurrence of one does not affect the probability of the other. * <span style="color: #ff9f29; font-weight: 700;">Condition for Independence:</span> Events A and B are independent if $P(A \cap B) = P(A) P(B)$. * If this condition is not met, the events are dependent. > Independence simplifies calculations: the probability of both occurring is simply the product of their individual probabilities. ### 2.7.1 Independence for three or more events * <span style="color: #ff9f29; font-weight: 700;">Three independent events (A, B, C):</span> * They are independent if $P(A \cap B \cap C) = P(A)P(B)P(C)$. * This also implies pairwise independence: $P(A \cap B) = P(A)P(B)$, $P(A \cap C) = P(A)P(C)$, and $P(B \cap C) = P(B)P(C)$. * <span style="color: #ff9f29; font-weight: 700;">Note:</span> Pairwise independence does not guarantee overall independence for three or more events. > **Example Check:** Family with three children. Event A (both sexes), Event B (at most one boy). > * $S = \{bbb, bbg, bgb, bgg, gbb, gbg, ggb, ggg\}$. > * $P(A) = 6/8 = 3/4$. > * $P(B) = 4/8 = 1/2$. > * $A \cap B = \{bgg, gbg, ggb\}$, so $P(A \cap B) = 3/8$. > * $P(A)P(B) = (3/4)(1/2) = 3/8$. Since $P(A \cap B) = P(A)P(B)$, A and B are independent. > **Example Check:** Family with two children. Event A (both sexes), Event B (at most one boy). > * $S = \{bb, bg, gb, gg\}$. > * $P(A) = 2/4 = 1/2$. > * $P(B) = 3/4$. > * $A \cap B = \{bg, gb\}$, so $P(A \cap B) = 2/4 = 1/2$. > * $P(A)P(B) = (1/2)(3/4) = 3/8$. Since $P(A \cap B) \ne P(A)P(B)$, A and B are dependent. > **🔑 Important:** Understanding combinations of events and the axioms of probability is crucial for building a solid foundation in statistical inference and data analysis. # 3. Random variables and their distributions (part 1) ## 3.1 Introduction to random variables * A <span style="color: #ff9f29; font-weight: 700;">random variable</span> assigns a unique numerical value to each outcome of a random experiment. * It's a real-valued function defined on the sample space of an experiment. * We often denote a random variable as $X$, mapping sample space elements $s$ to real numbers $x$. This is represented as $X: S \to \mathbb{R}$. > **🔑 Important:** Random variables convert experimental outcomes into measurable numbers. ## 3.2 Types of random variables A <span style="color: #ff9f29; font-weight: 700;">random variable</span> can be one of two main types: ### 3.2.1 Discrete random variables * These variables can only take on a specific, countable number of values. * Examples include the number of sales in an hour or the number of students in a class. ### 3.2.2 Continuous random variables * These variables can assume any value within a given interval. * Examples include the time it takes to travel home or a person's weight. | Discrete Examples | Continuous Examples | | :------------------------- | :------------------ | | Number of sales | Length | | Number of calls | Depth | | Shares of stock | Volume | | People on a queue | Time | | Mistakes per page | Weight | ## 3.3 Probability distribution for discrete random variables The <span style="color: #ff9f29; font-weight: 700;">probability mass function (PMF)</span>, denoted as $P(X = x_i)$, gives the probability that a discrete random variable $X$ takes on a specific value $x_i$. For a valid PMF, two conditions must be met: * $P(X = x_i) \ge 0$ for all possible values $x_i$. * The sum of probabilities for all possible values must equal 1: $\sum_{i=1}^{n} P(X = x_i) = 1$. > **🔑 Important:** The PMF assigns a probability to each distinct outcome. ### 3.3.1 Example: Flipping coins Consider flipping 3 coins. Let $X$ be the number of heads. The possible outcomes are {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}. The values $X$ can take are 0, 1, 2, and 3. The PMF is: * $P(X=0) = \frac{1}{8}$ (TTT) * $P(X=1) = \frac{3}{8}$ (HTT, THT, TTH) * $P(X=2) = \frac{3}{8}$ (HHT, HTH, THH) * $P(X=3) = \frac{1}{8}$ (HHH) The sum is $\frac{1}{8} + \frac{3}{8} + \frac{3}{8} + \frac{1}{8} = 1$. To find $P(X \le 1)$: $P(X \le 1) = P(X=0) + P(X=1) = \frac{1}{8} + \frac{3}{8} = \frac{4}{8} = \frac{1}{2}$. | $X$ | $P(X=x_i)$ | | :------ | :--------- | | 0 | $\frac{1}{8}$ | | 1 | $\frac{3}{8}$ | | 2 | $\frac{3}{8}$ | | 3 | $\frac{1}{8}$ | ### 3.3.2 Example: Rolling dice Consider rolling two dice. Let $X$ be the sum of the outcomes. There are 36 possible outcomes. The possible sums range from 2 to 12. The PMF for the sum of two dice is: To find $P(X > 4)$: $P(X > 4) = 1 - P(X \le 4) = 1 - [P(X=2) + P(X=3) + P(X=4)]$. $P(X > 4) = 1 - \left(\frac{1}{36} + \frac{2}{36} + \frac{3}{36}\right) = 1 - \frac{6}{36} = \frac{30}{36} = \frac{5}{6}$. ## 3.4 Expected values and variance of discrete random variables ### 3.4.1 Expected value (mean) The mean, or <span style="color: #ff9f29; font-weight: 700;">expected value</span> ($\mu$ or $E(X)$), of a discrete random variable $X$ is calculated by summing the product of each value and its probability: $$ \mu = E(X) = \sum_{i=1}^{n} x_i P(X = x_i) $$ ### 3.4.2 Variance and standard deviation * The <span style="color: #ff9f29; font-weight: 700;">variance</span> ($\sigma^2$ or $Var(X)$) measures the spread of the distribution. It's calculated as the expected value of the squared difference from the mean: $$ Var(X) = \sigma^2 = E[(X - \mu)^2 = E(X^2) - [E(X)]^2 $$ Where $E(X^2) = \sum_{i=1}^{n} x_i^2 P(X = x_i)$. * The <span style="color: #ff9f29; font-weight: 700;">standard deviation</span> ($\sigma$) is the square root of the variance and provides a measure of spread in the same units as the variable. $$ \sigma = \sqrt{Var(X)} = \sqrt{E(X^2) - [E(X)]^2} $$ > **🔑 Important:** Expected value is the long-run average outcome. Variance quantifies variability around that average. ### 3.4.3 Example: Flipping coins (continued) For the 3 flipped coins (from Section 3.3.1): * <span style="color: #ff9f29; font-weight: 700;">Mean:</span> $E(X) = (0 \times \frac{1}{8}) + (1 \times \frac{3}{8}) + (2 \times \frac{3}{8}) + (3 \times \frac{1}{8}) = 0 + \frac{3}{8} + \frac{6}{8} + \frac{3}{8} = \frac{12}{8} = \frac{3}{2}$. * <span style="color: #ff9f29; font-weight: 700;">Variance:</span> First, calculate $E(X^2)$: $E(X^2) = (0^2 \times \frac{1}{8}) + (1^2 \times \frac{3}{8}) + (2^2 \times \frac{3}{8}) + (3^2 \times \frac{1}{8}) = 0 + \frac{3}{8} + \frac{12}{8} + \frac{9}{8} = \frac{24}{8} = 3$. Now, calculate the variance: $Var(X) = E(X^2) - [E(X)]^2 = 3 - (\frac{3}{2})^2 = 3 - \frac{9}{4} = \frac{12}{4} - \frac{9}{4} = \frac{3}{4}$. * <span style="color: #ff9f29; font-weight: 700;">Standard Deviation:</span> $\sigma = \sqrt{\frac{3}{4}} = \frac{\sqrt{3}}{2}$. ## 3.5 Continuous random variables: Probability density functions For continuous random variables, we use a <span style="color: #ff9f29; font-weight: 700;">probability density function (PDF)</span>, denoted as $f(x)$. The PDF describes the relative likelihood for a continuous variable to take on a given value. Key properties of a PDF: * $f(x) \ge 0$ for all $x$. * The total area under the PDF curve must equal 1: $\int_{-\infty}^{\infty} f(x) dx = 1$. * The probability of the variable falling within an interval $[a, b]$ is the integral of the PDF over that interval: $P(a \le X \le b) = \int_{a}^{b} f(x) dx$. > **Note:** Unlike discrete variables, the value of $f(x)$ at a single point $x$ is not a probability. ### 3.5.1 Expected values and variance for continuous random variables The formulas for expected value and variance are similar to discrete variables, but use integrals instead of summations: * <span style="color: #ff9f29; font-weight: 700;">Expected Value (Mean):</span> $$ \mu = E(X) = \int_{-\infty}^{\infty} x f(x) dx $$ * <span style="color: #ff9f29; font-weight: 700;">Variance:</span> $$ Var(X) = \sigma^2 = E(X^2) - [E(X)]^2 $$ Where $E(X^2) = \int_{-\infty}^{\infty} x^2 f(x) dx$. ### 3.5.2 Example: PDF calculation Given a PDF $f(x) = \begin{cases} \frac{3}{10}(3x - x^2) & 0 \le x \le 2 \\ 0 & \text{otherwise} \end{cases}$ * <span style="color: #ff9f29; font-weight: 700;">Mean:</span> $E(X) = \int_{0}^{2} x \cdot \frac{3}{10}(3x - x^2) dx = \int_{0}^{2} \left(\frac{9x^2}{10} - \frac{3x^3}{10}\right) dx$ $E(X) = \left[\frac{9x^3}{30} - \frac{3x^4}{40}\right]_0^2 = \left[\frac{3x^3}{10} - \frac{3x^4}{40}\right]_0^2$ $E(X) = \left(\frac{3 ^3}{10} - \frac{3 ^4}{40}\right) - 0 = \frac{24}{10} - \frac{48}{40} = \frac{12}{5} - \frac{12}{10} = \frac{12}{5} - \frac{6}{5} = \frac{6}{5}$. * <span style="color: #ff9f29; font-weight: 700;">Expected value of $X^2$:</span> $E(X^2) = \int_{0}^{2} x^2 \cdot \frac{3}{10}(3x - x^2) dx = \int_{0}^{2} \left(\frac{9x^3}{10} - \frac{3x^4}{10}\right) dx$ $E(X^2) = \left[\frac{9x^4}{40} - \frac{3x^5}{50}\right]_0^2 = \left(\frac{9 ^4}{40} - \frac{3 ^5}{50}\right) - 0$. $E(X^2) = \frac{9 \times 16}{40} - \frac{3 \times 32}{50} = \frac{144}{40} - \frac{96}{50} = \frac{18}{5} - \frac{48}{25} = \frac{90}{25} - \frac{48}{25} = \frac{42}{25}$. * <span style="color: #ff9f29; font-weight: 700;">Variance:</span> $Var(X) = E(X^2) - [E(X)]^2 = \frac{42}{25} - \left(\frac{6}{5}\right)^2 = \frac{42}{25} - \frac{36}{25} = \frac{6}{25}$. ### 3.5.3 Example: Piecewise PDF Given a PDF $f(x) = \begin{cases} \frac{1}{4}x & 0 \le x \le 2 \\ \frac{1}{4}(4-x) & 2 \le x \le 4 \\ 0 & \text{otherwise} \end{cases}$ * <span style="color: #ff9f29; font-weight: 700;">Mean:</span> $E(X) = \int_{0}^{2} x \cdot \frac{1}{4}x \, dx + \int_{2}^{4} x \cdot \frac{1}{4}(4-x) \, dx$ $E(X) = \int_{0}^{2} \frac{x^2}{4} \, dx + \int_{2}^{4} \left(\frac{4x}{4} - \frac{x^2}{4}\right) \, dx = \int_{0}^{2} \frac{x^2}{4} \, dx + \int_{2}^{4} \left(x - \frac{x^2}{4}\right) \, dx$ $E(X) = \left[\frac{x^3}{12}\right]_0^2 + \left[\frac{x^2}{2} - \frac{x^3}{12}\right]_2^4$ $E(X) = \left(\frac{2^3}{12} - 0\right) + \left(\frac{4^2}{2} - \frac{4^3}{12}\right) - \left(\frac{2^2}{2} - \frac{2^3}{12}\right)$ $E(X) = \frac{8}{12} + \left(8 - \frac{64}{12}\right) - \left(2 - \frac{8}{12}\right) = \frac{2}{3} + \left(8 - \frac{16}{3}\right) - \left(2 - \frac{2}{3}\right)$ $E(X) = \frac{2}{3} + 8 - \frac{16}{3} - 2 + \frac{2}{3} = 6 + \frac{4-16}{3} = 6 - \frac{12}{3} = 6 - 4 = 2$. * <span style="color: #ff9f29; font-weight: 700;">Expected value of $X^2$:</span> $E(X^2) = \int_{0}^{2} x^2 \cdot \frac{1}{4}x \, dx + \int_{2}^{4} x^2 \cdot \frac{1}{4}(4-x) \, dx$ $E(X^2) = \int_{0}^{2} \frac{x^3}{4} \, dx + \int_{2}^{4} \left(\frac{4x^2}{4} - \frac{x^3}{4}\right) \, dx = \int_{0}^{2} \frac{x^3}{4} \, dx + \int_{2}^{4} \left(x^2 - \frac{x^3}{4}\right) \, dx$ $E(X^2) = \left[\frac{x^4}{16}\right]_0^2 + \left[\frac{x^3}{3} - \frac{x^4}{16}\right]_2^4$ $E(X^2) = \left(\frac{2^4}{16} - 0\right) + \left(\frac{4^3}{3} - \frac{4^4}{16}\right) - \left(\frac{2^3}{3} - \frac{2^4}{16}\right)$ $E(X^2) = \frac{16}{16} + \left(\frac{64}{3} - \frac{256}{16}\right) - \left(\frac{8}{3} - \frac{16}{16}\right) = 1 + \left(\frac{64}{3} - 16\right) - \left(\frac{8}{3} - 1\right)$ $E(X^2) = 1 + \frac{64}{3} - 16 - \frac{8}{3} + 1 = -14 + \frac{56}{3} = \frac{-42+56}{3} = \frac{14}{3}$. * <span style="color: #ff9f29; font-weight: 700;">Standard Deviation:</span> $Var(X) = E(X^2) - [E(X)]^2 = \frac{14}{3} - ^2 = \frac{14}{3} - 4 = \frac{14-12}{3} = \frac{2}{3}$ [2](#page=2). $\sigma = \sqrt{\frac{2}{3}}$. > **🔑 Important:** For continuous variables, probabilities are areas under the PDF, and calculations involve integration. > **🔑 Important:** Understanding the difference between discrete and continuous random variables is fundamental for applying the correct probability functions and calculation methods. # 4. Random variables and their distributions (part 2) ## 4.1 Probability density function for continuous random variables A <span style="color: #ff9f29; font-weight: 700;">continuous random variable</span> has an associated probability density function (PDF), denoted by $f(x)$. This function describes the likelihood of the variable taking on a value within a given range. > The PDF $f(x)$ is always non-negative and the total area under its curve equals one. Key properties of a PDF: - $f(x) \geq 0$ for all $x$. - $\int_{-\infty}^{\infty} f(x) dx = 1$. - $P(a < X < b) = \int_{a}^{b} f(x) dx$. This represents the area under the PDF curve between $a$ and $b$. For continuous random variables, the probability of observing any single specific value is always zero. That is, $P(X = x) = 0$. > For continuous variables, probabilities are calculated over intervals, not single points. ### Calculating probabilities using PDF To find the probability that a continuous random variable $X$ falls between two values, $a$ and $b$, you integrate the PDF from $a$ to $b$. <span style="color: #ff9f29; font-weight: 700;">Example: Finding a constant in a PDF</span> If $f(x) = kx^2 + 1$ for $1 \leq x \leq 4$ and $0$ otherwise, we find $k$ by setting the total integral to 1. $\int_{1}^{4} (kx^2 + 1) dx = 1$ $k[\frac{x^3}{3} + x]_{1}^{4} = 1$ $k((\frac{64}{3} + 4) - (\frac{1}{3} + 1)) = 1$ $k(\frac{76}{3} - \frac{4}{3}) = 1$ $k(\frac{72}{3}) = 1 \implies 24k = 1 \implies k = \frac{1}{24}$. So, the valid PDF is $f(x) = \frac{1}{24}(x^2 + 1)$ for $1 \leq x \leq 4$. [ ] [62](#page=62). <span style="color: #ff9f29; font-weight: 700;">Example: Calculating probability from a PDF</span> Using $f(x) = \frac{1}{24}(x^2 + 1)$ for $1 \leq x \leq 4$, calculate $P(2 < X \leq 3)$. $P(2 < X \leq 3) = \int_{2}^{3} \frac{1}{24}(x^2 + 1) dx$ $= \frac{1}{24} [\frac{x^3}{3} + x]_{2}^{3}$ $= \frac{1}{24} [(\frac{27}{3} + 3) - (\frac{8}{3} + 2)]$ $= \frac{1}{24} [(9 + 3) - (\frac{8}{3} + \frac{6}{3})]$ $= \frac{1}{24} [12 - \frac{14}{3}]$ $= \frac{1}{24} [\frac{36}{3} - \frac{14}{3}] = \frac{1}{24} \times \frac{22}{3} = \frac{22}{72} = \frac{11}{36}$. [ ] [63](#page=63). ### Piecewise PDFs Sometimes, a PDF is defined by different formulas over different intervals. To find probabilities over an interval that spans these pieces, integrate each piece separately over its respective range and sum the results. <span style="color: #ff9f29; font-weight: 700;">Example: Probability with a piecewise PDF</span> Given $f(x) = \begin{cases} \frac{1}{6}x & 0 \leq x \leq 3 \\ 2 - \frac{1}{2}x & 3 \leq x \leq 4 \\ 0 & \text{otherwise} \end{cases}$, find $P(2 \leq X \leq 4)$. - Integrate the first part from 2 to 3: $\int_{2}^{3} \frac{1}{6}x \, dx = [\frac{1}{12}x^2]_{2}^{3} = \frac{9}{12} - \frac{4}{12} = \frac{5}{12}$. [ ] [64](#page=64). - Integrate the second part from 3 to 4: $\int_{3}^{4} (2 - \frac{1}{2}x) \, dx = [2x - \frac{1}{4}x^2]_{3}^{4}$ $= (8 - \frac{16}{4}) - (6 - \frac{9}{4}) = (8 - 4) - (6 - 2.25) = 4 - 3.75 = 0.25 = \frac{1}{4}$. [ ]. - Sum the probabilities: $P(2 \leq X \leq 4) = \frac{5}{12} + \frac{1}{4} = \frac{5}{12} + \frac{3}{12} = \frac{8}{12} = \frac{2}{3}$. [ ] [65](#page=65). ## 4.2 Cumulative distribution function (CDF) for continuous random variables The <span style="color: #ff9f29; font-weight: 700;">cumulative distribution function</span> (CDF), denoted by $F(x)$, gives the probability that a continuous random variable $X$ is less than or equal to a specific value $x$. - $F(x_0) = P(X \leq x_0) = \int_{-\infty}^{x_0} f(x) dx$. > The CDF accumulates probability from $-\infty$ up to a given point $x_0$. <span style="color: #ff9f29; font-weight: 700;">Example: Calculating probability using CDF</span> If the CDF of a random variable $X$ is given by: $F(x) = \begin{cases} 0 & x < 0 \\ \frac{1}{32}(6x^2 - x^3) & 0 \leq x \leq 4 \\ 1 & x > 4 \end{cases}$ - Calculate $P(2 < X < 3)$: $P(2 < X < 3) = P(X \leq 3) - P(X \leq 2) = F - F $. $F = \frac{1}{32}(6 \times 3^2 - 3^3) = \frac{1}{32}(54 - 27) = \frac{27}{32}$ [3](#page=3). $F = \frac{1}{32}(6 \times 2^2 - 2^3) = \frac{1}{32}(24 - 8) = \frac{16}{32}$. $P(2 < X < 3) = \frac{27}{32} - \frac{16}{32} = \frac{11}{32}$. [ ] [67](#page=67). - Calculate $P(X \geq 1.8)$: $P(X \geq 1.8) = 1 - P(X < 1.8) = 1 - P(X \leq 1.8) = 1 - F(1.8)$. $F(1.8) = \frac{1}{32}(6 \times 1.8^2 - 1.8^3) = \frac{1}{32}(6 \times 3.24 - 5.832) = \frac{1}{32}(19.44 - 5.832) = \frac{13.608}{32} \approx 0.42525$. $P(X \geq 1.8) = 1 - 0.42525 = 0.57475$. [ ] [68](#page=68). ## 4.3 Converting between PDF and CDF The CDF can be derived from the PDF by integration. Conversely, the PDF can be obtained by differentiating the CDF. - To convert PDF to CDF: $F(x_0) = \int_{-\infty}^{x_0} f(x) dx$. - To convert CDF to PDF: $f(x) = \frac{d}{dx}F(x)$. <span style="color: #ff9f29; font-weight: 700;">Example: Finding CDF from a piecewise PDF</span> Given the PDF: $f(x) = \begin{cases} \frac{1}{8}x^2 & 0 \leq x \leq 2 \\ \frac{1}{8}x(4-x) & 2 \leq x \leq 4 \\ 0 & \text{otherwise} \end{cases}$ <span style="color: #ff9f29; font-weight: 700;">Step 1: Find CDF for $0 \leq x_0 \leq 2$</span> $F(x_0) = \int_{0}^{x_0} \frac{1}{8}x^2 dx = [\frac{1}{24}x^3]_{0}^{x_0} = \frac{1}{24}x_0^3$. [ ] [71](#page=71). <span style="color: #ff9f29; font-weight: 700;">Step 2: Find CDF for $2 \leq x_0 \leq 4$</span> First, find $F $ using the result from Step 1: $F = \frac{1}{24}(2^3) = \frac{8}{24} = \frac{1}{3}$. Now, integrate the second part of the PDF from 2 to $x_0$: $\int_{2}^{x_0} \frac{1}{8}x(4-x) dx = \int_{2}^{x_0} (\frac{1}{2}x - \frac{1}{8}x^2) dx$ $= [\frac{1}{4}x^2 - \frac{1}{24}x^3]_{2}^{x_0}$ $= (\frac{1}{4}x_0^2 - \frac{1}{24}x_0^3) - (\frac{1}{4}(2^2) - \frac{1}{24}(2^3))$ $= (\frac{1}{4}x_0^2 - \frac{1}{24}x_0^3) - (\frac{4}{4} - \frac{8}{24})$ $= \frac{1}{4}x_0^2 - \frac{1}{24}x_0^3 - (1 - \frac{1}{3})$ $= \frac{1}{4}x_0^2 - \frac{1}{24}x_0^3 - \frac{2}{3}$. The CDF for $2 \leq x_0 \leq 4$ is $F(x_0) = F + \int_{2}^{x_0} f(x) dx$ [2](#page=2). $F(x_0) = \frac{1}{3} + (\frac{1}{4}x_0^2 - \frac{1}{24}x_0^3 - \frac{2}{3})$ $F(x_0) = \frac{1}{4}x_0^2 - \frac{1}{24}x_0^3 - \frac{1}{3}$. [ ] [72](#page=72). <span style="color: #ff9f29; font-weight: 700;">Step 3: Combine results to form the full CDF</span> $F(x_0) = \begin{cases} 0 & x_0 < 0 \\ \frac{1}{24}x_0^3 & 0 \leq x_0 \leq 2 \\ \frac{1}{4}x_0^2 - \frac{1}{24}x_0^3 - \frac{1}{3} & 2 \leq x_0 \leq 4 \\ 1 & x_0 > 4 \end{cases}$ This can be simplified for the $2 \leq x_0 \leq 4$ range: $F(x_0) = \frac{6x_0^2 - x_0^3 - 8}{24}$. [ ] [73](#page=73). > **Important:** When working with continuous distributions, always use interval probabilities derived from integration. The probability of a single point is zero. > **Important:** For continuous random variables, the CDF $F(x)$ is always non-decreasing and approaches 0 as $x \to -\infty$ and 1 as $x \to \infty$. # 5. Properties of random variables and basic distributions ## 5.1 Properties of mean and variance The mean, or expected value, represents the long-run average of a random variable. The variance measures the spread or variability of a distribution. <span style="color: #ff9f29; font-weight: 700;">Properties of the Mean (E):</span> * <span style="color: #ff9f29; font-weight: 700;">Expectation of a constant</span>: For a constant $c$, $E(c) = c$. * <span style="color: #ff9f29; font-weight: 700;">Linearity of expectation</span>: For constants $a$ and $b$, $E(aX + b) = aE(X) + b$. * <span style="color: #ff9f29; font-weight: 700;">Expectation of a sum</span>: For random variables $X$ and $Y$, $E(X + Y) = E(X) + E(Y)$. This holds even if $X$ and $Y$ are not independent. * <span style="color: #ff9f29; font-weight: 700;">Expectation of a product</span>: If $X$ and $Y$ are independent, $E(XY) = E(X)E(Y)$. This may not hold if they are not independent. <span style="color: #ff9f29; font-weight: 700;">Properties of the Variance (Var):</span> * <span style="color: #ff9f29; font-weight: 700;">Variance of a constant</span>: For a constant $c$, $Var(c) = 0$. Constants do not vary. * <span style="color: #ff9f29; font-weight: 700;">Variance scaling</span>: For a constant $a$, $Var(aX) = a^2 Var(X)$. Multiplying a variable by $a$ scales its variance by $a^2$. * <span style="color: #ff9f29; font-weight: 700;">Variance of a linear transformation</span>: For constants $a$ and $b$, $Var(aX + b) = a^2 Var(X)$. The constant $b$ does not affect variance. * <span style="color: #ff9f29; font-weight: 700;">Variance of sum of independent variables</span>: If $X$ and $Y$ are independent, $Var(X + Y) = Var(X) + Var(Y)$. This also means $Var(X - Y) = Var(X) + Var(Y)$. If $X$ and $Y$ are not independent, $Var(X + Y) = Var(X) + Var(Y) + 2 Cov(X,Y)$. > <span style="color: #ff9f29; font-weight: 700;">🔑 Important:</span> Linearity applies to the mean ($E(aX+b) = aE(X)+b$), but variance scales by the square of the multiplier ($Var(aX+b) = a^2 Var(X)$). > **📝 Example:** If $E(X) = 10$ and $Var(X) = 4$, then $E(2X + 5) = 2 + 5 = 25$, and $Var(2X + 5) = 2^2 Var(X) = 4 = 16$ [10](#page=10) [4](#page=4). ## 5.2 Discrete probability distributions A probability distribution describes how values of a random variable are distributed across possible outcomes, detailing what values can occur, their likelihoods, and the variable's average behavior and variability. Discrete distributions assign probabilities to distinct, separate values. ### 5.2.1 Bernoulli distribution The Bernoulli distribution models a single trial with two possible outcomes: success or failure [1](#page=1). > **📝 Example:** A coin toss (heads/success, tails/failure), a student passing or failing an exam, or a weather condition being rain or no rain. * Key characteristics: * One trial only. * Two outcomes (success/failure). * Probability of success is $p$. * Probability of failure is $q = 1 - p$. * Probability Mass Function (PMF): $P(X=k) = p^k q^{1-k}$, where $k = 0$ or $1$. ### 5.2.2 Binomial distribution The Binomial distribution models the number of successes in a fixed number of independent Bernoulli trials. * Parameters: * $n$: Number of trials. * $p$: Probability of success in a single trial. * $q = 1 - p$: Probability of failure. * $X$: Number of successes in $n$ trials. * Notation: $X \sim Bin(n, p)$. <span style="color: #ff9f29; font-weight: 700;">Assumptions for Binomial Distribution:</span> * Fixed number of trials. * Two possible outcomes per trial. * Constant probability of success ($p$). * Independence of trials. <span style="color: #ff9f29; font-weight: 700;">Probability Mass Function (PMF):</span> The probability of exactly $x$ successes in $n$ trials is: $$ P(X=x) = \binom{n}{x} p^x (1-p)^{n-x}, \quad x = 0, 1, 2, \dots, n $$ where $\binom{n}{x} = \frac{n!}{x!(n-x)!}$ is the binomial coefficient, representing the number of ways to choose $x$ successes from $n$ trials. > **📝 Example:** If a seed has a $p = 0.7$ germination probability and 5 seeds are planted ($n=5$), the probability of exactly 3 seeds germinating is $P(X=3) = \binom{5}{3} (0.7)^3 (0.3)^2 \approx 0.3087$. <span style="color: #ff9f29; font-weight: 700;">Mean and Variance of Binomial Distribution:</span> * Mean (expected number of successes): $E(X) = np$. * Variance (spread of successes): $Var(X) = npq$. ### 5.2.3 Geometric distribution The Geometric distribution models the number of independent Bernoulli trials needed to achieve the first success. * Parameters: * $p$: Probability of success. * $q = 1 - p$: Probability of failure. * Notation: $X \sim Geo(p)$. <span style="color: #ff9f29; font-weight: 700;">Probability Mass Function (PMF):</span> The probability that the first success occurs on the $x$-th trial is: $$ P(X=x) = p q^{x-1}, \quad x = 1, 2, 3, \dots $$ This means the first $x-1$ trials must be failures, and the $x$-th trial must be a success. > **📝 Example:** If a maize seed germinates with probability $p = 0.3$ ($q=0.7$), the probability that the first germination occurs on the third trial ($x=3$) is $P(X=3) = (0.3)(0.7)^{3-1} = (0.3)(0.7)^2 = 0.147$. <span style="color: #ff9f29; font-weight: 700;">Mean and Variance of Geometric Distribution:</span> * Mean (expected trials for first success): $E(X) = \frac{1}{p}$. * Variance: $Var(X) = \frac{1-p}{p^2}$. > **📝 Example:** If $p = 0.25$, then $E(X) = \frac{1}{0.25} = 4$. On average, the first success occurs after 4 trials. ### 5.2.4 Poisson distribution The Poisson distribution models the number of occurrences of an event within a fixed interval (time or space) if events occur independently, at a constant average rate, and one at a time. * Parameter: * $\lambda$: The average number of occurrences in the interval. * Notation: $X \sim Poisson(\lambda)$. <span style="color: #ff9f29; font-weight: 700;">Probability Mass Function (PMF):</span> The probability of exactly $x$ events occurring is: $$ P(X=x) = \frac{e^{-\lambda} \lambda^x}{x!}, \quad x = 0, 1, 2, 3, \dots $$ where $e$ is the base of the natural logarithm. > **📝 Example:** If the average number of malaria patients arriving at a clinic per hour is $\lambda = 3$, the probability that exactly 2 patients arrive in one hour is $P(X=2) = \frac{e^{-3} 3^2}{2!} \approx 0.224$. <span style="color: #ff9f29; font-weight: 700;">Mean and Variance of Poisson Distribution:</span> * Mean: $E(X) = \lambda$. * Variance: $Var(X) = \lambda$. * A unique property is that the mean equals the variance. > **🔑 Important:** The Poisson distribution is often used to model rare events or counts over a period, like the number of accidents on a highway or the number of defects in a manufactured item. | Distribution | Mean | Variance | |----------------|---------|----------| | Bernoulli | $p$ | $pq$ | | Binomial | $np$ | $npq$ | | Geometric | $1/p$ | $(1-p)/p^2$ | | Poisson | $\lambda$ | $\lambda$ | > **🔑 Important:** For the entire topic, understand how the mean and variance properties apply to transformations of random variables and the key characteristics (PMF, mean, variance) of Bernoulli, Binomial, Geometric, and Poisson distributions, as these are foundational for statistical analysis. # 6. Continuous distributions, sampling, and data analysis ## 6.1 Normal distribution * The <span style="color: #ff9f29; font-weight: 700;">Normal distribution</span> is a common continuous probability distribution. * It is denoted as $X \sim N(\mu, \sigma^2)$. * $\mu$ represents the mean of the distribution. * $\sigma^2$ represents the variance. * $\sigma$ represents the standard deviation. ### 6.1.1 Probability density function (PDF) * The PDF for a normal distribution is: $$f(x) = \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}$$ * Here, $x$ is the value of the random variable. * $e$ is approximately 2.71828. * $\pi$ is approximately 3.14159. ### 6.1.2 Properties of the normal distribution curve A normal distribution has a bell shape with these properties: | Property | Description | | :----------------------- | :---------------------------------------- | | Symmetry | Symmetric about the mean ($\mu$). | | Central Tendency | Mean = Median = Mode. | | Total Area | The total area under the curve is 1. | | Asymptotic Behavior | Approaches the horizontal axis, never touches it. | | Deterministic Parameters | Completely defined by mean ($\mu$) and variance ($\sigma^2$). | ### 6.1.3 Standardization (Z-score) * To compare values from different normal distributions, we standardize them using a Z-score. * The Z-score formula is: $$Z = \frac{X - \mu}{\sigma}$$ * $X$ is the observed value. * $\mu$ is the mean. * $\sigma$ is the standard deviation. * A Z-score indicates how many standard deviations an observation is from the mean. > **📝 Example:** Maize bags average 50 kg with a 5 kg standard deviation. A bag weighing 60 kg has a Z-score of $\frac{60-50}{5} = 2$. This means it's 2 standard deviations above the mean. ### 6.1.4 Mean and variance * For a normal distribution $X \sim N(\mu, \sigma^2)$: * Mean: $E(X) = \mu$ * Variance: $Var(X) = \sigma^2$ ## 6.2 Sampling distributions * A <span style="color: #ff9f29; font-weight: 700;">sampling distribution</span> is the probability distribution of a sample statistic. * It is calculated from all possible samples of a fixed size from a population. * For instance, if we take many samples and calculate their means, the distribution of these means is the sampling distribution of the sample mean. > **📝 Example:** For a population {2, 4, 6} and samples of size 2 without replacement, the possible samples are (2,4), (2,6), and (4,6). The sample means are 3, 4, and 5. The sampling distribution of the sample mean assigns a probability of 1/3 to each of these means. ### 6.2.1 Types of sampling distributions * Sampling Distribution of the Sample Mean * Sampling Distribution of Sample Proportion * Sampling Distribution of Sample Variance ### 6.2.2 Sampling distribution of the sample mean * If samples of size $n$ are drawn from a population with mean $\mu$ and variance $\sigma^2$: * Mean of sample means: $E(\bar{X}) = \mu$ * Variance of sample means: $Var(\bar{X}) = \frac{\sigma^2}{n}$ * The standard deviation of this distribution is called the <span style="color: #ff9f29; font-weight: 700;">standard error</span>. ### 6.2.3 Sampling distribution of sample proportion * If $p$ is the population proportion: * Mean of sample proportions: $E(\hat{p}) = p$ * Variance of sample proportions: $Var(\hat{p}) = \frac{p(1-p)}{n}$ ### 6.2.4 Properties of sampling distributions | Property | Description | | :--------------------------- | :------------------------------------------ | | Mean | Equals the population mean ($E(\bar{X}) = \mu$). | | Variance | Decreases as sample size ($n$) increases. | | Normality | Becomes more normal as sample size increases. | | Inference Foundation | Forms the basis of statistical inference. | > **🔑 Important:** Sampling distributions are crucial for making inferences about a population from sample data. ## 6.3 Exploratory Data Analysis (EDA) * <span style="color: #ff9f29; font-weight: 700;">Exploratory Data Analysis (EDA)</span> involves examining, summarizing, and visualizing data. * Its goal is to understand data characteristics before applying formal statistical models. * EDA was notably promoted by statistician John Tukey. ### 6.3.1 Objectives of EDA * Understand data structure. * Numerically summarize data. * Graphically visualize data. * Detect outliers. * Check variable distributions. * Identify relationships among variables. * Guide further statistical modeling. ### 6.3.2 Types of data in EDA EDA techniques vary based on data type: | Data Type | Examples | Analysis Methods | | :-------------- | :-------------------------------------------------- | :-------------------------------------------------- | | Categorical | Gender, Religion, Blood group, State of origin | Frequency tables, Bar charts, Pie charts | | \- Discrete | Number of children, Number of accidents | Histograms, Boxplots, Stem-and-leaf plots, Scatter plots | | \- Continuous | Height, Weight, Income, Temperature | Histograms, Boxplots, Stem-and-leaf plots, Scatter plots | ## 6.4 Confirmatory Data Analysis (CDA) * <span style="color: #ff9f29; font-weight: 700;">Confirmatory Data Analysis (CDA)</span> uses statistical techniques to test hypotheses and validate assumptions. * It uses sample data to make inferences about a population. * EDA discovers patterns, while CDA tests hypotheses. ### 6.4.1 Objectives of CDA * <span style="color: #ff9f29; font-weight: 700;">Hypothesis Testing</span>: Test claims about population parameters. * <span style="color: #ff9f29; font-weight: 700;">Parameter Estimation</span>: Estimate unknown population values. * <span style="color: #ff9f29; font-weight: 700;">Model Validation</span>: Assess how well a model fits the data. * <span style="color: #ff9f29; font-weight: 700;">Decision Making</span>: Provide statistical evidence for conclusions. ### 6.4.2 Common tools and features of CDA | Tool/Feature | Description | | :---------------------- | :-------------------------------------------------- | | Tools | t-test, Chi-square test, ANOVA, Regression analysis | | Foundation | Based on probability theory. | | Requirements | Requires assumptions (e.g., normality, independence). | | Outputs | Produces p-values and confidence intervals. | | Purpose | Used for formal statistical inference. | ## 6.5 Relationship between EDA and CDA * EDA and CDA are complementary processes. * EDA is typically performed before CDA. * EDA helps in formulating hypotheses and understanding data. * CDA then confirms findings from EDA through rigorous testing. > **📝 Example:** In a dataset, EDA might reveal an unusually high value (an outlier) and suggest right skewness. CDA would then use methods like the IQR to formally identify the outlier and test if it significantly impacts statistical results. > **🔑 Important:** EDA is for exploration and discovery, while CDA is for confirmation and inference, making them essential partners in data analysis.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also