Open Side Menu Go to the Top
Register
Probability to hit in Pineapple OFC Probability to hit in Pineapple OFC

10-25-2016 , 07:46 AM
Could you help me please?

BTW if you don't know how to play OFC it doesn't matter, it's just pure probability question. You could see white ball as A and black one as K.

We are playing 3 max on the button. It's a second round, we want to put QQ on top and need to know what is the probability to catch at least AA or at least KK in the future. We are sure that nobody throw away those cards and we see one K in the opponents hand. So AAAA and KKK are still inside 28 cards deck from which we will get 9 cards (in reality 3 times for 3 cards and throw away one card every time, but it looks irrelevant for me for this task).

I do know how to calculate AA (and KK) separately using hypergeometric distribution, but I am not sure we could add those probabilities. We definitely couldn't for say AAA or KKK. But AA or KK looks like independent events.

Your advice please?
Probability to hit in Pineapple OFC Quote
10-25-2016 , 09:30 AM
Just to make it clear (at least for me), you have 28 cards with 4 Aces and 3 Kings. You randomly select 9 of this 28 cards. You want to know the probability of extracting at least 2 Aces or at least 2 Kings. Is that correct?

If so, take a look at the inclusion-exclusion principle:

P(AA OR KK) = P(AA) + P(KK) - P(AA AND KK)

If you know how to calculate P(AA), guess you can arrive at the final result (assuming that the above is what you want).
Probability to hit in Pineapple OFC Quote
10-25-2016 , 09:49 AM
Quote:
Originally Posted by nickthegeek
Just to make it clear (at least for me), you have 28 cards with 4 Aces and 3 Kings. You randomly select 9 of this 28 cards. You want to know the probability of extracting at least 2 Aces or at least 2 Kings. Is that correct?
Great thanks for the answer. You are absolutely right.
Small remark: "or" is not exclusive for me here. Catching AA and KK is also a hit.

I should think about your answer to understand it in more depth.
Probability to hit in Pineapple OFC Quote
10-25-2016 , 12:10 PM
If I am following correctly, the last term in nickthegeek's formula is not there to exclude the case that both AA and KK are both drawn.

Instead, it is there to subtract off the "double-counting" of the case that both AA and KK are both drawn.

That is, the first term P(AA) includes the chance of both AA and KK. The second term P(KK) also includes the chance of both AA and KK.

Thus, to derive the correct prob of AA or KK or both AA and KK we need to subtract off the prob of both since it is now counted twice in the formula before the third term.

I hope that is both correct and helpful.

P.S. Yes, the hypergeometric distribution gives P(AA) and P(KK). But it seems that you have to work out P(AA and KK) yourself. It is not difficult.
Probability to hit in Pineapple OFC Quote
10-26-2016 , 06:20 AM
What whosenext told is totally correct. Keep in mind that "OR" is inclusive: so P(AA OR KK) includes cases in which you have both.

To answer your question, we start calculating P(AA). To do so, we count how many combos you can make that contain 0 or 1 Aces and then we take the complimentary. So we have:

P(AA) = 1-(C(24,9)+C(4,1)*C(24,8))/C(28,9)

The C(24,9) amounts to the combos you can make without aces (you have 24 non Aces in your deck); the second part counts the Axxxxxxxx type combos, with 1 Ace (there are C(4,1) ways to select an Ace) and 8 x (which can be selected in C(24,8) ways).

Taking the idea you can easily translate the logic above to calculate P(KK)

Calculating P(AA AND KK) is just slighty trickier, since you have to enumerate each way to make a hand containing two Aces and two Kings. There are six cases, one per each row of the following table:

Code:
A K X
2 2 5
3 2 4
4 2 3
2 3 4
3 3 3
4 3 2
For instance, the first row accounts for the AA-KK-XXXXX type combos. You can count them through:

C(4,2) * C(3,2) * C(21,5)

