Numbers on outcomes
The topic Conditional probability and Bayes' formula worked with events: yes/no statements such as "the person is sick" or "the test is positive". We can now update their probabilities on new evidence. But the questions kept turning into numbers. How many of three test runs come back positive? How many suspicious words does a letter contain? What do two dice add up to? How many rolls until the first six?
A random variable attaches a number to every outcome. Formally it is a function
Roll two dice. The sample space has 36 equally likely outcomes , and the sum is a random variable. It sends to , and so do four other outcomes. Statements about are events, that is, sets of outcomes:
Nothing new is needed to compute such probabilities. Collect the outcomes where the variable takes the value, and use the rules from the earlier topics. Upper case is the variable; lower case is a value it can take.