Resource
What is a random variable?
In many experiments we can assign numerical values to the outcomes. For instance, if you roll a die, each outcome has a value from 1 through 6. If you ascertain the midterm test score of a student in your class, the outcome is again a number. We call a rule that assigns a number to each outcome of an experiment a random variable.
Random variable
A random variable is a rule $X$ that assigns a number, or value, to each outcome in the sample space of an experiment.
Examples

Roll a die; $X =$ the number facing up.
Values of $X:$ $1, 2, 3, 4, 5, 6$ 
Select a soccer player; $Y =$ the number of goals the player has scored during the season.
Values of $Y:$ $0, 1, 2, 3, 4, ...$ 
Flip a coin three times. $Z =$ the number of times heads comes up.
Values of $Z:$ $0, 1, 2, 3$
Types of random variable
A discrete random variable can take on only specific, isolated numerical values, like the outcome of a roll of a die, or the number of stocks in a portfolio. Discrete random variables that can take on only finitely many values (like the outcome of a roll of a die) are called finite random variables. Discrete random variables that can take on an effectively unlimited number of values (like the number of steps in an procedure) are infinite discrete random variables.A continuous random variable, on the other hand, can take on any values within a continuous range or an interval, like the temperature in Central Park, or the exact height of an athlete in meters.
Examples
Random variable \t Values \t Type
\\ Roll a die.
$X =$ the number facing up. \t ${0,1,2,3,4,5,6}$ \t Finite
There are only six possible values for $X.$ \\ Select a soccer player.
$Y =$ the number of goals the player has scored during the season. \t $0, 1, 2, 3, 4, ...$ \t Infinite discrete
There is no stated upper limit to the number of goals. \\ Weigh your pile of dirty laundry.
$Z =$ the exact weight in kg. \t All nonnegative real numbers \t Continuous
The weight can be any nonnegative number in a continuous range.
Some for you
$X =$ the number facing up. \t ${0,1,2,3,4,5,6}$ \t Finite
There are only six possible values for $X.$ \\ Select a soccer player.
$Y =$ the number of goals the player has scored during the season. \t $0, 1, 2, 3, 4, ...$ \t Infinite discrete
There is no stated upper limit to the number of goals. \\ Weigh your pile of dirty laundry.
$Z =$ the exact weight in kg. \t All nonnegative real numbers \t Continuous
The weight can be any nonnegative number in a continuous range.
Probability distribution of a finite random variable
Given a random variable $X$, then, depending on the outcome of the experiment, there is a certain probability that, for instance, $X$ will turn out to be 2. This probability is the probability of the event that $X = 2$: the event consisting of all outcomes that have an assigned $X$value of 2. To illustrate this let's look at an exmple: Throw a pair of fair dice, and take $X$ to be the sum of the numbers facing up. Then
Event that $X=2$ \t Event that you throw a 2
\\ \gap[20] $=$ Set of all outcomes that result in a sum of 2 \\ \gap[20] $= \{(1,1)\}$
\\
\\ Event that $X=3$ \t Event that you throw a 3
\\ \gap[20] $=$ Set of all outcomes that result in a sum of 3 \\ \gap[20] $= \{(1,2), (2,1)\}$
\\
\\ Event that $X=4$ \t Event that you throw a 4
\\ \gap[20] $=$ Set of all outcomes that result in a sum of 4 \\ \gap[20] $= \{(1,3), (2, 2), (3,1)\}$
\\
\\ ...
\\ Event that $X=12$ \t Event that you throw a 12
\\ \gap[20] $=$ Set of all outcomes that result in a sum of 12 \\ \gap[20] $= \{(6,6)\}$
Each of these events has a certain probability. For instance, the probability that $X = 2$ is $\frac{1}{36}$ because the event that $X = 2$ consists of 1 of the 36 possible (equally likely) outcomes. We write
\t $\displaystyle \qquad P(X = 2) = \frac{1}{36}$. \gap[20] \t The probability that $X = 2$ is $\frac{1}{36}$.
\\ \t !4! Similarly, the probability that $X = 3$ is $\frac{2}{36}$ because the event that $X = 3$ consists of 2 of the 36 possible outcomes. \\ \t $\displaystyle \displaystyle \qquad P(X = 3) = \frac{2}{36} = \frac{1}{18}$. \t The probability that $X = 3$ is $\frac{1}{18}$.
\\ \t $\displaystyle \displaystyle \qquad P(X = 4) = \frac{3}{36} = \frac{1}{12}$. \t The probability that $X = 4$ is $\frac{1}{12}$.
\\ \t $\qquad \cdots$
\\ \t $\displaystyle \displaystyle \qquad P(X = 12) = \frac{1}{36}$. \t The probability that $X = 12$ is $\frac{1}{36}$.
If we tabulate the probabilities of all the possible values of $X$ together, we get the probability distribution of $X$:
%A #[If we use the equation of the line to calculate the $y$coordinates, we get slightly different values, called predicted values (for which we use the symbol $\hat{y}$) from the original observed values shown in the table.][Si usamos la ecuación de la recta para calcular las coordenadas$y$, obtenemos valores, llamados valores pronosticados o predichos (para cuales usamos el símbolo $\hat{y}$) un poco distintos de los valores originales observados que se muestra en la tabla.]#
Coin tosses
You can think of a coin as a die with two faces: heads (H) and tails (T). So, if you toss a coin once, there are two outomes {H, T}. If you toss it twice, there are $2 \times 2 = 4$ outcomes {HH, HT, TH, TT}. If you toss it three times, there are $2 \times 2 \times 2 = 2^3 = 8$ outcomes {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}. In general, if you toss a coin $n$ times, there are $2^n$ possible outcomes. (A decision algorithm for constructing the outcome when $n$ coins are tossed consists of $n$ steps, in each of which thre are two choices: H or T. So, the total number of possible outcomes is $2 \times 2 \times \cdots \times 2$ $n$ times). Take $X$ to be the total number of heads that come up. First, the possible values of $X$ are $0, 1, 2, 3$. Now we calculate the probabilities for the probability distribution of $X$:
Event that $X = 0$ \t Event heads comes up 0 times
\\ \gap[20] $=$ Set of all outcomes with no heads
\\ \gap[20] = #[{TTT}][{ZZZ}]# \t The event that $X = 0$ consists of 1 outome.
\\ \t !3! %25 A decision algorithm for constructing an outcome with 0 heads is as follows: Start with three empty slots representing the outcomes of the three coin tosses. Then select 0 slots out of the three to place the H. There are $C(3,0) = 1$ possible outcomes. (The rest of the slots automatically get Ts, so there are no further decisions.) \\ %Tf, $P(X = 0) = \dfrac{1}{8}$ \t 1 outome out of the total of 8 equally likely outcomes.
\\
\\ Event that $X = 1$ \t Event heads comes up once
\\ \gap[20] $=$ Set of all outcomes with 1 head \\ \gap[20] = #[{HTT, THT ,TTH}][{CZZ, ZCZ ,ZZC}]# \t The event that $X = 1$ consists of 3 outomes.
\\ \t !3! %25 A decision algorithm for constructing an outcome with 1 head is as follows: Start with three empty slots representing the outcomes of the three coin tosses. Then select one slot out of the three to place the H. There are $C(3,1) = 3$ possible outcomes. (The rest of the slots automatically get Ts, so there are no further decisions.) \\ %Tf, $P(X = 1) = \dfrac{3}{8}$ \t 3 outomes out of the total of 8 equally likely outcomes.
\\
\\ Event that $X = 2$ \t Event heads comes up twice
\\ \gap[20] $=$ Set of all outcomes with 2 heads \\ \gap[20] = #[{HHT, HRH ,THH}][{CCZ, CAC ,ZCC}]# \t The event that $X = 2$ consists of 3 outomes.
\\ \t !3! %25 A decision algorithm for constructing an outcome with 2 heads is as follows: Start with three empty slots representing the outcomes of the three coin tosses. Then select 2 slots out of the three to place the H. There are $C(3,2) = 3$ possible outcomes. (The rest of the slots automatically get Ts, so there are no further decisions.) \\ %Tf, $P(X = 2) = \dfrac{3}{8}$ \t 3 outomes out of the total of 8 equally likely outcomes.
\\
\\ Event that $X = 3$ \t Event heads comes up three times
\\ \gap[20] $=$ Set of all outcomes with 3 heads \\ \gap[20] = #[{HHH}][{CCC}]# \t The event that $X = 3$ consists of one outome.
\\ \t !3! %25 A decision algorithm for constructing an outcome with 3 heads is as follows: Start with three empty slots representing the outcomes of the three coin tosses. Then select 3 slots out of the three to place the H. There are $C(3,3) = 1$ possible outcomes. \\ %Tf, $P(X = 3) = \dfrac{1}{8}$ \t 1 outome out of the total of 8 equally likely outcomes.
Now pretend you are tossing a coin %30 times. and take $X$ to be the total number of %33 that come up. There are then $2^{%30}=%32$ possible outcomes:
Using frequencies to obtain the probability distribution
Sometimes, we can only estimate the probability of each value of $X$ using relative frequencies. Recall that we obtain the relative frequency of an event by dividing its frequency by the total number of times the experiment is performed. (Would you like to review?) Here is an example: A survey of randomly selected shopping malls yields the following data on the number of movie screens they contain:Measurement classes?
The number of online Monday stock trades at OHaganStockTrades.com (a subsidiary of oHaganBooks.com) was measured for %57 Mondays in a row, with the following results:
The midpoint of the 0−99 range is $\dfrac{0+99}{2} = 59.5$, which we round to $50$.
The midpoint of the 100−199 range is $\dfrac{100+199}{2} = 149.5$, which we round to $150$.
Now try the exercises in %4, some of the %8, or move ahead to the next tutorial by pressing "Next tutorial" on the sidebar.
Last Updated: November, 2018
Copyright © 2017
Copyright © 2017