We can define a random variable for a quantity of interest by assigning a numerical value to each event in a sample space. The sum of the probabilities for all values of a random variable is 1.
Example:
In an experiment of tossing a coin twice, the sample space is
{HH, HT, TH, TT}.
In this experiment, we can define random variable X as the total number of tails. Then X takes the values 0, 1 and 2.
The table illustrates the probability distribution for the above experiment.

The notation P(X = x) is usually used to represent the probability of a random variable, where the X is random variable and x is one of the values of random variable.
P(X = 0) = 1/4 is read as “The probability that X equals 0 is one-fourth.”
The above definition and example describe discrete random variables… those that take a finite or countable number of values. A random variable may also be continuous , that is, it may take an infinite number of values within a certain range.
Example:
A dart is thrown at a dartboard of radius 9 inches. If it misses the dartboard, the throw is discounted. Define a random variable X as the distance in inches from the dart to the center.
