# Using a binomial distribution to mathematically quantify a thought experiment from my friend (python)

### My friend asked me the following question:

Would you rather:

Take 250K and walk

Have 10 attempts at a half-court basketball shot for 10M
(You cannot win more than once. You stop shooting
after the first made shot should there be one)


I thought this would be a perfect example for modelling a binomial distribution. But... is it?

Before I get into this, I am talking solely in regards to expected value. Of course, there is a philosophical side to this question ie money having diminishing marginal utility, personal motivation, etc.. However, this thread will stick to just the math

### Here is what I did:

I modeled a binomial distribution with a prior of 7.5% success rate on any given half-court shot (we have played basketball our entire lives and I have shot countless half-courters, anecdotally, I believe this to be a strong prior for myself).

With 10 trials, 1 success, and a probability of 0.075, binomial distribution gives a 37.18% chance.

from scipy.stats import binom

binom.pmf(k=1, n=10, p=0.075)
>>> 0.37182352007411085


Which results in an EV of 3.718M, meaning it would be purely mathematically correct to go for it here.

### However, there are things to consider:

That is the probability of exactly 1 success. What if I were to calculate the cdf?

1 - binom.cdf(k=0, n=10, p=0.075)
>>> 0.5414176585752631


This means there is a 54.14% probability of making at least one shot. However, this is flawed, as I would likely stop shooting after I made 1 shot and won 10M lol. Thus, is a pmf of k=1 the right method here? It still seems like it might not be as I don't think it accurately addresses stopping after 1/the first success (which regular binomial doesn't model). That is where negative binomial comes in, right? However, I was playing around with it and couldn't quite figure out if it was the right thing to do.

### Bonus Question:

Let's say I want to reverse engineer this question and find out what the "breakeven half-court success rate" is. Honestly, I just brute-forced this myself (also using the pmf strategy, which I still am unsure the validity of for this specific problem when stopping after the first success):

binom.pmf(k=1, n=10, p=0.002559)
>>> 0.025006633549164416


This results in an EV of ~250k, so the breakeven half-court success rate is ~0.2559%.

Is there a way to do this with scipy in python? ie you have successes and trials but want to find the probability?

Hope you enjoy this question and I hope to learn something from your answers. Thanks!

Edit: Grammar

• Can you win the $10$ million more than once? Do you only care about expectation (i.e. have a linear utility function)? If so, you expect to win $10 p\times 10^7$ from the shots, which exceeds $250000$ when $p>\frac1{400}$ Commented Oct 4, 2023 at 9:17
• No, you cannot win the 10m more than once and the challenge would stop after the first made shot should there be one. Commented Oct 4, 2023 at 13:53
• OK - then look the complement of not making a shot from ten and compare $(1-(1-p)^{10})\times 10^7$ with $250000$. You get about $0.002529$ rather than $0.0025$ Commented Oct 4, 2023 at 14:00

To expand on Henry's comment above, what you are interested in here is the probability that you make at least one shot. Even if you stopped after the shot you make, we know you have 10 trials available so this is the probability that you would get the money. We actually don't need to worry about whether you keep playing or not after you win, cause if you do or don't it doesn't change the amount of money you win. Using a binomial distribution we can calculate this probability as $$P(X \geq 1; p, n =10) = 1 - P(X < 1) = 1 - P(X = 0) = 1 - \binom{10}{0}p^0(1-p)^{10-0}$$
$$= 1 - (1-p)^{10}.$$
You calculated that correctly using scipy. The solution to the breakeven point is then the solution to the equation $$\250\mathrm{K} = \left(\text{that probability}\right)\left(\10\mathrm{M}\right) + \left(1 - \text{that probability}\right)\left(\0\right).$$ The RHS here is the expected value of the money you would win from your basketball shots. So, we get that $$\frac{250\mathrm{K}}{\10\mathrm{M}} = 1 - (1 - p)^{10}$$ and the solution is then $$1 - \left(1 - \frac{250\mathrm{K}}{\10\mathrm{M}}\right)^{\frac{1}{10}} \approx 0.002529,$$ or about a $$.25\%$$ chance of making the shot, as Henry noted in his comment. So if your personal prior on $$p$$ is better than that, you expect (in a long-run average over infinitely many trials) to make more money by playing the game than walking away.
Of course to decide which is "better" we then have to think about things like risk aversion and whether a guaranteed amount of money is better than any random amount. But $$.25\%$$ seems about right for my personal prior so I would probably take the money and walk :).