Link to home
Start Free TrialLog in
Avatar of RayT
RayTFlag for United States of America

asked on

Calculating Probability

Five hands (Five cards per hand) are dealt from a standard 52-card deck of cards.

What is the probability that the Queen of Heart will appear at least three times?

Note: After each dealing the entire deck (52 cards) are reshuffled.
Avatar of Dr. Klahn
Dr. Klahn

Can you show us the work you have done so far on the problem, so that we can assist appropriately?
>> rgturner
Looking at your Question History, it is unlikely that this is a homework question.  But it would help if you could give us some background.

If you can find the probability of the Q/H in one deal, you can use the binomial theorem (Pascal's Triangle) for the rest of the problem.

The calculations are fairly tedious.  But you can use the Binomial Distribution function in Excel.
Avatar of RayT

ASKER

I'm trying to create a class using Visual Basic.  Here's what I have so far.

http://www.wikihow.com/Calculate-Probability

Calculating the Probability of Multiple Random Events

Can I use something like this???  If so,  how???
This is a more complicated problem than any on the wikihow website.

The probability of seeing the Q/H in deal of five 5-card hands is 25/52, which is pretty straight forward.

The probability of this happening at least three times in five deals is not so simple.
There are 25=64 possible outcomes.

Look at the help file for the Binomial Distribution function in Excel.  It sounds like you want to duplicate this in Visual Basic.
Avatar of RayT

ASKER

I've found several links about Binomial Distribution.  They all use a coin or a die.  How would I use Binomial Distribution to solve this problem?
Avatar of RayT

ASKER

Please note I am not a Mathematician; nor am I a Statistician.  However; I am an expert with Visual Basic.
You will have seen the polynomial in terms of p and q.

In this problem:     p = 25/52        q = 1 - p = 27/52

The coefficients of the terms are C( x, n), the number of combination of n things taken x at a time.
Avatar of RayT

ASKER

So the probability of this event occurring is 25/52?
Avatar of RayT

ASKER

Can you provide the equation showing how you arrived at this value?
SOLUTION
Avatar of d-glitch
d-glitch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have gone back and reread your question.

Do you deal five hands from the deck, then reshuffle, and do it four more times.
This is the case I have been talking about.

Or do you deal one hand from the deck, then reshuffle, and do it four more times.
The solution method here is similar, but the numbers are very different.
Avatar of RayT

ASKER

Sorry for the confusion.

I'm dealing one hand from the deck, then reshuffle, and do it four more times.
The solution method here is similar, but the numbers are very different.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As d-glitch noted, P = Prob( one QH in 5 cards out of 52) = 5/52.
And the probability of not getting a QH in one deal is Q = 1 - P = 47/52
To get at least 3 QH's in 5 hands, that is asking for the probability of getting:
1) exactly 3 QH's in 5 hands OR
2) exactly 4 QH's in 5 hands OR
3) exactly 5 QH's in 5 hands

Look at case (1). Each reshuffle and redeal are independent events. That is, the results of the one deal does not affect the results of the subsequent deals. Consider flipping a fair coin. If you get 10 Heads in a row, the probability of getting a Tail in the 11th toss is not more likely than getting a head (in a fair coin). The probability is still 1/2.

When you have independent events, the probability of two events is just the multiplication of the two probabilities. For example, the probability of flipping a fair coin two times and getting H, H is 1/2 * 1/2 = 1/4.

Here is one scenario for case 1:
QH  noQH  noQH QH QH (i.e., you got the QH in the first, 4th, and 5th deal)
The probability of getting this exact sequence of (independent) events is:
P * Q * Q * P * P = P^3 * Q^2

But, there are other ways to getting exactly 3 QH's in 5 deals - for example:
Probability(noQH  QH  noQH QH QH) = Q * P * Q * P * P = P^3 * Q^2
which results in the same probability.

There are obviously more scenarios to get exactly 3 QH's. The number of combinations to achieve this is given by the formula C(5,3) =

    5!              5 * 4 * 3 * 2* 1               5 * 4
----------- =  ----------------------------  =   ---------  = 10
 (5-3)! 3!       (2 * 1) * (3 * 2 * 1)               2

(To get a feel for this, you could enumerate all the cases to convince yourself that there are exactly 10 cases.)

In general, the combinatoric formula, C(n,k) gives the number of ways to select k items from n items.
       C(n,k) = n!/[ (n-k)! k! ]

In case you want to read a little about this formula, here is the wiki link:
https://en.wikipedia.org/wiki/Combination

To get exactly 3 QH's in 5 deals, we have to consider all 10 combinations. So the probability of this occurring is:
P(exactly 3 QH's in 5 deals) = 10 *  P^3 * Q^2 = 10 * (5/52)^3 * (47/52)^2 = 0.0073
----
Likewise, to get exactly 4 QH's in 5 deals, we have to consider all C(5,4) = 5 combinations. So the probability of this occurring is:
P(exactly 4 QH's in 5 deals) = 5 *  P^4 * Q^1 = 5 * (5/52)^4 * (47/52)^1 = 0.000386
----
Likewise, to get exactly 5 QH's in 5 deals, we have to consider all C(5,5) = 1 combinations. So the probability of this occurring is:
P(exactly 5 QH's in 5 deals) = 1 *  P^5 * Q^0 = (5/52)^5 = 0.000008219
----

To get at least 3 QH's in 5 deals, you just add up the three cases: 0.0073 + 0.000386 + 0.000008219 = 0.0077

===============

BTW, we added up 3 terms for exactly 3, 4, or 5 QH's in 5 deals.
If you added to this number 3 more terms corresponding to exactly, 0, 1, or 2 QH's in 5 deals, then this new number will be 1.0. Why? Because the probability that you will get either no QH's or 1 or more QH's in 5 deals is 100%. That is, in 5 deals, you either see at least one QH or you do not. There are no other cases to consider, so 100% is guaranteed.

Line 12 in d-glitch's spreadsheet demonstrates that when you ask for the probability that the even consists of all possible scenarios, then you naturally get 100%. Going back to the simpler fair coin example, if you ask what is the probability that a coin flip will be either a head or a tail, the answer is 100%

===============

Hope this helps.
Any questions?
Avatar of RayT

ASKER

Thanks!  Wow!
Avatar of RayT

ASKER

Thanks!!!
Glad we could help.