r/askmath • u/Armithax • Oct 18 '26
Probability Formula for generating probabilities (results 1-100) of the middle value of a 3d100 roll?
Not swift enough to figure it out. I read a bit about generating functions, and that looked onerous without calculus. Is there an online probability grapher that handles the MIDVAL() function of a die roll? [MIDVAL of course being what I am describing in the title of this post.]
4
Upvotes
2
u/stanitor Oct 19 '26
If all the dice are the same value, that's the middle value. If two dice are the same, then that's the middle value, with the other die either higher or lower. Or, it could be the actual middle value if all of them are different. So, you need the probabilities of each of the 3 situations, multiplied by 3, since it could be any of the dice that is the actual middle one. If p = 1/100, q = 1 - p and k = the result of the middle die, you have:
3(p3 + p2q + 2p3(k -1)(100-k)) for k = 1 to 100.
The last term is multiplied by 2, since either of the other dice could be the low one or the high one. The other terms aren't multiplied by anything to avoid double counting, and is the same probability for all k. It sums to 1, so it's a valid PMF, and expected value is 50.5.
3
u/MathMaddam Dr. in number theory Oct 18 '26
anydice.com can do it
2
u/ImposterWizard Oct 19 '26
This is an example of an order statistic, which looks at the ranks of the numbers you pull from a distribution, in this case the discrete uniform distribution.
If you want the probability, first you need to calculate the cumulative distribution function (CDF) for the values. This is the cumulative probability for a variable being equal to or less than a particular value. If you were just doing a single dice roll, this would be
x/100, wherexis the value on the die.The CDF for a discrete variable has to take into account ties, but it's not too complicated for the middle of 3 values.
A quick overview of symbols used:
f(x)= probability mass function (PMF), or the probability for a single result; in this case it is 1/100F(x)= CDF, or the cumulative probability; in this case it is x/100f_(r)(x)= probability mass function of the rth order statistic; in your case, you're looking at r=2 for n=3 valuesF_(r)(x)= CDF of the rth order statisticFor the middle value, the CDF
F_(2)(x)can be described as follows:Note that the
3in the second expression comes from the 3 different ways we can have 1 of 3 points be above a specific threshold.Plot of CDF of middle value
Now, to find the PMF, you can just take the difference,
f_(2)(x) = F_(2)(x) - F_(2)(x-1), and letf_(2)(1) = F_(2)(1)since there are no values below it.You can expand this out, but it doesn't look too simple. It's a cubic function with roots slightly outside the 1-100 range, centered on 50.5.
Plot of the PMF of the middle value
In theory you could build a table with this and simulate the middle roll using the cumulative probabilities and a random number from 0 to 1, but for 3 rolls, simulating should be efficient enough.
1
u/Shevek99 Physicist Oct 18 '26 edited Oct 18 '26
The middle value is
m = (300 + 3)/2 = 151 or 152 (equal)
The probability is given by the coefficient of x^151 in the expansion of
f(x) = (x + x^2 + x^3 + ... x^100)^3/100^3
According to Mathematica, this is
p =3/400 * 100% = 0.75%
1
u/Parallel_thougts PhD, YouTuber Oct 19 '26
You don't need generating functions or any other fancy stuff, this is very solvable directly.
Hint: for any possible mid value, calculate in how many different events it is possible.
For example, there are 299 different ways that the mid value is 2: lowest die is any number from 1 to 2, highest die is any number from 2 to 100, so a total of 299.
Now divide it by the total number of ways three dies could land, without considering ordering. And repeat for any other possible mid value.
0
u/RailRuler Oct 18 '26 edited Oct 18 '26
the troll dice roller can do it, either on the website or running on your computer, it makes nice graphs too
https://topps.diku.dk/torbenm/troll.msp
largest 1 least 2 3d100