Random variables
In a random experiment, a random variable (in short RV) is a numerical property or outcomes or events. For example, if we randomy select a person in a room, the weight of a person is a random variable, or the body height. We introduce the concept of random variables with an example and introduce new notation.
A box contains balls of colors red, green, and blue. Also, each ball has an exact weight of , or (see figure). We select a ball at random.
There are a couple of events we might be interested in, such as what color we pick
or the weight
We already require quite a lot of event names, like , , , and so on. With more colors or weights this problem gets worse. A random variable allows us to employ a more systematic way to denote events. They are used primarily for the numerical aspects of events (in this example the weight).
To be more precise, a random variable is simply a function, which has as inputs the possible outcomes of the experiment (the balls), and as output a number (the weight). Let us call this function (for "weight"). So for this experiment the machine is basically a scale.
It is important to note that this mapping from balls to weights, which is done with a function or machine, is in no way random and could be done entirely outside the context of probability theory. The machine simply takes a ball and spits out its weight. What makes the output random is the fact that input is random. Indeed, every time we perform the experiment of randomly choosing a ball, and we observe the output of the machine, we see that this output changes randomly.
We now introduce an important notation. Observe that the machine can map different inputs (outcomes of experiments) to the same output (weight). In the figure above, for example, there are several balls with weight . We denote the set of all inputs with the same output by
This denotes a subset of the sample space, thus it is an event, the event "weight is 3.1 kg". Similarly, all inputs to the function (or outcomes of the experiment) with the same output is denoted by
This is the event "weight is 3.2 kg", and thus, the event"weight is 4.1 kg" is
There are two advantages using this notation. First, as already mentioned, we do not need so many letters for events, and second, this notation is very descriptive - it is immediately clear that the event concerns all inputs with weight , something that is not necessarily clear with the notation and .
The name random variable is a bit misleading, as is simply a function from the sample space to numerical values. However, we can also regard as a variable (place holder) for the weight, which then changes its value randomly with every repetition of the experiment.
Two interesting facts:
- The events , , are pairwise disjoint (actually, they form a partition of ). This is true for every random variable, and is a fact we will use later again.
- We can also define the event , but because no ball has weight , this event will be empty.
Let's define random variables for a general random experiment:
Consider a random experiment. A function from the sample space to a set of values is called a random variable. The event "An outcome with value occurred" is denoted by
Consider an arbitrary number . We introduce the following notations:
- is the event "an outcome with value ". It is the union of all events with .
- is the event "an outcome with value ". It is the union of all events with .
- is the event "an outcome with value ". It is the union of all events with
- is the event "an outcome with value ". It is the union of all events with .
- is the event "an outcome with value in interval occurred". Clearly, it is the union of all events with . Often, we also use the notation .
Furthermore, it is straight forward to show the following:
- the events and are mutually exclusive for .
- the events form a partition of .
- the event is empty if is not one of the values .
The random experiment is flipping a coin times. The random variable is ="number of observed heads".
-
What is ?
-
What are the possible outputs of the function ?
-
Express the event using the different outcomes of the experiment.
-
Show that the events and are mutually exclusive.
-
Show that the events , ..., are pairwise mutually exclusive, and form a partition of .
-
Express the events as a union of some of the events .
Solution
- (two heads)
- =
- Clearly, because if there were an outcome in the intersection, this outcome would have exactly one head and also exactly two heads, which does not make sense.
- We have to show that for . This is clearly so, because an outcome in the intersection would have to have exactly heads and also exactly heads, which does not make sense.
- We have
A die is rolled twice. Consider the three random variables:
- ="sum of the two numbers"
- ="the number which is higher (if they are equal just take the first one)"
- ="the absolute value of the difference of the two numbers"
- The first roll shows a 5, the second one a 6. Determine the output of the three random variables for this outcome.
- Determine the possible values of the random variables and .
- Determine directly or with the help of the union of the events (where is , , or ).
Hint: the absolute value of a number is the positive part of the number. For example, the absolute value of is . We write .
Solution
-
-
We have
-
The sample space is
Possible outputs:
-
The sample space is
Possible outputs:
-
The sample space is
Possible outputs:
-
-
Direct (counting the relevant outcomes): , , . With the union: