Probability – Expectation of Binomial Distribution
- Binomial distribution: a discrete probability distribution
- Involves a fixed number of trials, each with 2 possible outcomes: success or failure
- Each trial is independent and has the same probability of success
Notation used in Binomial Distribution
- n: number of trials
- p: probability of success in each trial
- q: probability of failure in each trial (q = 1 - p)
- X: random variable representing the number of successes in the n trials
The expectation (mean) of a binomial distribution is given by:
- E(X) = n * p
This represents the average number of successes in n trials.
Example: Expectation of Binomial Distribution
Suppose we have a fair coin that we flip 10 times. Let’s find the expectation.
- n = 10 (number of trials)
- p = 0.5 (probability of success: getting heads)
Using the formula E(X) = n * p:
- E(X) = 10 * 0.5 = 5
Therefore, the expectation is 5, which means we can expect to get 5 heads on average when flipping the coin 10 times.
Properties of Expectation of Binomial Distribution
- The expectation of a binomial distribution is always a whole number
- The expectation may or may not be equal to any of the possible values of X
- The expectation is affected by both n and p
Variance of Binomial Distribution
- The variance of a binomial distribution measures how the values of X are scattered around the expectation
- Variance represents the average of the squared deviations from the mean
The variance of a binomial distribution is given by:
- Var(X) = n * p * q
This represents the average squared deviation from the mean.
Example: Variance of Binomial Distribution
Continuing from the previous example, let’s find the variance of the binomial distribution.
- n = 10 (number of trials)
- p = 0.5 (probability of success: getting heads)
- q = 1 - 0.5 = 0.5 (probability of failure: getting tails)
Using the formula Var(X) = n * p * q:
- Var(X) = 10 * 0.5 * 0.5 = 2.5
Therefore, the variance is 2.5.
Standard Deviation of Binomial Distribution
- The standard deviation of a binomial distribution is the square root of the variance
- It measures the spread or dispersion of the values of X
- Standard Deviation = √(n * p * q)
This represents the average spread or dispersion of the values of X.
Properties of Standard Deviation
- The standard deviation of a binomial distribution can never be negative
- The standard deviation is affected by both n and p
- A larger value of n leads to a larger standard deviation
- A smaller value of p or q leads to a larger standard deviation
Example: Standard Deviation of Binomial Distribution
Continuing from the previous example, let’s find the standard deviation of the binomial distribution.
- n = 10 (number of trials)
- p = 0.5 (probability of success: getting heads)
- q = 1 - 0.5 = 0.5 (probability of failure: getting tails)
Using the formula Standard Deviation = √(n * p * q):
- Standard Deviation = √(10 * 0.5 * 0.5) = √(2.5) ≈ 1.58
Therefore, the standard deviation is approximately 1.58.
Expected Value of a Function of a Random Variable
- We can also find the expectation of a function of a random variable
- Let g(X) be a function of the random variable X
- The expectation of g(X), denoted E(g(X)), is given by the formula:
E(g(X)) = ∑(g(x) * P(X = x))
- Here, x represents each possible value of X and P(X = x) represents the probability of getting that value of X
Example: Expected Value of a Function of a Random Variable
Suppose we have a biased coin that we flip 3 times. Let’s find the expectation of the function g(X) = X^2.
- n = 3 (number of trials)
Using the formula E(g(X)) = ∑(g(x) * P(X = x)):
- When X = 0: g(X) = 0^2 = 0, P(X = 0) = (1/2)^3 = 1/8
- When X = 1: g(X) = 1^2 = 1, P(X = 1) = 3 * (1/2)^3 = 3/8
- When X = 2: g(X) = 2^2 = 4, P(X = 2) = 3 * (1/2)^3 = 3/8
- When X = 3: g(X) = 3^2 = 9, P(X = 3) = (1/2)^3 = 1/8
E(g(X)) = (0 * 1/8) + (1 * 3/8) + (4 * 3/8) + (9 * 1/8) = 16/8 = 2
Therefore, the expectation of g(X) = X^2 is 2.
Mean of a Continuous Random Variable
- In the case of a continuous random variable, the mean is called the expected value or expected mean
- Denoted by E(X) or μ
- Calculated by integrating the product of the random variable X and its probability density function (PDF) over its entire range
E(X) = ∫(x * f(x)) dx
- Here, f(x) represents the probability density function of X
Variance of a Continuous Random Variable
- Variance measures the spread or dispersion of a continuous random variable
- Denoted by Var(X) or σ^2
- Calculated by integrating the squared deviation of X from its mean, weighted by the probability density function (PDF), over the entire range of X
Var(X) = ∫((x - E(X))^2 * f(x)) dx
- Here, f(x) represents the probability density function of X
- A continuous random variable follows a uniform distribution if it has a constant PDF over a specified interval
- The PDF of a uniform distribution is given by:
f(x) = 1 / (b-a), a ≤ x ≤ b
- The expected value (mean) of a uniform distribution is given by:
E(X) = (a + b) / 2
- The variance of a uniform distribution is given by:
Var(X) = (b - a)^2 / 12
Suppose we have a uniform distribution over the interval [2, 8]. Let’s find the mean and variance.
- a = 2 (lower bound)
- b = 8 (upper bound)
Using the formulas:
- E(X) = (2 + 8) / 2 = 5
- Var(X) = (8 - 2)^2 / 12 = 36 / 12 = 3
Therefore, the mean is 5 and the variance is 3.
Normal Distribution
- One of the most important probability distributions in statistics
- Often referred to as the bell curve or Gaussian distribution
- It is characterized by its mean (μ) and standard deviation (σ)
- The PDF of a normal distribution is given by:
f(x) = (1 / sqrt(2πσ^2)) * e^(-(x - μ)^2 / (2σ^2))
- The mean (expected value) and variance of a normal distribution are equal to μ and σ^2, respectively
Example: Normal Distribution
Suppose we have a normal distribution with a mean of 70 and a standard deviation of 5. Let’s find the probability of a random variable falling within certain ranges.
- P(65 ≤ X ≤ 75) represents the probability of X being between 65 and 75
- Using the Z-score formula: Z = (X - μ) / σ
Z1 = (65 - 70) / 5 = -1
Z2 = (75 - 70) / 5 = 1
- Using a Z-table or technology, we can find the area under the curve between -1 and 1, which represents the probability
Therefore, P(65 ≤ X ≤ 75) ≈ 0.6826 (approximately 68.26%).
Conditional Probability
- Conditional probability is the probability of an event A occurring, given that event B has already occurred
- Conditional probability is denoted by P(A|B)
- The formula for conditional probability is:
P(A|B) = P(A ∩ B) / P(B)
- P(A ∩ B) represents the probability of both A and B occurring
Example: Conditional Probability
Suppose we have a deck of cards with 52 cards. Let A be the event of drawing a red card, and let B be the event of drawing a diamond.
- P(A) = 26/52 = 1/2 (probability of drawing a red card)
- P(B) = 13/52 = 1/4 (probability of drawing a diamond)
- P(A ∩ B) = 13/52 = 1/4 (probability of drawing a red diamond)
Using the formula P(A|B) = P(A ∩ B) / P(B):
- P(A|B) = (1/4) / (1/4) = 1
Therefore, given that a diamond was drawn, the probability of drawing a red card is 1.
Law of Total Probability
- The law of total probability allows us to find the probability of an event A by considering all the possible outcomes of another event B
- This law is based on the concept of partitioning or dividing the sample space into mutually exclusive events
P(A) = P(A|B1) * P(B1) + P(A|B2) * P(B2) + … + P(A|Bn) * P(Bn)
- B1, B2, …, Bn represent mutually exclusive events that partition the sample space, and P(B1), P(B2), …, P(Bn) represent their respective probabilities
Bayes’ Theorem
- Bayes’ theorem allows us to update the probability of an event A based on the occurrence of another event B
P(A|B) = (P(B|A) * P(A)) / P(B)
- P(A|B) represents the probability of event A given that event B has occurred
- P(B|A) represents the probability of event B given that event A has occurred
- P(A) and P(B) represent the probabilities of events A and B, respectively
Example: Bayes’ Theorem
Suppose a drug test is known to correctly identify 95% of drug users (true positive rate) and correctly identify 90% of non-users (true negative rate). The rate of drug users in the general population is 2%. Let A be the event of a positive drug test and B be the event of being a drug user.
- P(A|B) = 0.95 (probability of positive test given drug user)
- P(B) = 0.02 (probability of being a drug user)
- P(B|A) = ? (the probability of being a drug user given a positive test)
Using Bayes’ theorem: P(B|A) = (P(A|B) * P(B)) / P(A)
- P(B|A) = (0.95 * 0.02) / P(A)
To find P(A), we need to consider both true positives and false positives.
Relations and Functions
- A relation is a set of ordered pairs that establishes a relationship between two sets
- A function is a special type of relation in which each element of the first set (domain) corresponds to exactly one element of the second set (codomain)
- Functions are denoted by f(x), where x is the input and f(x) is the output
Types of Functions
- One-to-One (Injective) Function: Each element of the domain corresponds to a unique element in the codomain, and vice versa
- Onto (Surjective) Function: Each element of the codomain has at least one corresponding element in the domain
- One-to-One Correspondence (Bijective) Function: A function that is both one-to-one and onto
Composite Functions
- A composite function is formed by combining two functions, denoted as (f ∘ g)(x), where f and g are functions and x is the input
- The composite function (f ∘ g)(x) means applying g(x) first and then applying f(x)
- The domain of the composite function is the set of all inputs for which both g(x) and f(x) are defined
Inverse Functions
- An inverse function undoes the effect of a given function
- If f(x) and g(x) are inverse functions, then (f ∘ g)(x) = x and (g ∘ f)(x) = x for all values in their respective domains
- The inverse function is denoted as f^(-1)(x)
Example: Composite and Inverse Functions
Let f(x) = 2x + 3 and g(x) = x - 2. Find the composite function (f ∘ g)(x) and the inverse function f^(-1)(x).
- (f ∘ g)(x) = f(g(x)) = f(x - 2) = 2(x - 2) + 3 = 2x - 1
To find the inverse function f^(-1)(x):
- Step 1: Replace f(x) with y: y = 2x + 3
- Step 2: Swap x and y: x = 2y + 3
- Step 3: Solve for y: y = (x - 3) / 2
Therefore, the inverse function is f^(-1)(x) = (x - 3) / 2.