3.3 - Binomial Random Variable

Printer-friendly versionPrinter-friendly version

This is a specific type of discrete random variable. A binomial random variable counts how often a particular event occurs in a fixed number of tries or trials. For a variable to be a binomial random variable, ALL of the following conditions must be met:

  • There are a fixed number of trials (a fixed sample size).
  • On each trial, the event of interest either occurs or does not.
  • The probability of occurrence (or not) is the same on each trial.
  • Trials are independent of one another.

Examples of binomial random variables:

  • Number of correct guesses at 30 true-false questions when you randomly guess all answers
  • Number of winning lottery tickets when you buy 10 tickets of the same kind
  • Number of left-handers in a randomly selected sample of 100 unrelated people


n = number of trials (sample size)

 p = probability event of interest occurs on any one trial

Example : For the guessing at true questions example above, n = 30 and p = .5 (chance of getting any one question right).

Probabilities for binomial random variables

The conditions for being a binomial variable lead to a somewhat complicated formula for finding the probability any specific value occurs (such as the probability you get 20 right when you guess as 20 True-False questions.)

We'll use Minitab to find probabilities for binomial random variables. Don't worry about the “by hand” formula. However, for those of you who are curious, the by hand formula for the probability of getting a specific outcome in a binomial experiment is:

\(P(x)= \frac {n!}{x!(n-x)!} p^x (1-p)^{n-x}\)

Evaluating the Binomial Distribution

One can use the formula to find the probability or alternatively, use Minitab or SPSS to find the probability. In the homework, you may use the method that you are more comfortable with unless specified otherwise.

Find P(x) for n = 20, x =3, and π = 0.4.

To calculate binomial random variable probabilities in Minitab:

  1. Open Minitab without data.
  2. From the menu bar select Calc > Probability Distributions > Binomial
  3. Choose Probability since we want to find the probability x = 3
  4. Enter 20 in the text box for number of trials
  5. Enter 0.4 in the text box for probability of success (note for Minitab versions over 14 this now labeled event probability)
  6. Since we do not have a column of data select the radio button for Input Constant and enter 3
  7. Click Ok

Minitab output:

Probability Density Function

Binomial with n = 20 and p = 0.4

P(X = x)

To calculate binomial random variable probabilities in SPSS:

  1. Open SPSS without data.
  2. Because SPSS will not let you do anything without data just type something into the first blank cell (e.g. enter the number 1 in the first cell in column 1) and be sure to then click any other cell. You need to do this to complete the entry of the value into that cell.
  3. From the menu bar select Transform > Compute Variable
  4. In the box for Target Variable enter any name (e.g. prob).
  5. Click inside the box for Numeric Expression (this should put the cursor inside this box)
  6. From the drop down menu for Function Group: if you want the exact probability e.g. P(X = x) then select PDF and Noncentral PDF. If you want the cumulative probability e.g. P(X <= x) then select CDF and Noncentral PDF
  7. Based on step 6, from the list of Functions and Special Variables select PDF.Binom if exact and CDF.Binom if cumulative.
  8. Click on the arrow next to the Delete button. This should put in the expression window the following: PDF.BINOM(?) if exact and CDF.BINOM(?) if cumulative.
  9. Replace ? with 3,20,0.4 These values represent the number of successes (3) from the number of trials (n) with probability of success (0.4). BE SURE TO INCLUDE THE COMMAS AND KEEP THE PARENTHESES!!
  10. Click OK
  11. In the Data worksheet you should see a column with the target label (e.g. prob) with the value 0.01 (If you click this cell and paste it into another document e.g. windows or notepad you will see the value is 0.012349690730879385 but the number is rounded to two decimals in SPSS worksheet.)
  12. If you used the above labeling the worksheet would look as follows:

In the following example, we illustrate how to use the formula to compute binomial probabilities. If you don't like to use the formula, you can also just use Minitab to find the probabilities.

Example by hand:Cross-fertilizing a red and a white flower produces red flowers 25% of the time. Now we cross-fertilize five pairs of red and white flowers and produce five offspring.

Find the probability that:

a. There will be no red flowered plants in the five offspring.

X = # of red flowered plants in the five offspring. Here, the number of red flowered plants has a binomial distribution with n = 5, p = 0.25.

\(P(X=0)=\frac{5!}{0!(5-0)!} p^0 (1-p)^5 =1 \times 0.25^0 \times 0.75^5 =0.237\)

b. Cumulative Probability There will less than two red flowered plants.


\( P(X\ is\ 1\ or\ less)=P(X=0)+P(X=1)\)
\( = \frac{5!}{0!(5-0)!} 0.25^0 (1-0.25)^5+\frac{5!}{1!(5-1)!} 0.25^1 (1-0.25)^4\)
\( =0.237 +0.395=0.632 \)

In the previous example, part a was finding the P(X = x) and part b was finding P(X ≤ x). This latter expression is called finding a cumulative probability because you are finding the probability that has accumulated from the minimum to some point, i.e. from 0 to 1 in this example

To use Minitab to solve a cumulative probability binomial problem, return to Calc > Probability Distributions > Binomial as shown above. Now however, select the radio button for Cumulative Probability and then enter the respective Number of Trials (i.e. 5), Event Probability (i.e. 0.25), and click the radio button for Input Constant and enter the x-value (i.e. 1).

Expected Value and Standard Deviation for Binomial random variable

The formula given earlier for discrete random variables could be used, but the good news is that for binomial random variables a shortcut formula for expected value (the mean) and standard deviation are:

\(Expected\ Value=np\)    \(Standard\ Deviation=\sqrt {np(1-p)}\)

After you use this formula a couple of times, you'll realize this formula matches your intuition. For instance, the “expected” number of correct (random) guesses at 30 True-False questions is np = (30)(.5) = 15 (half of the questions). For a fair six-sided die rolled 60 times, the expected value of the number of times a “1” is tossed is np = (60)(1/6) = 10. The standard deviation for both of these would be, for the True-False test

\(\sqrt{30 \times 0.5 \times (1-0.5)}=\sqrt{7.5}=2.74\)

and for the die

\(\sqrt{60 \times \frac{1}{6}\times (1-\frac {1}{6})}=\sqrt{ \frac{50}{6}}=2.89\)