# Math Help - Probability Formula Question

1. ## Probability Formula Question

This isn't actually a homework question, but I wasn't sure where to post it so my apologies if I am on the wrong board...

I am trying to figure out what the exact formula would be for the probability of an event to occur based on certain known variables. The variables in question are:

A = the number of total objects in a set.
B = the number of an inner set of objects, any of which will give the desired result should it be drawn.
C = How many objects in set B are needed to gain the required result.
D = How many times you are a allowed to draw.

A more concrete example would be with a deck of cards. Let's say you were given 5 chances to draw 3 spades.

A = 52 (total number of cards in the deck).
B = 13 (total number of spades in the deck).
C = 3 (number of spades needed).
D = 5 (number of times we are allowed to draw).

What would be the formula to calculate the exact probability of getting the required result in the given number of draws?

My first guess is to simply take the probability of drawing one of the given set in one try (13:52 = 1:4) then multiply that by the number of times you are allowed to draw and finally divide by the number of spades that you need. Ignoring obvious minimal errors arising from the changing numbers as you continue to draw, this looked correct at first, but then I realized I must have missed something pretty important because this formula was giving me better odds when I had 1 spade in 3 draws then when I had 2 spades in 4 draws which doesn' t make any sense!

In short, what I tried was A / B / C * D.

What am I missing here?

2. Doh! I spoke too soon. Google, as always, showed me the light. How could I have doubted.

Apparently the correct formula is (D/C) * (B/A)^C * (1-(B/A))^(D-C)

Hmm... Somehow I knew it needed to be more complicated

3. Originally Posted by milly
Doh! I spoke too soon. Google, as always, showed me the light. How could I have doubted.

Apparently the correct formula is (D/C) * (B/A)^C * (1-(B/A))^(D-C)

Hmm... Somehow I knew it needed to be more complicated
The probability of drawing $C$ cases of $B$ from a set with a total number of elements $A$ (sampling without replacement) is:

$
pd(C,B,A) = [B/A][(B-1)/(A-1)]...[(B-C+1)/(A-C+1)]$
$=[B!(A-C)!]/[A!(B-C)!]
$

Now we are allowed $D$ goes at this draw, and we want the probability that
it occurs one or more times in the $D$ goes. The number of times it occurs has
a binomial distribution, and so:

$
p(n,C,pd(C,B,A)) = C!/(n!(C-n)! p(C,B,A)^n (1-p(C,B,A))^{C-n}.
$

Now the probability of one or more occurences is:

$
p(n>0,D,pd(C,B,A)) = 1 - p(0,D,pd(C,B,A)) = 1 - (1-pd(C,B,A))^{D}.
$

Now for the example of drawing 3 spades from a deck of cards:

$
pd(3,13,52)=\frac{13.12.11}{52.51.50}\approx 0.0129
$

so:

$
p(n>0,3,pd(3,13,52)) = 1 - p(0,3,pd(3,13,52)) = 1 - (1-pd(3,13,52))^{3}$
$\approx 1-(1-0.0129)^3 \approx 0.0382.
$

RonL