Random Variables for Dummies

Agbaeze Henry
4 min readMay 11, 2023

--

A random variable is a value that can vary and is determined by chance. It’s like rolling a die, where the outcome (the number that shows up) can be any of the numbers from 1 to 6, and you don’t know which one it will be before you roll.

Technically, it is a function that assigns numerical values to the outcomes of a random experiment or event. Random variables can be either discrete or continuous. Discrete random variables have a finite or countable number of possible outcomes, while continuous random variables can take on an infinite number of values within a certain range or interval.

Imagine you are measuring the height of students in a high school. The height of each student can be considered a random variable. Since there is a range of possible heights and each student’s height is determined by various factors, the height of a student picked at random is a continuous random variable within a certain range (e.g., between 4 feet and 7 feet).

Here are some popular random variables to add to your toolkit.

  1. Uniform random variable:
    A uniform random variable represents a situation where all possible outcomes have an equal chance of occurring, like drawing a card from a well-shuffled deck of playing cards.

A uniform random variable can be either discrete or continuous. For a discrete uniform random variable, there is a finite set of outcomes, each with the same probability. For a continuous uniform random variable, there is an interval of possible outcomes, and any outcome within that interval has an equal probability density.

Mean and Variance:
Discrete: E[X] = (n + 1) / 2; Var(X) = (n² — 1) / 12
Continuous: E[X] = (a + b) / 2; Var(X) = (b — a)² / 12

Example: Picking a random person’s birthday from a group of people, assuming an equal chance of being born on each day of the year.

2. Bernoulli random variable:
A Bernoulli random variable represents a single event with only two possible outcomes, like passing or failing an exam.

A Bernoulli random variable is a discrete probability distribution characterized by a single probability parameter p, which represents the probability of success (e.g., passing). The probability of failure (e.g., failing) is 1-p.

Mean and Variance: E[X] = p; Var(X) = p(1-p)

Here is an example: A student takes a test and either passes (success) with probability p or fails (failure) with probability 1-p.

3. Binomial random variable:
A binomial random variable counts the number of successes in multiple independent events, each with two possible outcomes, like the number of questions answered correctly on a multiple-choice test.

A binomial random variable is a discrete probability distribution characterized by two parameters: the number of trials (n) and the probability of success (p). It represents the number of successes (k) in n independent Bernoulli trials, each with the same probability of success (p).

Mean and Variance: E[X] = np; Var(X) = np(1-p)

Example: A student answers 10 true-or-false questions on a quiz, and we count the number of correct answers.

4. Geometric random variable:
Easy explanation: A geometric random variable represents the number of trials required for the first success in a sequence of independent events, each with two possible outcomes, like the number of job interviews until getting a job offer.

A geometric random variable is a discrete probability distribution characterized by a single parameter p, which represents the probability of success. It models the number of trials needed until the first success is achieved in a sequence of independent Bernoulli trials.

Mean and Variance: E[X] = 1 / p; Var(X) = (1-p) / p²

Example: The number of job interviews a person attends before receiving their first job offer.

5. Exponential random variable:
An exponential random variable is a continuous random variable that is used to model the time or distance between successive events in a process where events happen independently and continuously at a constant average rate. The exponential distribution is often used to represent the time between events such as phone calls at a call center, customer arrivals at a store, or the time between failures of a machine.

The exponential random variable is characterized by a single parameter λ, called the rate parameter. The rate parameter represents the average number of events occurring in a unit of time or space.

Mean (Expected Value) and Variance of an exponential random variable:
Mean (Expected Value): E[X] = 1 / λ
Variance: Var(X) = 1 / λ²

The mean (or expected value) of an exponential random variable is the reciprocal of the rate parameter λ, while the variance is the square of the reciprocal of the rate parameter.

--

--