Discrete Random Variables

Discrete Random Variables: Mastering the Basics | CFA Level I


This lesson is a prerequisite for the course. While you won’t be directly tested on its content in the exam, it’s assumed you’ve gained this knowledge or skill during your university studies. We strongly recommend reviewing this lesson, as its content may be essential for understanding subsequent parts of the curriculum.

In this lesson, we’ll dive into discrete random variables and explore some common probability distributions. We’ll cover the uniform and binomial distributions here, while leaving the normal and lognormal distributions for the next lesson.

Discrete vs. Continuous Random Variables

As you might recall from our previous lesson on probability concepts, a random variable is an uncertain quantity or number. There are two basic types of random variables:

  • Discrete random variables have a countable number of possible outcomes. For example, the number of up days in a given month for a stock can be counted.
  • Continuous random variables have an infinite number of possible outcomes. One example is the time it takes for a stock to make a movement greater than 1%.

Now, let’s move on to two types of discrete distributions: discrete uniform distribution and binomial distribution.

Discrete Uniform Distribution

A discrete uniform random variable is one where all possible outcomes have the same probability, like rolling a fair dice. There are two important properties to remember:

  1. The sum of probabilities of all possible outcomes must equal 1.
  2. The cumulative distribution function (CDF) must start at 0 and end at 1.


Determine the probability of rolling a 2 on a fair 6-sided dice (p2) and the probability of rolling a number less than or equal to 2 (F2).

Since the dice is fair, all six outcomes are equally likely. So, the probability of rolling a 2 (p2) is 1/6. The probability of rolling a number less than or equal to 2 (F2) is the sum of the probabilities of rolling a 1 and rolling a 2, which is 1/6 + 1/6 = 1/3.

Bernoulli Distribution

One special case of the discrete distribution function is the Bernoulli distribution, where there are just two outcomes. These two outcomes can be labeled as success and failure. Their probabilities do not have to be uniform, but because success and failure are mutually exclusive, the sum of their probabilities must be 1.

Bernoulli trials can be conducted in sequence. For example, if there are 3 trials to be conducted, we can draw up a tree diagram of the various outcomes that can result from these 3 trials.

In the first trial, the probability of success is 0.6, and the probability of failure is 0.4. Assuming that the result of each trial is independent, we have the same probabilities of success and failure for each node in the second trial. The same is done for the third trial.

After 3 trials, we have 8 different outcomes for the experiment. Now, if we let the random variable X denote the number of successes in the experiment, can you identify the outcomes where X is equal to 2?

We are looking for outcomes with exactly 2 successes. We can identify these 3 outcomes as having exactly 2 successes.

Now what if we want to find the probability of having exactly 2 successful trials?

Since each trial is independent, we can use the simplified multiplication rule to find the probability of each outcome. There are exactly 2 successes and 1 failure for each outcome. Therefore, the probability for each of these outcomes is 0.62 x 0.4.

The probability P(x=2) is therefore 3 x 0.62, x 0.4.

This is an example of a binomial distribution, where n is the number of trials, and p is the probability of success.

Binomial Distribution

So can we have a general formula to compute the probability of having exactly x number of successes? As we can see from this example, the 3 terms in this equation are:

  • the number of ways where the number of successes is x.
  • the probability of success multiplied x times.
  • the probability of failure, which is 1 minus p, multiplied n minus x times.

We have learned in the previous topic that the combination formula can be used to count the number of ways to choose x from n number of trials. Therefore we can replace this term with nCx.

The general formula for a binomial distribution with n trials and probability p of success is:

P(X = x) = nCx * p^x * (1 – p)^(n – x)

Here, nCx denotes the number of combinations of choosing x successes from n trials.

Applying Binomial Distribution to Tracking Error

Tracking error is the difference between the total return of a portfolio and the total return of the associated index. For example, the portfolio might be a US equity fund, and the associated index could be the S&P 500. Let’s look at an example of how tracking errors can appear for four quarters:

QuarterFund Return (A)S&P500 Return (B)Tracking Error (A) – (B)

In this example, we see that 3 out of the 4 tracking errors are within the limits, representing an instance where X is equal to 3.


A fund manager claims that their US equity fund has a 0.8 probability of keeping within a plus or minus 1% tracking error from the S&P 500 return in any quarter. Calculate the probability of at least 3 quarters of success in keeping to this tracking error out of 4 successive quarters.

Step 1: Identify the binomial distribution parameters:

  • n (number of trials): 4 quarters
  • p (probability of success): 0.8

Step 2: Calculate the probability of at least 3 quarters of success (X = 3 or X = 4):

P(X ≥ 3) = P(X = 3) + P(X = 4) = C(4, 3) * (0.8)^3 * (0.2)^1 + C(4, 4) * (0.8)^4 * (0.2)^0 ≈ 0.82

Thus, the probability of at least 3 quarters of success is approximately 82%.


What is the expected number of quarters out of 4 that will NOT meet the tracking error of plus or minus 1%? What is the standard deviation of this number?

Step 1: Define the binomial distribution:

  • n (number of trials): 4 quarters
  • p (probability of success): 0.2 (probability of not meeting the tracking error)

Step 2: Calculate the expectation and variance:

  • Expectation (E[X]): n * p = 4 * 0.2 = 0.8
  • Variance (Var[X]): n * p * (1 – p) = 4 * 0.2 * 0.8 = 0.64

Out of 4 quarters, we would expect 0.8 quarters to not meet the tracking error of plus or minus 1%.

Step 3: Calculate the standard deviation:

Standard Deviation (SD[X]) = √(Var[X]) = √(0.64) = 0.8

The standard deviation of the number of quarters that will not meet the tracking error is 0.8.

Applying Binomial Distribution to Stock Price Movements

Consider a binomial model describing daily stock price movements. A stock has a 0.6 probability of an up move (U) and a 0.4 probability of a down move (D). The random variable X denotes the number of up moves, n represents the total number of days, and p signifies the probability of an up move.

Assign factors to the up and down moves. For instance, if the model predicts a 1% gain in an up move and a 1% loss in a down move, the factor for U is 1.01, and the factor for D is 1/1.01.

Example: Starting with a stock price of $100, what is the probability of having 3 consecutive up days, and what is the expected price after these 3 days?

Probability of 3 consecutive up days: (0.6)^3 = 0.216

Expected price: $100 * (1.01)^3 ≈ $103.03

Example: What is the probability of having 2 up days and 1 down day? What is the expected price in this case?

Probability of 2 up days and 1 down day: C(3, 2) * (0.6)^2 * (0.4)^1 ≈ 0.432

Expected price: $100 * (1.01)^2 * (1/1.01)^1 ≈ $101

That concludes this lesson on discrete random variables. In the next lesson, we will explore continuous random variables. See you soon!

✨ Visual Learning Unleashed! ✨ [Premium]

Elevate your learning with our captivating animation video—exclusive to Premium members! Watch this lesson in much more detail with vivid visuals that enhance understanding and make lessons truly come alive. 🎬

Unlock the power of visual learning—upgrade to Premium and click the link NOW! 🌟