See the pattern? You select 2 Aces from the 4 available, 2 Kings from the 3 and 5 X from the 21 remaining cards.
We need to count the combos for each of the above row and sum them all. Once we P(AA), P(KK) and P(AA AND KK), we use the formula of my last post and get the result.

For this case, you can also take a "brute force" approach. You build every 9-card combo and count how many have AA or KK. In the spoiler, you can see the answer implemented in the R language with the calculation and the brute force.

Spoiler:

Code:
#Alias for the C function (number of combos)
C<-choose
pAA<-1-(C(24,9)+C(4,1)*C(24,8))/C(28,9)
pKK<-1-(C(25,9)+C(3,1)*C(25,8))/C(28,9)
cases<-as.matrix(expand.grid(A=2:4,K=2:3))
cases<-cbind(cases,X=9-rowSums(cases))
pAAandKK<-sum(C(4,cases[,1])*C(3,cases[,2])*C(21,cases[,3]))/C(28,9)
pAAorKK<-pAA + pKK - pAAandKK
#[1] 0.549187
#brute force approach
#build the deck (A=1, K=2, X=0)
deck<-c(rep(1,4),rep(2,3),rep(0,21))
#build the "hand" combos (take some time)
combos<-combn(deck,9)
#get the combos with at least 2A
aa<-colSums(combos==1)>=2
#get the combos with at least 2K
kk<-colSums(combos==2)>=2
#final result: combos with AA or (| operator) KK
sum(aa | kk)/ncol(combos)
#[1] 0.549187
Probability to hit in Pineapple OFC Quote
10-27-2016 , 05:53 AM
nickthegee, whosnext,

Great thanks for your help. Really appreciated.
My problem at the moment - I don't remember combinatorics besides hypergeom and so don't know how to calc P(AA AND KK). Need time.
From the other hand I don't need absolute level of accuracy, only practical one to make decision to gamble or not with QQ on top.
So currently I decided to use P(any four from AAAAKKK set) instead of P(AA AND KK). I wrong with AAAK and KKKA this way (KKKK I could calculate separately), but it's a small part, main part of any four is AAKK I suggest.
Using this approximate approach I got 52,2% which is not so far from your exact 55%

What do you think of this approach?
Probability to hit in Pineapple OFC Quote
10-27-2016 , 08:52 AM
Quote:
Originally Posted by Fold&Forget
So currently I decided to use P(any four from AAAAKKK set) instead of P(AA AND KK).
From a formal point of view this approach makes two mistakes: the first (that you identified) is to count as "hits" also AAAK (for instance); the second is that you don't count hands in which you may have 5 or more cards of that set (AAAKKxxxx type hands).

Well, that wouldn't be so bad if you actually knew that the error you are making is small. And in this case it happened to be small. The (huge) problem is that you don't know in advance how big will be the error. And if you don't know it, you won't know if you can believe to your result.

So, to summarise: either you learn how to estimate the error your assumptions might make or you learn how to correctly calculate these quantities. Of course the second approach is much better. Just this thread alone supplies a lot of good info which you can use. Outside, there is plenty of material you can study to solve this kind of problems.
Probability to hit in Pineapple OFC Quote
10-27-2016 , 09:07 AM
Thank you for reply

Speaking of 5 or more cards of the set I have calculated it all using hypergeom, it's about 2%, so it's OK for needed level of accuracy.

And I have plans to do the right math but it will take weeks, and I just don't want to put no replies for your posts for so long time

