This study material has been compiled from lecture slides and an audio transcript for the "ISE 205 Probability and Statistics" course, Week 3, focusing on Random Variables.
📚 Probability and Statistics: Random Variables (Week 3)
🎯 Introduction to Random Variables
In probability and statistics, a random variable is a fundamental concept that bridges the gap between experimental outcomes and numerical values. It allows us to quantify the results of random experiments, making them amenable to mathematical analysis.
📖 What is a Random Variable?
A random variable, typically denoted by a capital letter (e.g., X), is a real-valued function defined for every element within a sample space (S). Essentially, it assigns a numerical value to each possible outcome of a random experiment. The specific values that a random variable can take are usually represented by a lowercase letter (e.g., x).
✅ Key Concept: A random variable transforms non-numerical outcomes (like "Heads" or "Tails") into numerical values, or simply assigns a numerical value to a numerical outcome (like the sum of two dice).
🎲 Examples of Random Variables
Let's illustrate with a few common examples:
-
Coin Toss Experiment:
- Experiment: Tossing a coin two times.
- Sample Space (S): {HH, HT, TH, TT}
- Random Variable (X): Number of Heads obtained.
- Possible Values for X: {0, 1, 2}
- P(X=0) = P(TT) = 1/4 (Zero Heads)
- P(X=1) = P(HT, TH) = 2/4 = 1/2 (One Head)
- P(X=2) = P(HH) = 1/4 (Two Heads)
-
Rolling Two Dice:
- Experiment: Rolling two standard six-sided dice.
- Sample Space Size: 6 * 6 = 36 possible outcomes.
- Random Variable (X): Sum of the numbers on the top faces.
- Example Probability: P(X=10)
- Outcomes that sum to 10: {(4,6), (5,5), (6,4)}
- P(X=10) = 3/36 = 1/12
-
Purchasing Electronic Parts:
- Experiment: A person buys two electronic parts, each can be defective (a) or sound (s).
- Possible Outcomes & Probabilities:
- (a,a): 0.09
- (a,s): 0.21
- (s,a): 0.21
- (s,s): 0.49
- Random Variable (X): Number of sound parts purchased.
- Possible Values for X: {0, 1, 2}
- P(X=0) = P(a,a) = 0.09 (Zero sound parts)
- P(X=1) = P(a,s) + P(s,a) = 0.21 + 0.21 = 0.42 (One sound part)
- P(X=2) = P(s,s) = 0.49 (Two sound parts)
📊 Types of Random Variables
Random variables are broadly categorized into two main types:
1️⃣ Discrete Random Variables
📚 Definition: A discrete random variable is one whose values are obtained by counting. It can only take on a finite number of values or an infinitely countable number of values. These values are typically integers.
✅ Characteristics:
- Values can be listed.
- There are gaps between possible values.
💡 Examples:
- The number of heads when tossing a coin 3 times.
- The number of blue balls drawn from a bag.
- The number of children in a family.
- The number of defective items in a sample.
- Any variable representing "the number of..."
2️⃣ Continuous Random Variables
📚 Definition: A continuous random variable is one whose values are obtained by measurement or weighing, rather than by counting. It can take any value within a given interval, meaning there are infinitely many possible values between any two points.
✅ Characteristics:
- Values cannot be listed.
- Values are typically real numbers.
- Often associated with intervals.
💡 Examples:
- The lifespan of an electronic device.
- The time it takes to solve a problem.
- A person's weight or height.
- Temperature, volume, distance.
📈 Discrete Probability Distributions
For discrete random variables, we use specific functions to describe their probability distributions.
📚 Probability Function (Probability Mass Function - PMF)
The probability function, also known as the probability mass function (PMF), for a discrete random variable X is denoted as f(x). It gives the probability that the random variable X takes on a specific value x.
✅ Formula: f(x) = P(X=x)
⚠️ Conditions for a Valid Probability Function:
For a function f(x) to be a valid probability function for a discrete random variable, it must satisfy two crucial conditions:
- Non-negativity:
f(x) ≥ 0for all possible values of x. (Probabilities cannot be negative). - Summation to One:
Σ f(x) = 1for all possible values of x. (The sum of all probabilities for all possible outcomes must equal 1).
Example: Checking a Valid PMF
Consider the function f(x) = (x+2)/25 for x = 1, 2, 3, 4, 5.
- Calculate f(x) for each value:
f(1) = (1+2)/25 = 3/25f(2) = (2+2)/25 = 4/25f(3) = (3+2)/25 = 5/25f(4) = (4+2)/25 = 6/25f(5) = (5+2)/25 = 7/25
- Check Non-negativity: All
f(x)values (3/25, 4/25, 5/25, 6/25, 7/25) are greater than or equal to 0. ✅ - Check Summation to One:
Σ f(x) = 3/25 + 4/25 + 5/25 + 6/25 + 7/25 = (3+4+5+6+7)/25 = 25/25 = 1✅ Since both conditions are met,f(x)is a valid probability function for a discrete random variable.
📚 Cumulative Distribution Function (CDF)
The cumulative distribution function (CDF), denoted as F(x), gives the probability that the random variable X takes on a value less than or equal to a specific value x.
✅ Formula: F(x) = P(X ≤ x)
For a discrete random variable X with probability function f(x), its CDF F(x) is calculated by summing the probabilities of all values less than or equal to x:
✅ Calculation: F(x) = Σ f(t) for all t ≤ x
⚠️ Properties of a CDF:
- Range:
0 ≤ F(x) ≤ 1for all x. - Non-decreasing: If
x < y, thenF(x) ≤ F(y). As x increases, the cumulative probability either stays the same or increases.
Relationship between PMF and CDF:
For a discrete random variable, you can derive the PMF from the CDF:
✅ f(x) = F(x) - F(x-1) (This means the probability of X taking a specific value x is the cumulative probability up to x minus the cumulative probability up to the value just before x).
Example: Finding CDF from PMF Given a PMF: | x | f(x) | |---|------| | 0 | 0.1 | | 1 | 0.2 | | 2 | 0.3 | | 3 | 0.4 |
Let's find the CDF, F(x):
F(0) = P(X ≤ 0) = f(0) = 0.1F(1) = P(X ≤ 1) = f(0) + f(1) = 0.1 + 0.2 = 0.3F(2) = P(X ≤ 2) = f(0) + f(1) + f(2) = 0.1 + 0.2 + 0.3 = 0.6F(3) = P(X ≤ 3) = f(0) + f(1) + f(2) + f(3) = 0.1 + 0.2 + 0.3 + 0.4 = 1.0
So, the CDF would be:
F(x) =
{ 0, for x < 0
{ 0.1, for 0 ≤ x < 1
{ 0.3, for 1 ≤ x < 2
{ 0.6, for 2 ≤ x < 3
{ 1.0, for x ≥ 3
Example: Finding PMF from CDF
Given a CDF:
F(x) =
{ 0, for x < 0
{ 0.2, for 0 ≤ x < 1
{ 0.5, for 1 ≤ x < 2
{ 0.9, for 2 ≤ x < 3
{ 1.0, for x ≥ 3
Let's find the PMF, f(x):
f(0) = F(0) - F(x < 0) = 0.2 - 0 = 0.2f(1) = F(1) - F(0) = 0.5 - 0.2 = 0.3f(2) = F(2) - F(1) = 0.9 - 0.5 = 0.4f(3) = F(3) - F(2) = 1.0 - 0.9 = 0.1
So, the PMF would be: | x | f(x) | |---|------| | 0 | 0.2 | | 1 | 0.3 | | 2 | 0.4 | | 3 | 0.1 |
📊 Visual Representation of Distributions
- Probability Mass Function (PMF): Often represented by a probability histogram or a bar chart, where the height of each bar corresponds to the probability of a specific outcome.
- Cumulative Distribution Function (CDF): For a discrete random variable, the CDF is typically depicted as a step function, where the function value jumps at each possible value of the random variable.
💡 Practical Problem Solving with Discrete Random Variables
Let's apply these concepts to solve some common problems.
-
Defective Computers Probability Distribution:
- Scenario: A store receives 20 computers, 3 of which are defective. A school buys 2 computers randomly.
- Random Variable (X): Number of defective computers the school receives.
- Possible Values for X: {0, 1, 2}
- Goal: Find the probability distribution (PMF) for X.
- Solution Approach: Use combinations (hypergeometric distribution concept).
- Total ways to choose 2 computers from 20:
C(20, 2) = (20*19)/(2*1) = 190 - P(X=0): Choose 0 defective from 3 AND 2 non-defective from 17.
C(3,0) * C(17,2) / C(20,2) = 1 * (17*16/2) / 190 = 136 / 190 ≈ 0.7158 - P(X=1): Choose 1 defective from 3 AND 1 non-defective from 17.
C(3,1) * C(17,1) / C(20,2) = 3 * 17 / 190 = 51 / 190 ≈ 0.2684 - P(X=2): Choose 2 defective from 3 AND 0 non-defective from 17.
C(3,2) * C(17,0) / C(20,2) = 3 * 1 / 190 = 3 / 190 ≈ 0.0158
- Total ways to choose 2 computers from 20:
- PMF: | x | f(x) | |---|------| | 0 | 0.7158 | | 1 | 0.2684 | | 2 | 0.0158 | (Sum = 1.0000)
-
Probability of "At Most" for Bit Transmission Errors:
- Scenario: X is the number of erroneously transmitted bits in the next 4 bits. Given its probability distribution.
- Goal: Find
P(X ≤ 3). - Solution 1 (Direct Summation):
P(X ≤ 3) = P(X=0) + P(X=1) + P(X=2) + P(X=3) - Solution 2 (Complement Rule - often easier):
P(X ≤ 3) = 1 - P(X=4)- If
P(X=4) = 0.0001, thenP(X ≤ 3) = 1 - 0.0001 = 0.9999.
- If
-
Finding a Missing Probability in a PMF:
- Scenario: Given a partial PMF for X:
P(X=0)=0.07,P(X=2)=0.57,P(X=3)=0.13. - Goal: Find
P(X=1). - Solution: We know that the sum of all probabilities for a discrete random variable must equal 1.
P(X=0) + P(X=1) + P(X=2) + P(X=3) = 10.07 + P(X=1) + 0.57 + 0.13 = 10.77 + P(X=1) = 1P(X=1) = 1 - 0.77 = 0.23
- Scenario: Given a partial PMF for X:








