Probability of getting to N wins first

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,532
Office Version
  1. 365
Platform
  1. Windows
Suppose I want to know the odds that my team will get to N wins before its opponent, assuming a constant probability, P, that it will win any 1 game.

This involves the sum of N probabilities since the total number of games varies from 1 to 2*N - 1.

I can do it using COMBIN, but it requires a sum of N terms:

image.png


I fiddled around with the various binomial distribution functions, but couldn't find one that will do this with a single expression. They all require a sum of N terms, which gets unwieldy for N>5.

I could write a UDF to do the sum in a loop, but before I do, is there a way do do this with a single expression for all N?

Thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Book1
ABCDEFG
1
2N50.733432
3P0.6
4
5
Sheet1
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT(COMBIN(N*2-1,ROW(INDIRECT("1:" & N))-1),0.6^(2*N-ROW(INDIRECT("1:" & N))),(1-P)^(ROW(INDIRECT("1:" & N))-1))
Named Ranges
NameRefers ToCells
N=Sheet1!$D$2F2
P=Sheet1!$D$3F2
 
Upvote 0
Oops, left a 0.6 rather than P in the previous post. Use:

Book1
ABCDEFG
1
2N50.733432
3P0.6
4
Sheet1
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT(COMBIN(N*2-1,ROW(INDIRECT("1:" & N))-1),P^(2*N-ROW(INDIRECT("1:" & N))),(1-P)^(ROW(INDIRECT("1:" & N))-1))
Named Ranges
NameRefers ToCells
N=Sheet1!$D$2F2
P=Sheet1!$D$3F2
 
Upvote 0
Oops, left a 0.6 rather than P in the previous post.
Wow! My hat's off to you!!!

I think it would take me a week to decipher that and zero chances of retyping it correctly. I'll just trust you that it works.

For me, a UDF solution works better. Here's my code:

Excel Formula:
Function Odds(P As Double, N As Integer) As Double

Dim i As Integer
Dim Q As Double
Q = 1 - P

Odds = 0
For i = 0 To N - 1
  Odds = Odds + Application.WorksheetFunction.Combin(i + N - 1, i) * Q ^ i
Next i

Odds = P ^ N * Odds

End Function

And these are the results:

image.png
 
Upvote 0
Thanks - UDF is easier to understand and isn't volatile like the formula is (due to use of INDIRECT). But the formula will give the same results in cases where a UDF is not desired. Also it could be turned into lambda function such as odds(n,p) which would make its usage much simpler when/if lambda functions become generally available.

Book1
ABCDE
1WinsProbabilityP0.6
2160.0%
3264.8%
4368.3%
5471.0%
6573.3%
71081.4%
81586.4%
92089.8%
102592.2%
115097.8%
1210099.8%
Sheet1
Cell Formulas
RangeFormula
B2:B12B2=SUMPRODUCT(COMBIN(A2*2-1,ROW(INDIRECT("1:" & A2))-1),P^(2*A2-ROW(INDIRECT("1:" & A2))),(1-P)^(ROW(INDIRECT("1:" &A2))-1))
Named Ranges
NameRefers ToCells
P=Sheet1!$E$1B2:B12
 
Upvote 0
Solution

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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