What did I do wrong in this probability sheet?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,676
Office Version
  1. 365
Platform
  1. Windows
While playing solitaire, I was curious about the odds of 1 or more aces among the 7 initial face-up cards. I created the little table in the mini-sheet below. I then had the solitaire game deal 100 hands and tallied the number of aces in the initial face up cards. That tally is in row 6. Row 7 has what I thought were the expected odds, but there must be an error. They do not add up to 100 (I7 highlighted in yellow). Row 8 has the actual percentages and row 9 has the percentage error.

Can someone tell me where I went wrong? Thanks

Cell Formulas
RangeFormula
H6:H9H6=SUM(D6:G6)
I6:I8I6=SUM(C6:G6)
C7C7=COMBIN(7,7) * ((4/52)^0) * ((48/52)^7)
D7D7=COMBIN(7,1) * ((4/52)^1) * ((48/52)^6)
E7E7=COMBIN(7,2) * ((4/52)^2) * ((48/52)^5)
F7F7=COMBIN(7,3) * ((4/52)^3) * ((48/52)^4)
G7G7=COMBIN(7,4) * ((4/52)^4) * ((48/52)^3)
C8C8=C6/I6
D8D8=D6/I6
E8E8=E6/I6
F8F8=F6/I6
G8G8=G6/I6
C9:G9C9=C8/C7 - 1
C10C10="7,7 = " & COMBIN(7,7)
D10D10="7,1 = " & COMBIN(7,1)
E10E10="7,2 = " & COMBIN(7,2)
F10F10="7,3 = " & COMBIN(7,3)
G10G10="7,4 = " & COMBIN(7,4)
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hello,

Delete C7:G7 and write into C7:
Excel Formula:
=COMBIN(4,SEQUENCE(1,5,0,1))*COMBIN(48,7-SEQUENCE(1,5,0,1))/COMBIN(52,7)
Regards,
Bernd
 
Upvote 0
Solution
Hello,

Delete C7:G7 and write into C7:
Excel Formula:
=COMBIN(4,SEQUENCE(1,5,0,1))*COMBIN(48,7-SEQUENCE(1,5,0,1))/COMBIN(52,7)
Regards,
Bernd
Wow! I get the correct formula and a more compact expression! Very nice. 👏👏👏👍🥰 Thank you.

I think I see why your formula works. It divides the product of the number of aces times the number of non-aces by the possible deals. Correct?

But I don't see why mine fails. The expression I had for 1 ace, =COMBIN(7,1) * ((4/52)^1) * ((48/52)^6), multiplies the odds of 1 ace times the odds of 6 non-aces ties the number of combinations. Any help there?

Thanks
 
Upvote 0
Hello,

Yes, you correctly understand my formula, I think.
Your formulas calculate the probabilities with replacement as you can simulate with this VBA:
VBA Code:
Sub monte()
Const runs = 100000
Dim i As Long, j As Long, n As Long, r(1 To 5) As Long
With Application.WorksheetFunction
Randomize
For i = 1 To runs
    n = 0
    For j = 1 To 7
        If .RandBetween(1, 52) < 5 Then
            n = n + 1
            If n = 4 Then Exit For
        End If
    Next j
    r(1 + n) = r(1 + n) + 1
Next i
Cells(11, 2).Formula = r(1) / runs
Cells(11, 3).Formula = r(2) / runs
Cells(11, 4).Formula = r(3) / runs
Cells(11, 5).Formula = r(4) / runs
Cells(11, 6).Formula = r(5) / runs
End With
End Sub

The correct probabilities without replacement you get if you change the .RandBetween row to
VBA Code:
If .RandBetween(1, 53 - j) < 5 - n Then

Note: Start above simulation with a smaller number of runs (1000 or 10000) if your computer is a bit slow. But then the simulation will be less accurate.

Regards,
Bernd
 
Upvote 0
Hello,

Yes, you correctly understand my formula, I think.
Your formulas calculate the probabilities with replacement . . .
Aha! And that's why they are slightly higher. Thank you. That will give me something to ponder. . .

I should have had you for my probabality and statistics class, but that was quite a few years ago...so maybe it wouldn't have made any difference.

This has been very helpful. Thank you.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top