Random variable is a function which maps the outcome of a simple random experiment to a real number. denoted by capital italized roman characters like or .

Suppose that a coin is tossed twice so that the sample space is . Let represent the number of heads that can come up. With each sample point we can associate a number for as shown below.

Sample pointHHHTTHTT
X2110

Types of Random Variable

  • Discrete
    • can take finite or countably infinite number of values
    • probability distribution PMF :
  • Continuous
    • takes on a noncountably infinite number of values
    • probability distribution PDF :

Probability Function

A probability function is a mathematical function that provides probabilities for the possible outcomes of the random variable, . It is typically denoted as .

  1. Probability Mass Function
    A probability mass function (PMF) is a function that gives the probability that a discrete random variable is exactly equal to a certain value. In other words, it maps each possible outcome of a discrete random variable to its probability of occurrence.
    If is discrete, then . In other words, the PMF for a constant, , is the probability that the random variable is equal to .
    Properties of PMF : - for x in sample space otherwise 0. - .

  2. Probability Density Function
    If the random variable is a continuous random variable, the probability function is usually called the probability density function (PDF). Contrary to the discrete case,
    Properties of PDF : - for x in sample space otherwise 0. - Area under the curve is equal to 1.

  3. Cumulative Distribution Function
    A cumulative distribution function (CDF), usually denoted , is a function that gives the probability that the random variable, , is less than or equal to the value .

Discrete Probability Distributions

Let be a discrete random variable, and suppose that the possible values that it can assume are given by arranged in some order. Suppose also that these values are assumed with probabilities given by:

It is convenient to introduce the probability function, also referred to as probability distribution, given by :

For this reduces to (1) while for other values of . In general, is a probability function if :

  1. where the sum is taken over all possible values of .

Expected Value and Variance of a Discrete Random Variable

Expected value or mean of discrete random variable is denoted by .
Formula basically says multiply each value by its respective probability and add all of them together.

Variance of a discrete random variable is given by Formula basically says take each value of x, subtract the expected value, square that value and multiply that value by its probability. Then sum all of those values.


  1. https://www.gs.washington.edu/academics/courses/akey/56008/lecture/lecture4.pdf
  2. http://users.stat.umn.edu/~helwig/notes/RandomVariables.pdf
  3. http://www.stat.yale.edu/Courses/1997-98/101/ranvar.htm
  4. https://www.stat.pitt.edu/stoffer/tsa4/intro_prob.pdf
  5. https://byjus.com/maths/random-variable/
  6. https://online.stat.psu.edu/stat500/lesson/3/3.1