Statsbeginner
Statsbeginner
  • Threads: 2
  • Posts: 7
Joined: Jun 23, 2013
June 23rd, 2013 at 1:24:23 PM permalink
Hello guys,
Please help me understand how to calculate the probability of the following situation.

Let’s say there are 80 cards on a table. Every card has a number from 1 to 80 and each card has a different number. I don't see the numbers.
1. What is the chance that I will pick the card with the number 3 (only 3) if I have 20 trials? Each card I picked goes away from the table after I pick it up.

2. What is the chance that I will pick the card with the number 5, 15, 25, 35, 45, 55, 65, 75 if I have 20 trials? Each card I picked goes away from the table after I pick it up.

Many thanks in advance :-)

Stats Beginner
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
June 23rd, 2013 at 2:20:46 PM permalink
The probability of catching a certain number in Keno is described by the hypergeometric distribution.
Let:
N = number of spots you mark
K = number of spots you catch
R = range of numbers drawn from
D = size of draw

Then the probability p of catching K out of N, when the game draws D from a field of R, is:
p(N,K,R,D) = C(N, K) * C(R-N, D-K) / C(R, D), where C(n, r) is the combinations function: how many unordered ways to select r elements from a set of n without replacement.

For question 1:
C(1, 1) * C(79, 19) / C(80, 20) = 0.25. In other words, you have a 1 in 4 chance of winning a one-spot keno ticket.

I'll let you figure out the rest.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
Statsbeginner
Statsbeginner
  • Threads: 2
  • Posts: 7
Joined: Jun 23, 2013
June 24th, 2013 at 12:37:15 AM permalink
Hi MathExtremist,
I feel it's not so hard for you ;-)
Many thanks for your answer, I understood how this works and even succeeded to build this function in the Excel. But in order to answer my second question I don't understand what value I need to change? I thought that now K should be 8, but the Excel says me that there is an error with this number in the formula I build. Can you help please?
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
June 24th, 2013 at 2:58:26 AM permalink
Both N and K need to be changed to 8.

In your first question, you wanted to know the probability of matching K=1 of N=1 spots.
In your second question you want to know the probability of matching K=8 of N=8 spots.

The following Excel formula answers your first question: =HYPGEOMDIST(1,1,20,80)
The following Excel formula answers your second question: =HYPGEOMDIST(8,8,20,80)

The following Excel formula calculates the probability of matching X of Y picks in Keno:

=HYPGEOMDIST(X,Y,20,80)

Just substitute X and Y accordingly. For example, to calculate the probability of matching 4 numbers when 9 were marked:

=HYPGEOMDIST(4,9,20,80)
Statsbeginner
Statsbeginner
  • Threads: 2
  • Posts: 7
Joined: Jun 23, 2013
June 24th, 2013 at 7:21:20 AM permalink
Hi JB,
Many thanks,
But I think that something is wrong with this stuff. I have used K=8 and N=8 and the result was totally surprising, p=0.0000043....
Before my calculations I felt that in the second case the probability should me much higher cause instead of catching only one number I can catch 8 numbers.
Can you please check it and tell me what I did wrong.
I have use the combin funcion in Excel as MathExtremist proposed.
p(N,K,R,D) = COMBIN(N, K) * COMBIN(R-N, D-K) / COMBIN(R, D)

I was confused using the HYPGEOMDIST function cause I didn't know exactly what is my Sample_s, Number_sample, Population_s and Number_pop
I am a real beginner, sorry :-)
Thanks for your help
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
June 24th, 2013 at 7:57:52 AM permalink
0.0000043 is correct. It is far less likely to match all 8 numbers (provided that you picked 8 numbers, in other words, a "bullseye") than to only match one of the 8 numbers. In fact, it is about 61317 times more likely to match 1 of 8 than it is to match 8 of 8.
7craps
7craps
  • Threads: 18
  • Posts: 1977
Joined: Jan 23, 2010
June 24th, 2013 at 8:34:34 AM permalink
Quote: Statsbeginner

