X

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

STAT175

Practical Manual

Practical Week 3 (Lab 2: Keno and Random variables)


Introduction
In this practical we will look at how to use Excel to find means and standard deviations of random
variables. Then we will apply the methods to the 15-number game in Keno.

A 12-sided die
Random variables
A regular dodecahedron has 12 faces, each shaped like a regular
pentagon. Such shapes can be used for dice games, with each face
marked by a number from 1 to 12. If the dodecahedral die is fair or
unbiased, each face (or number) will turn up with equal probability.
Define the random variable N as the number on the top face of the die.

The probability function table


We will now complete the probability function of N in the table below:

The first row represents the possible values


The second row representing the probability for each possible value.
n

Pr(N=n)

Now open an Excel spreadsheet and put the information in the table above into cells A1 to M2
(note that you dont have to type it all in use the highlight and drag feature).

In cell N2 type =sum(B2:M2) then press Enter. Is the sum what you expected, and why?

Means and standard deviations


Recall from lecture 2 that the mean (represented by or E(N)) is found by summing each possible
value multiplied by the probability for that value i.e. n * Pr(N=n).
In Excel we can get the mean by typing =B1*B2 into cell B3, highlighting and dragging the formula
along the row to M3.
This obtains n*Pr(N=n) but we need the sum of these to get the mean.
To get the sum we can highlight N2 and drag it down to N3
(or alternatively type =sum(B3:M3) and press Enter).

STAT175

Practical Manual

What is the value of the mean? Explain why it seems reasonable.

The variance 2 or Var(N) is (n )2 * Pr(N=n).


Into cell B4 type =((B1-N3)^2)*B2 to get the first component:
Now go back to the formula and replace N3 by $N$3. Why do we do this?

Highlight B4 and drag it across to M4. This gives (n )2 * Pr(N=n) for each value of n.
The variance is the sum of these so highlight N3 and drag it down to N4.
What is the value of the variance?

Finally the standard deviation (SD) may be of more interest.


We can calculate this by taking the square root of the value in N4.
In O4 type =sqrt(N4) to get the standard deviation or SD(N).
What is the value of SD? What does this value represent (Hint: look at the lecture 2 notes)?

15-number Keno
Now we repeat the calculations described above in a realistic game of 15-number Keno.
In 15-number Keno to play, you pay $1 and select 15 numbers out of 1 through 80. In each game, 20
of the 80 balls are drawn out at random. You win if you have 2 or fewer matches or 6 or more
matches; the amount won is according to the following table:
Match
$1 bet
wins

0
1
2
6
7
8
9
$11 $2 $1 $1 $3 $10 $50

10
11
12
13
14
15
$330 $2600 $20000 $60000 $110000 $250000

STAT175

Practical Manual

Probability of matching r numbers


The probability of matching r numbers in this example is 20Cr 60C15r / 80C15 .
Write a brief explanation of how this formula works.

In an Excel spreadsheet construct a table showing the probability function of the random variable R
(label the first cell in each row to keep track of your calculations).
Check that the probabilities sum to 1. Write out your table into the space below.

Now use Excel to calculate the mean and standard deviation of R, the number of matches.
Write a sentence explaining the practical meaning of the values for someone playing the game.

Probability of getting w winnings


Lets have a look at another random variable, W = winnings from a $1 bet.
In Excel, type another row showing the appropriate values of w corresponding to each value of r:
1. What value will you use for r = 3, 4 and 5? _____________________________
2. Which two rows contain the probability function of W? ____________________
Now calculate the mean and standard deviation of W. Explain the practical meaning of the values for
a gambler.

STAT175

Practical Manual

House margin
Recall that the percentage house margin is defined as 100 Expected loss / Cost of playing.
What is the percentage house margin in 15-number Keno?

If you bet $10 instead of $1, winnings are 10 times as high, except that the maximum amount won
cannot be higher than $250 000 (this rule only affects the payout for 13, 14 and 15 matches). Change
the values of W to the winnings for a $10 bet.
What effect does this have on the house margin?

Probability interval
Now go back to the results for the $1 bet (just press undo the back arrow several times) so that
you can see the mean and standard deviation again.
1. If you played 15-number Keno 1000 times, making a $1 bet each time, how would you be doing
on average?

2. In that case, why would you play 1000 times? Use Excel to find a 95% probability interval for the
total profit after 1000 games, using the formula n nC 1.96 n . What does this result say
about how you might be doing after 1000 games?

You might also like