8 Random Variables

8.1 Describing Random Variables

A random variable is a random process that produces a number.

  • Typically, capital letters (often near the end of the alphabet) are used for random variables. Example:

\[ p(X = 3) = 0.2 \]

  • We will focus our attention on discrete random variables. A discrete random variable can only take on values from a finite or countable list of values. We will be especially interested in the finite case.

  • Any random process can be converted into a random variable by a function that maps outcomes in the sample space to numbers. In our text you will see notation like \(X: S \to R\) (X maps each outcome to a number) or \(X(HHT) = 2\) (counting the number of heads).

  • We will mostly work with random variables in two formats: (a) a table of values and probabilities, or (b) a formula that tells how to compute the probability for any specified value.

8.2 Probability Tables

First example

Here is an example probability table for a random variable we’ll call \(X\).

value 1 2 3 4
probability 0.4 0.3 0.2 0.1
  1. What properties must the numbers in such a table always have?

  2. What is \(p(X = 2)\)?

  3. What is \(p(X > 2)\)?

  4. What is \(p(X \mbox{ is even})\)?

Creating a probability table

  1. Create a probability table for the random variable \(H\), where \(H\) is the number of heads observed when flipping 4 fair coins. Start by determining all the possible values. Then for each value, determine its probability.

  2. Let \(X\) be the absolute value of the difference in the values of two fair 4-sided dice. For example, if you roll a 3 and a 1, the difference is 2. Create a probability table for \(X\). (What are the possible values?)

  3. Let \(D\) be the number of diamonds dealt in a 5 card hand.

    1. Create a probability table for \(D\).

    2. What is the most likely number of diamonds in such a hand?

8.3 Probability Functions

We can also describe random variables with formulas.

  1. Let \(Y\) be defined by \(p(Y = y) = y/10\) when \(y \in \{1, 2, 3, 4\}\).

    1. What is \(p(Y = 3)\)?

    2. Create a probability table for \(Y\).

  2. Suppose you keep flipping a coin until you get a head. Let \(F\) count the number of flips.

    1. What is \(p(F = 1)\)?

    2. What is \(p(F = 2)\)?

    3. What is \(p(F = 3)\)?

    4. What are the possible values for \(F\)?

    5. Can you come up with a formula for \(p(F = k)\)?

  3. Let \(X\) be the number of heads in \(n\) tosses of a fair coin.

    1. What are the possible values of \(X\)?

    2. Give a formula for \(p(X = k)\)?

    3. Give a formula for \(p(X = x)\)? (This is the same as the preceding part, but with different notation.)

  4. Now suppose the coin isn’t fair. Let \(p\) be the probability of getting a head on each flip. Let \(X\) be the number of heads in \(n\) flips.

    1. What is \(p(X=1)\) when \(n = 1\) and \(p = 0.75\)?

    2. What is \(p(X=1)\) when \(n = 2\) and \(p = 0.75\)?

    3. Make a probability table for \(X\) when \(n = 3\) and \(p = 0.75\).

    4. Determine a general formula for \(p(X = x)\) in terms of \(n\) and \(p\).

8.4 Binomial Distributions

The previous example illustrates a scenario that arises in many applications:

  1. A random process consists for \(n\) parts or steps (traditionally called trials).
  2. Each trial has two possible outcomes (traditionally called success and failure).
  3. The probability of success is the same (\(p\)) for each trial.
  4. The trials are independent of each other.
  5. Our random variable is the count of the number of successes in the \(n\) trials.

We will denote this \(X \sim \textsf{Binom}(n,p)\).

  1. Create a probability table for a \(\textsf{Binom}(2, 0.2)\) random variable.

  2. Create a probability table for a \(\textsf{Binom}(3, 1/4)\) random variable.