I was confused using the HYPGEOMDIST function cause I didn't know exactly what is my Sample_s, Number_sample, Population_s and Number_pop

By clicking on the name of the function in Excel it (the click) will open up the Help section for you.
This is what my version of Excel spit out and more
"Syntax

HYPGEOMDIST(sample_s,number_sample,population_s,number_population)

Sample_s is the number of successes in the sample.

Number_sample is the size of the sample.

Population_s is the number of successes in the population.

Number_population is the population size.

Remarks..."

Teach yourself statistics
http://stattrek.com/probability-distributions/hypergeometric.aspx?Tutorial=Stat
winsome johnny (not Win some johnny)
Statsbeginner
Statsbeginner
  • Threads: 2
  • Posts: 7
Joined: Jun 23, 2013
June 24th, 2013 at 10:33:37 AM permalink
JB, you are totally right, matching 8 numbers is much harder than matching 1 number. And I really appreciate your help and the knowledge you gave me :-)
Simply I didn't explain my self properly.

So, there are 80 cards on a table. Every card has a number from 1 to 80 and each card has a different number. I don't see the numbers and I have 20 trials.
In order to win I need to pick one of the following cards: 5, 15, 25, 35, 45, 55, 65, 75. Each card I picked goes away from the table after I pick it up.
What is the chance?

Exactly regarding this case, I thought that K should be 8 but the Excel says me that there is an error with this number in the formula I built.
Maybe for this case the probability is higher than 1? And the Excel goes crazy because of this? :-)
Statsbeginner
Statsbeginner
  • Threads: 2
  • Posts: 7
Joined: Jun 23, 2013
June 24th, 2013 at 10:37:01 AM permalink
Hi 7craps,
Many thanks for this link and excellent explanation, I will study this.
7craps
7craps
  • Threads: 18
  • Posts: 1977
Joined: Jan 23, 2010
June 24th, 2013 at 11:12:43 AM permalink
Quote: Statsbeginner

So, there are 80 cards on a table. Every card has a number from 1 to 80 and each card has a different number. I don't see the numbers and I have 20 trials.
In order to win I need to pick one of the following cards: 5, 15, 25, 35, 45, 55, 65, 75. Each card I picked goes away from the table after I pick it up.
What is the chance?

Did you get confused by JB's post? Wrong colors??
Read and learn from his post.
=HYPGEOMDIST(8,8,20,80)	0.000004345660666
=HYPGEOMDIST(1,1,20,80) 0.25

=HYPGEOMDIST(4,9,20,80) 0.114105182095472
=HYPGEOMDIST(X,Y,20,80) X of Y


added:(after a swim and lunch)
OK.
You are not drawing 20 cards like Keno draws always 20 balls.
You draw one card until you win.
So the # of draws is a variable between 1 and 20 inclusive

so the prob of NOT drawing 1 of your 8#s on the 1st draw = 72/80
2nd draw: 71/79
3rd draw: 70/78
and so on to the 20th. Multiply them together
in Excel I get
P = 0.088266238 of NOT drawing 1 of your 8#s in 20 draws so
1-P should be your answer. Do we match??
CM added the formula in next post
winsome johnny (not Win some johnny)
CrystalMath
CrystalMath
  • Threads: 8
  • Posts: 1911
Joined: May 10, 2011
June 24th, 2013 at 11:31:26 AM permalink
Do you need to pick exactly one of the cards? If so, then use =hypgeomdist(1,8,20,80).

Can you pick more than one of the cards and still win? If so, then use =1-hypgeomdist(0,8,20,80).
I heart Crystal Math.
Statsbeginner
Statsbeginner
  • Threads: 2
  • Posts: 7
Joined: Jun 23, 2013
June 26th, 2013 at 12:28:54 AM permalink
7craps,
Many thanks, your solution is perfect! I got exactly the same result! Respect!

CrystalMath,
Thanks, I understood, further I will use this formulas.

Have a nice day, guys!
  • Jump to: