UPI Study › Courses › Discrete Mathematics › Free lessons › Lesson 6.1 Free with a free account
Random Variables in Discrete Probability
Discrete Mathematics · Chapter 6: Random Variables and Expected ValueSection 6.1 · lesson 35 of 878 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Discrete Mathematics.
Lesson complete
Earn the 4 college credits for Discrete Mathematics
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Expected Value: Meaning and Calculation →← Probability of Combination EventsNext lesson: Expected Value: Meaning and Calculation →
In this lesson
Turning outcomes into numbers - and saying how likely each number is.
- Define a random variable as a function
- Use the notation X = x and the support of X
- Tell discrete from continuous random variables
- Build and verify a probability mass function
Transcript
Everything said in the video, section by section (1,200 words). Read along, or search it.
Random Variables and Expected Value
Random Variables in Discrete Probability
Chapter six is about random variables and expected value. This first section builds the basic machinery. A precise way to turn the outcomes of a random process into numbers, and a precise way to say how likely each number is. Then section six point two uses that machinery to compute an expected value.
The Opening Problem
How Many Ads Before a Purchase?
A mobile game studio logs, for every player who opens the app today, how many in-app ads they view before making a purchase, if they make one at all. Some players view no ads, and buy immediately from a saved cart. Others view one, two, five, or more before deciding. The studio doesn't want to describe every player's session in prose. It wants a single quantity, call it X, that captures the number of ads viewed. Together with a precise statement of how likely each possible value of X is. That quantity, and the framework for describing its likelihood, is a random variable.
Definition 6.1.1
A Random Variable Is a Function
Despite the name, a random variable isn't random in any vague sense. It's a precisely defined function. Let S be the sample space of a random process. A random variable is a function X that assigns a real number, X of s, to every outcome s in S. The randomness lives entirely in which outcome actually occurs. The random variable is simply the fixed rule that converts whichever outcome occurs into a number.
2 Examples
Dice Sums and Ad Sessions
Consider rolling two fair six-sided dice. The sample space is the thirty-six equally likely ordered pairs, i comma j, each from one to six. That count comes from the multiplication rule. Define X as the sum of the two dice, i plus j. That's a genuine function on S. For instance, X of three comma four is seven, and X of six comma six is twelve. And notably, different outcomes can share the same value. X of one comma two, and X of two comma one, are both three. The ad-viewing scenario works the same way, even though its sample space can't be neatly listed. S is every possible player session today, and X of s is the number of ads that session includes. The rule defining X is just as precise as in the dice example, even though listing every session isn't practical.
6.1.2 Notation
X, Its Values, and the Event X = x
Random variables are conventionally named with capital letters, X, Y, Z. A lowercase letter, or a specific number, stands for one particular value the variable could take. The set of all values a random variable can take is called its support, or range. For the dice sum, the support is two through twelve. That distinction enables a compact notation for events. X equals x denotes the event that X takes the specific value x. Formally, the set of outcomes s where X of s equals x. So the probability that X equals seven means exactly, the probability that the two dice sum to seven. There's no need to re-describe the six outcomes that make it true, every time the event is mentioned. It's the same kind of compression sigma notation gave sums, back in section three point five.
6.1.3 Discrete Versus Continuous
Can the Values Be Listed?
Random variables split into two broad kinds, based on the shape of their support. A random variable is discrete if its possible values can be listed one at a time. That's a finite set, or a countably infinite one, like the non-negative integers. It's continuous if its values fill an entire interval of real numbers, with no gaps. Between any two possible values, there are infinitely many others. Here's a quick test. Imagine listing every possible value on an infinitely long sheet of paper, one after another. If that's possible, even if it never finishes, the variable is discrete. The dice sum and the number of ads viewed are both discrete. But the exact time a web page takes to load, or the exact weight of a manufactured part, are continuous. Continuous random variables need calculus-based tools, which fall outside this course. Chapter six focuses entirely on discrete random variables.
Definition 6.1.3
The Probability Mass Function
A discrete random variable's whole probability behavior is captured by one function, listing the probability of each possible value. It's called the probability mass function, or P M F, written p of x. It assigns to each possible value x the probability that X equals x. A valid P M F must satisfy two conditions. First, p of x is at least zero, for every possible value. Second, the values of p of x add up to one, over every possible value. That's because X must take exactly one of its values, with certainty.
Worked Example 6.1.1
Building the PMF of a Dice Sum
Here's the P M F for the sum of two fair dice. Since all thirty-six outcomes are equally likely, p of x is the number of outcomes giving sum x, divided by thirty-six. Only the single outcome one comma one gives a sum of two. So p of two is one thirty-sixth. The two outcomes, one comma two and two comma one, give a sum of three. So p of three is two thirty-sixths. And six outcomes give a sum of seven, so p of seven is six thirty-sixths. Completing the count for every sum, the counts run one, two, three, four, five, six, then back down to one. They add to thirty-six. So the probabilities add to one, and every entry is non-negative. It's a valid P M F.
Figure 6.1.1
A Triangular Shape
Plotted as a bar chart, the P M F has a characteristic triangular shape. It rises from one thirty-sixth at a sum of two, to a peak of six thirty-sixths at seven, then falls back symmetrically to one thirty-sixth at twelve. That shape reflects the counts. Sums near seven have far more contributing outcomes than sums near two or twelve.
Worked Example 6.1.2
Verifying a Proposed PMF
Here's a verification example. A login system tracks X, the number of failed attempts before a successful login, among sessions that succeed within two attempts. Historical data proposes a P M F. p of zero is zero point seven, p of one is zero point two, and p of two is zero point one. Is it valid? Condition one. All three values are non-negative. Condition two. Zero point seven, plus zero point two, plus zero point one, is exactly one. Both conditions hold, so this is a valid P M F.
Takeaways
A Rule, Its Values, Their Chances
To summarize. A random variable is a function assigning a real number to every outcome. The randomness lies in which outcome occurs, not in X, which is a fixed rule. Capital letters name random variables, and X equals x denotes the event that X takes the value x. The support is the set of all possible values. Discrete values can be listed one at a time. Continuous values fill an interval, and need tools outside this course. And a P M F gives each value's probability. Every entry is at least zero, and they add to one. Here's something to think about. Let X be the exact time a customer-service chatbot takes to generate its first response. Is X discrete, or continuous? Now suppose the system logs response time rounded to the nearest whole second. Has the nature of what's measured changed, or only how finely it's recorded? Explain what changes between the two versions, and what stays the same, using the listing test.
About Discrete Mathematics at UPI Study
Discrete Mathematics (Math 230) is a self-paced online course of 87 video lessons in 13 chapters, from logic and proof to counting, probability, graph theory and trees. It carries a NCCRS credit recommendation for 4 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus Every course with PRO →
Why take it here
Why students take Discrete Mathematics with UPI Study
Where the credit goes
Universities that work with NCCRS
Discrete Mathematics carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Random Variables in Discrete Probability
Is a random variable really a variable, or is it a function?
What does X = x mean, and what is the support of X?
How can I tell whether a random variable is discrete or continuous?
How do I check whether a proposed probability mass function is valid?
About the Discrete Mathematics course
How many college credits is Discrete Mathematics?
How much does Discrete Mathematics cost and what is included?
Which universities accept UPI Study credits?
How long does Discrete Mathematics take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 4 credits in Discrete Mathematics.
87 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
4 credits · NCCRSEnroll →