CH2.4 - Random Variables (RVs)
Definition
A random variable (RV) is a function that assigns a real number to each outcome in the sample space of a random experiment.
Random variables play an important part in probability theory, and they are used to describe the outcomes of random experiments. In this chapter, we will discuss the properties of random variables and how they can be used to describe the outcomes of random experiments.
How do we represent random variables?
Random variables are represented by capital letters, such as X, Y, or Z. They are used to represent the outcomes of random experiments, and they can take on different values depending on the outcome of the experiment.
Let’s start with an example to help illustrate the concept of random variables.
Example
Ospreys are beautiful aquatic raptors that nest by the water on telephone poles and old “snag” trees. Every year when ospreys next, tehy can have no eggs up to a maximum of 3 eggs in the nest.
There is a 20% chance that there are no eggs, 40% chance that there is one egg, 30% change that there are two eggs, and a 10% chance that there are three eggs.
Question: What is the random variable in this example?
Let X be the RV representing the number of eggs in the osprey nest. The possible values of X are 0, 1, 2, and 3, depending on the outcome of the experiment.
Question: What is the probability model?
Defintions
PMF = probability mass function CDF = cumulative distribution function
Let’s make a table.
X | ||
---|---|---|
0 | .2 | F(0) = P(X 0) = .2 |
1 | .4 | F(1) = P(X 1) = .6 |
2 | .3 | F(2) = P(X 2) = .9 |
3 | .1 | F(3) = P(X 3) = 1 |
Total | 1 | F(3) = 1 |
The probability model for the random variable X is given by the probability mass function (PMF) and the cumulative distribution function (CDF). The PMF gives the probability of each possible value of X, while the CDF gives the probability that X is less than or equal to a given value.
Result: The random variable X represents the number of eggs in the osprey nest, and the probability model for X is given by the PMF and CDF.
python script for plotting PMF and CDF
Definition
Fulcrum: The balancing point of a lever
Question: The Mean of the mass pmf p(x) is the balancing point/fulcrum, called the expected value.
Lets represent this with an equation.
Now let’s make a table of the values.
X | ||
---|---|---|
0 | .2 | 0 |
1 | .4 | .4 |
2 | .3 | .6 |
3 | .1 | .3 |
Total | 1 | 1.3 |
Interesting Fact
The first column of the table is called the support of the random variable X, which is the set of all possible values that X can take.
Result: The expected value of the random variable X is 1.3, which represents the average number of eggs in the osprey nest.
What this example tells us?
Spread/Variability of the RV’s probability model is the variance.
This equation gives us the spread or variability of the probability model of the random variable X. The variance measures how much the values of X deviate from the expected value .
Example 2
Metal cylinder production
A company manufactures metal cylinders that are used in the construction of a particular type of engine. These cylinders, which must slide freely within an outer casing, are designed to have a diameter of 50mm. The company discovers, however, that the cylinders it manufactures can have a diameter anywhere between 49.5 and 50.5. Suppose that the RV, X is the diameter of a randomly chosen cylinder manufactured by the company. Since this random variable can take any value between 49.5 and 50.5, it is a continuous random variable.
Question: What are the diameter’s probability density function and cumulative distribution function?
We are given the following equation:
vertex form of the parabola
- →
Graping the PDF with the following python script
Practice for Quiz
To practice for the quiz on this unit, we can practice the Assignment 3 problems 1-6, and apply these methods for the different questions on the quiz.
Visit Quiz Practice - Random Variables for more.
Check out the Axiom page as well