Math 362 - Computer Lab #2 - Spring 2003
Introduction
to Probability Theory
Computer Lab 2: Finite Sample Spaces and Random Variables
One of the conclusions drawn from Lab #1 was that each outcome in the
sample space of an experiment could be assigned a number between 0 and
1, which describes how likely this particular outcome is to
occur. This number is the probability of each outcome. In this lab, we
further explore this concept on the examples of the rolling of two fair
dice and flipping 5 biased coins.
- Experiment #1
Consider the experiment of rolling two fair dice. We denote each
outcome by a pair of numbers corresponding to the numbers turned up by
each die. For instance (1,4) means that the first die turned up 1 and
the second 4.
- What is the sample space S1 of this experiment?
- If the dice are balanced, what is the probability of any particular outcome
in the sample space?
- Use Calc ->Random Data -> Integer... to
to simulate 100 experiments, placing your results in C1 and C2.
- To encode the outcomes, use the Calc ->Calculator...
and the expression 10*C1 + C2, storing the results in C3.
- Use Stat->Tables -> Tally... with both counts
and percents to estimate the probability of each outcome.
Then answer the following questions.
- Are 100 experiments enough to obtain good estimates of each probability?
Why or why not?
- How many experiments do you need to get reasonable estimates? How do you know?
- Consider the experiment of rolling two fair dice and let
X be the random variable that is the sum of the two numbers.
- Use the computer to simulate 100 roles of the dice in C4 and
C5 and the calculator to place the sum in C6.
- Use the tally command to estimate the probability of each outcome.
Plot the results in a graph.
- Can you calculate the probability of each outcome and explain the results of
the computer experiments?
- Simulate 10000 rollings of two dice and tally the number of occurrences
of each outcome. Then calculate the sum of the numbers obtained on each die
and graphs the results. Percentages describing the likelihood of each outcome
can then be used to estimate and plot the relevant probabilities.
- Consider a binomial random variable with n = 5 and p = 0.75.
- Simulating Bernoulli trials
- Use the Calc ->Random Data -> Bernoulli... to
to simulate 5 columns of 100 trials, placing your results in C1-C5.
- Use the Stat -> Tables -> Tally... to check
that the percentage of 1's obtained is reasonable.
- Simulating a binomial random variable
- Use the calculator to place the sum C1+C2+C3+C4+C5 in C6.
This simulates 100 observations of a binomial random variable with
n
= 5 and p = 0.75.
- Use Stat -> Tables -> Tally... to estimate
the probability of each event of the form X = x,
x= 0, 1,2, 3, 4, 5.
- Use Graph->Histogram... to produce a plot of
the counts for each possible value of X. Such a plot can be used to
give you an approximation of the
probability function of X.
- The distribution of X
The computer can calculate probabilities Pr (X = x),
where X is a binomial random variable. We will use this feature
obtain exact values for the probability function of X with
n = 5 and p = 0.75.
- Enter all possible values that X can take in say Column
C8.
- Use Calc -> Probability Distributions -> Binomial
to calculate the exact probabilities.
- Choose to calculate a Probability
- Enter 5 as the Number of trials and 0.75 as the Probability
of success.
- Use Column C8 as the Input column and enter the
column where you want the probabilities to be written in the
Optional strorage field.
- Then click OK
- Plot the exact probability mass function of X and compare
the result with the approximate graph you had before.
- Word Problems
From A First Course in Probability by Sheldon Ross, Prentice Hall, 2002.
- A communication channel transmits the digits 0 and 1. However, due to static,
the digit transmitted is incorrectly received with probability 0.2. Suppose that we
want to transmit an important message consisting of one binary digit. To reduce the
chance of error, we transmit 00000 instead of 0 and 11111 instead of 1. If the receiver
of the message uses majority decoding, what is the probability that the
message will be wrong when decoded? What independence assumption are you making?
- A student is getting ready to take an important oral examination and is
concerned about the possibility of having an on day or an
off day. He figures that if he has an on day, then each of his examiners
will pass him independently of each other, with probability 0.8, whereas, if he has
an off day, this probability will be reduced to 0.4. Suppose that the student will
pass the examination if a majority of the examiners pass him. If the student feels that
he is twice as likely to have an off day as he is to have an on day, should he request
an examination with 3 examiners or with 5 examiners?
Back to Math 362