Last edited by Fold&Forget; 10-27-2016 at 09:20 AM.
Probability to hit in Pineapple OFC Quote
10-27-2016 , 10:35 AM
Quote:
Originally Posted by Fold&Forget
we want to put QQ on top and need to know what is the probability to catch at least AA or at least KK in the future.
AAAA and KKK are still inside 28 cards deck from which we will get 9 cards
Spoiler:
Possibilities are
AAAAKKKnn *
AAAAKKnnn *
AAAAKnnnn *
AAAAnnnnn *
AAAKKKnnn *
AAAKKnnnn *
AAAKnnnnn *
AAAnnnnnn *
AAKKKnnnn *
AAKKnnnnn *
AAKnnnnnn *
AAnnnnnnn *
AKKKnnnnn *
AKKnnnnnn *
AKnnnnnnn
Annnnnnnn
KKKnnnnnn *
KKnnnnnnn *
Knnnnnnnn
nnnnnnnnn
That all adds up to C(28,9)=6906900

The items that are starred have either two aces or two kings. Looks like the easiest way is to count the four possibilities that don't have either two aces or two kings and divide by the total possible.

4*3*C(21,7) = 1395360
4*C(21,8) = 813960
3*C(21,8)= 610470
C(21,9) = 293930

1395360+813960+610470+293930=3,113,720

Thus the probability of not getting at least two aces or two kings is
3,113,720/6906900=0.4508
And the probability of getting at least two aces or kings must be 0.5492


I haven't looked at any other replies yet. Never a guarantee my math is correct.

Buzz
Probability to hit in Pineapple OFC Quote
10-27-2016 , 11:45 AM
Just a quick follow-on to the fantastic posts given above. I just want to show how "easy" it is to derive the P(AA & KK) figure. All it requires is a little bit of logic and a little bit of mathematical knowledge. nickthegeek and Buzz have previously done this, but one more reply can't hurt.

Calculating P(AA & KK) should not be daunting. There are basically two approaches that both, of course, give the same answer.

As nickthegeek and Buzz showed above, the first approach is to write down all the ways combinatorically you can get at least two aces and two kings in a draw of 9 cards when there are 28 cards left in the deck, 4 aces and 3 kings. For each way, it is straightforward to use combinatorics (the "Choose" function) to derive the number of draws. Then you sum all the draws across all the different cases. Finally, to get the probability you seek, divide this sum by the total number of ways to draw 9 cards from 28 cards.

The second approach utilizes the Principle of Inclusion-Exclusion (PIE) and is more clever and essentially does all the work in one fell swoop. I will leave that for another time, but you can google it if you want more information.

Here is a general outline using the first approach (as previously outlined by nickthegeek above).

Case 1: Draw exactly 2 aces AND 2 kings.

That means that you draw exactly 5 blanks (cards that are neither an ace or a king).

So how many ways are there to draw 2 aces from 4, 2 kings from 3, and 5 blanks from 21? This is simply C(4,2) * C(3,2) * C(21,5) where the C function is the "Choose" operator that most calculators and computer programs have.

Case 2: Draw exactly 3 aces AND 2 kings (and 4 blanks).

This is clearly C(4,3) * C(3,2) * C(21,4).

Case 3: Draw exactly 4 aces AND 2 kings (and 3 blanks).

This is clearly C(4,4) * C(3,2) * C(21,3).

Case 4: Draw exactly 2 aces AND 3 kings (and 4 blanks).

This is clearly C(4,2) * C(3,3) * C(21,4).

Case 5: Draw exactly 3 aces AND 3 kings (and 3 blanks).

This is clearly C(4,3) * C(3,3) * C(21,3).

Case 6: Draw exactly 4 aces AND 3 kings (and 2 blanks).

This is clearly C(4,4) * C(3,3) * C(21,2).

All of these calculations are easily done on either a calculator or a spreadsheet (or other computer) program.

If I did it correctly, by summing the results of these six cases I get that there are a total of 483,532 ways you can draw at least 2 aces and 2 kings.

And there are C(28,9) = 6,906,900 ways of drawing 9 cards from 28 cards.

The rest of the derivation is given above by nickthegeek.
Probability to hit in Pineapple OFC Quote
10-28-2016 , 10:44 AM
Great thanks for your help!
Probability to hit in Pineapple OFC Quote

      
m