Dice Math Containment Thread

Do you scroll past 50 or 62 posts?

9 Likes

ok good, I’m glad I didn’t think about this for more than 30 seconds.

I posted it yesterday morning, it’s not that complicated.

Right : assuming we’re drawing uniformly from [0,1] to make computations simpler :

assuming there’s only one equilibrium strategy which must then be symmetric (probably true but too lazy to prove it now)

If c is the equilibrium cutoff strategy, then this means that
(value of rerolling vs strat c) = (probability of winning with c vs strat c)

The first quantity is 1 - average(strat c), and average(strat c) is the sum of
c/2 (proba c of drawing below c, then 1/2 average value of reroll)
and
1/2-c^2/2 (expected value of U 1_{U>c}, which is the integral \int_c^1 x dx)
i.e.
(value of rerolling vs strat c) =1/2 + c^2/2 - c/2

On the other hand, the proba that c is winning against strat c is exactly the proba that two rolls end up below c, i.e. c^2

This gives you the equation
1/2+c^2/2-c/2 = c^2
which unique solution between 0 and 1 is 1/2(sqrt(5)-1) or approximately 0.618

Edit : previously post said
"
this means that you need to reroll at exactly the average value of the strategy. (since this will also be what your opponent is getting if he’s playing perfectly)
"
which somehow got the right answer in the end, but the reasoning seems incorrect.

2 Likes

I showed that solution to my wife this morning. She agreed with it.

2 Likes

My question is why is a solar installation specialist a python code genius? Micro is quite the polymath. Feeling good and humbled right now. :grin:

2 Likes

Dunno about all of that, and you never know…zikzak is a builder and good at computer stuff, d10 was on this and all I know (or think anyway) about his career is he was an army helicopter pilot.

But, I was a software developer before I did solar and have recently mostly gone back to software. I’m sorta educated as well, started in engineering but graduated Math and English at the finest University in the world.

3 Likes

this is for continuous distribution on [0,1], rescaled to uniform (still continuous) on [1,100] which is closer to the discrete dice, this gives ~ 62.2.

So the continuous approximation is consistent with the d10 solution of “keep 63+, reroll 62-”.

(Not sure if there’s a simple proof that this approximation is good enough without actually doing the discrete math which it seems bobman already did)

Yeah, this is something that I often think about here. There are so many people here who are informed/skilled at seemingly-unrelated topics. It’s really impressive.

Meanwhile, I can read financial statements and that’s basically it.

2 Likes

Still following Newton. No one noticed for 250 years (pdf).

Yet even they should feel no embarrassment. As Augustus De Morgan once wrote, “Everyone makes errors in probabilities, at times, and big ones.”

1 Like

Still piloting but I’ve changed employers a few times since then. I grew up as a computer nerd though. I started programming on the family PC at 5 because all the games were run off a BASIC compiler. The change in career path was due to graduating high school in 2000 with the tech industry crashing and the war industry looking up. I took part time college classes as an adult because I had time and the government was paying for it, so I’ve got 180 undergraduate credits mostly in math and science, and 3/4 of two degrees in computer science and aerospace engineering. Not at an elite school but a decently ranked public university, particularly in those programs. Would have finished but I got relocated. My calculus is on point but my stats is not so great. I have a vivid memory of pissing off my high school stats class by vehemently arguing the wrong side of the Monty Hall problem.

1 Like

BA in Math here and I’ve never taken a stats class. I had a dumb aversion to things that seemed too practical and avoided it.

nice story, and since we’re talking credentials I’m a mathematician (in a probability adjacent field) so I shouldn’t be making a mistake here…
(although I’m on vacation trying very hard to not think about math…which I wasn’t expecting to be challenged by reading this board’s LC thread but here we are…)

But anyway thanks for this Newton anecdote, makes me feel better :slight_smile:

1 Like

What is the right side? Assuming Monty knows what’s behind each door you switch, right? I had a terrible argument with my uncle about it. He’s an electrical engineer and a very smart guy, but he just wouldn’t accept switching as the right answer no matter how hard I tried to explain it

Your original choice is right 1/3 of the time and one of the other two is right 2/3. He always removes a loser from the other two. This has no impact on how often your original choice is right because there will be a loser in the other pool either way. So the choice is if your original pick was right (1/3) or if either of the other two were right (2/3).

I went with a brutish solution using Julia code and got 63, which would have been my wise-ass guess because 100(e-1)/e. It’s very possible I did something wrong.

When Hero’s strategy is to stay on h, the probability of Hero rolling r is given by:

rollprob(r::Int64, h::Int64) = .0001(h-1) + .01(r>=h)

After rolling r, the probability of winning against Villain’s strategy of staying on v is:

condp(r::Int64, v::Int64) = .01*max(0, r-v) + .0001(v-1)*(r-1)

The probability of winning against strategy v using strategy h is:

pwin(h::Int64, v::Int64) = sum([rollprob(r,h)*condp(r,v) for r=1:100])

The probability of winning with strategy h against the best possible response is:

pwin(h::Int64) = minimum([pwin(h,v) for v=51:100])

And now we can solve for the optimum strategy:

x = 0.0
p = 0.0
for h=51:100
	if (q = pwin(h))>p
		p = q
		x = h
	end
end
x

That gives a result of x=63. No other strategy gives us a higher probability of winning against Villain’s best response (the one that minimizes our probability).

I also tried eliminating ties and testing whether any heads-up matchup gives us a <50% chance of winning when our strategy is to aim for 63.

The probability of a tie, given that we rolled r and Villain’s target is v, is

tieprob(r::Int64, v::Int64) = .0001(v-1) + .01(v<=r)

The probability of a tie when strategy h faces strategy v is

ptie(h::Int64, v::Int64) = sum([rollprob(r,h)*tieprob(r,v) for r=1:100])

Now we can test the heads-up matchups:

for v=51:100
	if pwin(63,v)/(1-ptie(63,v)) < 0.5
		println(v)
	end
end

No results, so 63 doesn’t lose any matchups.
The same procedure says 62 loses to 63, and it says 64 loses to 60 through 63.

So (r>=h) returns 0 if r<h and 1 if r>=h and then it multiplies by .01 even without the ‘*’?

Exactly

1 Like

Upthread someone said 63 loses to 58 or something like that. Your method found that not to be the case?

I think when he says 63, he means stand on 63. Other people are talking about the highest number you would reroll. So his 63 is the same as others’ 62.

2 Likes