The maximum of many dice rolls: Stand-up Maths' conjecture proven!

  Рет қаралды 24,480

Dr Mihai Nica

Dr Mihai Nica

Күн бұрын

Пікірлер: 158
@DrTrefor
@DrTrefor Ай бұрын
Ooooh this is very nice - the perfect math christmas present:D
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Haha only a few days late! Even knowing I always underestimate how long animating takes, I *always* underestimate how long animating takes
@X22GJP
@X22GJP 29 күн бұрын
The subject area is mathematics. Short version, maths.
@mikeflowerdew7877
@mikeflowerdew7877 21 күн бұрын
This is one of the best descriptions of series approximations that I've seen on YT. It's great that you've given each term a qualitatively different explanation, which definitely has parallels with perturbation theory for me (while being simple enough for a general audience!). I particularly liked the graphs at the start, they really show what you gain at each step
@MihaiNicaMath
@MihaiNicaMath 21 күн бұрын
Thank you! Indeed, these kinds of series things come up all the time in math/physics/perturbation theory and are often super useful :)
@lunafoxfire
@lunafoxfire 27 күн бұрын
amazing video! i use the whole "stretching" out of a uniform distribution all the time in programming! i looooooved the trick of inverting a rounded-up uniform distribution over 0-n into rolling a dice and subtracting a uniform distribution over 0-1. that was so cool! lots of neat ways to think about probability that i'd never seen before!
@MihaiNicaMath
@MihaiNicaMath 27 күн бұрын
Thanks! I had originally worked it out all with the rounding up but I kept using RoundUp(U)-U in my derivation so I was like "omg we can just give this a name and do it that way".
@Barteks2x
@Barteks2x 18 күн бұрын
And now consider that the way your programming language implements uniform distribution from 0 to 1 is by... Un-stretching a uniform distribution of integers with very large maximum... Only for you to stretch it back 😅
@lunafoxfire
@lunafoxfire 18 күн бұрын
@@Barteks2x lmao yeah
@sheppa28
@sheppa28 27 күн бұрын
(1/2) + ((m n) / (m+1)) - (m / (12 n)) + ((m(m-1)(m-2)) / (720 n^3)) - ((m(m-1)(m-2)(m-3)(m-4)) / (30240 n^5) + ((m(m-1)(m-2)(m-3)(m-4)(m-5)(m-6)) / (1209600 n^7)) - ... Denominators follow OEIS sequence A060055. Numerators initially look like only 0 or 1 (with sign), but follow A060054. For example, for (1/n^11) term has 691 in numerator and 1307674368000 in denominator. Include all terms of (1/n^k) such that m>k. For example, if m=10 stop at (1/n^9) term.
@MihaiNicaMath
@MihaiNicaMath 26 күн бұрын
Thanks for this!
@yedidiapery
@yedidiapery 23 күн бұрын
really cool video man! funny as it is, the bit that was most confusing to me was the part you subtracted and added the 1/2. took me a few good seconds to realize what has happened there.
@MihaiNicaMath
@MihaiNicaMath 23 күн бұрын
Haha that's funny that the other parts were fine. I did add that but near the end of my process so that you don't need to estimate P(nMaxers = 1) accurately, and you only need P(nMaxers=2)
@droid-droidsson
@droid-droidsson Ай бұрын
Really lovely video, lots of good intuition, and yet just enough details that you can see how a rigorous argument proving the same thing would shake out, without bogging people down in tedium. Thank you for taking the time and effort to explain this, and the "reveal" at the end that the 1/n² term vanishes was quite the surprise! Just as a heads-up, whatever greenscreen technology you are using seems to not quite be able to mask the very top right corner of your camera feed correctly, and so there is a small artifact more or less in the middle of the screen for most of the video. Not a big deal at all, but probably easy to correct.
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Thank you so much! I'm so glad you liked it and the "plot" was followablr. Yes indeed the correction I need to make is to not bump into the green screen next time :)
@djsmeguk
@djsmeguk Ай бұрын
So, the P(Nmax=2) perspective on the third term explains why the third correction term doesn't make sense when m=1 - intuitively you should anticipate that m=1 should still be a valid input, but Nmax>=2 being the cause of the third term means m needs to be >1 (you can't have two dice being maximum out of a set of one 😂)
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Indeed the P(Nmax=2)=0 for a single dice (not 1/2n as the formula would predict!). Another way to see it is to notice that in our derivation we actually had a factor of (m-1) which cancelled out from the numerator and denominator so this is a 0/0 dovision when m=1!
@IsaacDickinson-tf8sf
@IsaacDickinson-tf8sf Ай бұрын
I bet if we had a machine get every term, we could plug it in and get the right answer. If it isn’t an infinite and unpredictable sequence.
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
@IsaacDickinson-tf8sf There is an exact formula called Faulhabers formula! But it's complicated and I don't know a nice intuitive reason for it!
@shadeblackwolf1508
@shadeblackwolf1508 23 күн бұрын
For this problem i'd probably have done with descriptive shorthands, like s for sides, and n for number, or d for dice
@MihaiNicaMath
@MihaiNicaMath 23 күн бұрын
Yes I thought about this! But in the end I wanted to match the notation from Matt Parker's video so that people could go back forth between them
@EebstertheGreat
@EebstertheGreat 27 күн бұрын
I'm not gonna lie, when I saw this thumbnail, I thought it was going to be a pointless video. After all, Matt's asymptotic result is not just simple but very easy to prove. But by 5 minutes in, I realized it was a way better video than I expected. It's a really nice explanation of where the formula comes from and how to interpret it in at least two different ways. I do wish it would give the complete series, but I think there is enough in this video for me to work it out. And I loved the connection to Faulhaber's formula. EDIT: You even mentioned Matt's video that showed max(U₁,U₂) ~ U². I feel like you two could do a whole video on dice and order statistics (e.g. dice of different colors, or dice beating other dice, can be directly related to order statistics, especially when you generalize to more than 2 players). The only thing that makes me sad is the singular "dice." We are being conquered by the Brits once more! I'm cool with our English language, our English common law, etc. But in the singular of dice, I'd rather die.
@MihaiNicaMath
@MihaiNicaMath 27 күн бұрын
Thank you so much for the detailed comment! Indeed, I have on my list of video ideas something about doing beta random variables all visually (for example showing how they are used in Bayesian statistics without integrals). Also, your comment about dice vs die (which I get on almost every video!) is the first comment I've seen delivered in such a friendly way and it made me smile. Thank you!
@drzander3378
@drzander3378 23 күн бұрын
@EebstertheGreat, Not sure what the reference to Brits is about. In English, the singular of ‘dice’ is ‘die’. That’s true regardless of whether it’s autochthonous English or one of its international variants.
@EebstertheGreat
@EebstertheGreat 23 күн бұрын
​@@drzander3378 In England, the singular "dice" is something like ten times as common as the singular "die." I can't remember which dictionary decided to list the singular "die" as "archaic," but that is the general sentiment. For instance, Collins says "In old-fashioned English, `dice' was used only as a plural form, and the singular was die, but now `dice' is used as both the singular and the plural form." _Cambridge Grammar_ says the singular dice "is virtually no longer in use (outside the fixed phrase The die is cast)." In the US, the singular "die" is much more common, though the singular "dice" is also fairly common. Authors of English English dictionaries don't even seem to be aware of this distinction, oddly enough, including ones that normally include American usage. They seem absolutely convinced that the singular "dice" is obsolescent everywhere.
@Patashu
@Patashu Ай бұрын
Very cool math tricks, and I appreciate that you show us exactly where the approximation differs from the real value and by what terms
@MihaiNicaMath
@MihaiNicaMath 28 күн бұрын
Thanks! Knowing what is approximation and what is exactly true is a lot of what I do in real math research :)
@AlonAltman
@AlonAltman 12 күн бұрын
Great video! One comment: For small numbers we usually use little-o notation not big-O, where o(1/n^2) means a value that is negligible relative to 1/n^2.
@MihaiNicaMath
@MihaiNicaMath 12 күн бұрын
Thanks for the comment! In this case, I really do mean to use the big-O notation. O(1/n^2)! (As in the lim_sup (|error|*n^2) = C < \infty) If I had said o(1/n^2) that would be false (since lim |error|*n^2 is *not* equal to 0). I could have said o(1/n) (Which would be techincally correct but weaker than O(1/n^2)), but when you do the argument you see I'm explicitly ignoring terms that start with 1/n^2, so you can see why its O(1/n^2) from the proof I did.
@MathNerdGamer
@MathNerdGamer 21 күн бұрын
I wrote a comment to Matt Parker's video with my own attempt at proving this 2 years ago after watching it. I'll copy it here, since I think it works but want to know where I've erred if it doesn't. For n,k >= 1 and m n obviously gives 0, so that's not very interesting) Equivalently, D(n, k; m) = #{ s in {1, . . ., n}^k | max(s) = m}. An interesting thing happens here, though: Since we're taking m m occurs, we won't be counting it. Therefore, D(n, k; m) = #{s in {1, . . ., m}^k | max(s) = m} Now, let's enumerate all the possibilities. By definition, we have to roll at least one m, and nothing larger than m. Suppose m shows up as the first roll. Then, the other (k-1) rolls can be anything between 1 and m, so this accounts for m^(k-1) elements. If m doesn't show up as the first roll, but is the second roll, that means we had (m-1) possible values for the first roll, 1 value for the second (this is where m is first rolled), and then m^(k-2) possibilities for the last k-2 rolls. This accounts for m^(k-2) * (m-1) elements. This process continues until the only case is where the final roll is m, leaving (m-1)^(k-1) possibilities for the first (k-1) rolls. This gives us the sum: Sum( m^(k-j) * (m-1)^(j-1), j = 1 to k ). I'll leave it as an exercise to the reader to show that this sum comes out to m^k - (m-1)^k. Therefore, D(n, k; m) = m^k - (m-1)^k. Since there are n^k possible sets of k rolls, the probability that the max value of k rolls of n-sided dice is m = (m^k - (m-1)^k)/n^k. Now, we can compute the expected value. Let E(n, k) denote the expected value for the k-roll experiment with n-sided dice. E(n, k) = Sum( m * (m^k - (m-1)^k)/n^k, m = 1 to n ) = (1 / n^k) * Sum( m * (m^k - (m-1)^k), m = 1 to n ) = (1 / n^k) * (n^(k+1) - Sum( m^k, m = 1 to n-1 )). As before, I'll leave the final equality as an exercise to the reader. For k = 1,2,3, it's easy to simplify this down further using the well-known formulas for the sum of the first (n-1) integers, squares, and cubes (resp.): E(n, 1) = (1/n) * (n^2 - [n * (n - 1)] / 2) = (n + 1) / (2) -> For a single roll of a D6, we get (6 + 1) / (2) = 3.5, as expected. E(n, 2) = (1/n^2) * (n^3 - [n * (n - 1) * (2n - 1)] / 6) = (4n^2 + 3n - 1) / (6n) -> For 2 rolls of a D20, we get (1600 + 60 - 1)/(120) = 13.825, which agrees with the 2 rolls of D20 simulations in the video. E(n, 3) = (1/n^3) * ([n^2 * (n-1)^2] / 4) = (3n^2 + 2n - 1) / (4n) -> Matches the value computed in the video. Taking limits as n->infinity also work (using the ~ asymptotic notation): E(n, k) ~ kn/(k+1) and so E(n, k) / n -> k/(k+1) as n->infinity. For the full expression of E(n, k) / n, we'd need to make use of Faulhaber's formula, which is a big complicated expression involving Bernoulli numbers. This means that your conjecture isn't quite true, but it is "true" in an asymptotic sense. Using Faulhaber's formula, E(n, k) = kn/(k+1) + 1/2 + o(1) as n->infinity. [Note: Little-o notation - f(n) = o(g(n)) means f(n)/g(n) -> 0 as n -> infinity. In this case, f(n) = o(1) means f(n) -> 0] For rolling with disadvantage (formulas provided without justification; it's essentially the same as above): d(n, k; m) := # ways that the min value of k rolls of n-sided dice is m = (n-m+1)^k - (n-m)^k probability of min value after k rolls of n-sided dice is m = ( (n-m+1)^k - (n-m)^k ) / n^k e(n,k) := expected value of taking the min of k rolls of n-sided dice = (1/n^k) * Sum( m^k, m = 1 to n ) Using Faulhaber's formula for the sum of the first n kth powers, we find: e(n, k) = n/(k+1) + 1/2 + o(1) as n->infinity where that o(1) packs in a bunch of complicated expressions involving Bernoulli numbers.
@Juttutin
@Juttutin 24 күн бұрын
As a mathy person who struggles with probability beyond just crunching examples, I'm loving this! I'm at 28:07, and almost shivering with antici...pation to discover where that 12th is gonna emerge from.
@MihaiNicaMath
@MihaiNicaMath 24 күн бұрын
Haha that's great! That's exactly where it all comes together full circle!
@ilkerertas
@ilkerertas Ай бұрын
Thanks!
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Wow thank you so much! That is very generous of you!!!
@thatisthewaz
@thatisthewaz Ай бұрын
a great video, such an underrated channel
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Thank you so much, that is very kind! Hoping to make more videos in 2025!
@Lost_Evanes
@Lost_Evanes 21 күн бұрын
Cool video, but the thing that catches the eye about 2term vs 3rd term approximations is: if we fix the N and let M get arbitrary large, with only 2 terms E[max] approaches N, which sounds correct since no matter the size N, if we throw the dice many times (M >> N) then surelly we will get the biggest possible value sooner or later, but with 3rd turm E[max] goes to negative inf, maybe the possitive O(N^2) term could fix this? idk but the concept of better approximation which only works on the N ~ M interval seems strange... surely the simple (M * N)/(M+1) +0.5 formula cant be the best for every pair (N, M)?
@MihaiNicaMath
@MihaiNicaMath 21 күн бұрын
The expansion here holds when n -> \infty, and m is fixed (this is baked into the "O" notation). If you want to make m also very large, then you can start at the exact formula using the N_maxers random variable, and apprimxate from there. For example, if m >> n is actually even larger then n, then a good approximation is m/m+1*n (with no 1/2). This is because if m is very large, you should expect N_maxers to be very larger, so 1/(1+N_maxers) is approximately 0. If you want m/n = constant, then you can approximate N_maxers to be a Poisson random variable of rate m/n to get a pretty good approximation!
@kevinwaugh5192
@kevinwaugh5192 19 күн бұрын
A formula that is exact is 1 + n - sum_{k=1}^{n-1} (k/n)^m. I found this by defining a matrix A such that pi' = A*pi takes the probability distribution of the max value of rolling m n-sided die to the probability distribution of the max value of rolling m+1 n-sided die. The Eigendecomposition of A is easy to compute by hand as it has a nice form. Using the Eigendecomposition you can compute pi_m = Q*(diag(v)^(m-1))*(Q^-1)*(1/n, ..., 1/n) efficiently by exponentiating the Eigenvalues. If you just want the expected value of the max, you can simplify further to the formula provided.
@MihaiNicaMath
@MihaiNicaMath 19 күн бұрын
Yup this formula is mentioned at 7:47 . The eigendeconpostion idea is interesting....I think that would give the m goes to infinity, n fixed asymptotics (rather than the n goes to infinity m fixed that I did in the video)
@valloway
@valloway Ай бұрын
This is a great exposition!
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Thank you! Much appreciated :)
@wyattstevens8574
@wyattstevens8574 12 күн бұрын
I saw you're using the 3B1B animation library! And I remember that if (before you moved the 1/2 to the LHS) you just rounded down, it would be equivalent to just rounding mn/(m+1) instead!
@CasualConlanger
@CasualConlanger Ай бұрын
3 minutes into the video : I don't know why but the ½ by itself and -1/12 coefficient are screaming out Bernoulli to me... I guess I'll have to watch and see!
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Yes it's Bernoulli!!!
@cogwheel42
@cogwheel42 Ай бұрын
I had to stop the video to check for this comment after blurting out "why is -1/12 in there?!"
@gcewing
@gcewing 24 күн бұрын
Obviously it's because he's going to add up all the natural numbers at some point.
@complainer406
@complainer406 21 күн бұрын
Another way to get to the maximum of 3 points being ¾ is to think of finding 1 minus the minimum, so 1 - S1 and since S1 is ¼ you get ¾
@simonwillover4175
@simonwillover4175 25 күн бұрын
18:56 correction: it's the "kth smallest", not the "kth largest", but we can just use the min-max trick from earlier. The kth largest would be (m-k)/(m+1).
@MihaiNicaMath
@MihaiNicaMath 25 күн бұрын
Yes this is true! I guess the exAmple I did happened to be equal but indeed I meant kth from the left
@LukasDrescher
@LukasDrescher Ай бұрын
A very nice explanation. At 28:31 you misspoke, it is m=2
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Thanks! Yes I completely agree: it's the max of two things so it should be "m = 2".
@FireStormOOO_
@FireStormOOO_ 26 күн бұрын
Great presentation, that was surprisingly easy to follow.
@umbraemilitos
@umbraemilitos 25 күн бұрын
Could you do more on the general strategy of Ninja Proofs? I really like what you showed here.
@bjorntorlarsson
@bjorntorlarsson 26 күн бұрын
Great presentation. And more importantly, good thinking.
@landsgevaer
@landsgevaer 26 күн бұрын
Hmm, there are k^m outcomes with all dice in the range 1..k, so (k^m - (k-1)^m)) outcomes where the maximum is exactly k, out of n^m outcomes in total. So the average maximum is SUM (k^m - (k-1)^m))*k / n^m over k=1..n, exactly. Expanding that (k-1)^m as a binomial should give you all the terms, I bet.
@MihaiNicaMath
@MihaiNicaMath 26 күн бұрын
Yup this is mentioned at 7:47 . The point of the video is to find an approximation that works well as n grows (as opposed to being a sum that gets bigger and bigger as n grows)
@kylecow1930
@kylecow1930 Ай бұрын
i remember a couple years ago i tried to work on this myself, I managed to prove that asymtotically the +1/2 would work and was quite chuffed with myself
@kylecow1930
@kylecow1930 Ай бұрын
possibly if i was happier with big O i would've gotten a better result, back then my approach to avoiding lower order terms was to take a limit
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Ya a limit is just proving the error from the first to term is "o(1)" (which just means "the limit is 0"). But in this case since there are no fractional powers, o(1) is the same as O(1/n) :)
@joeeeee8738
@joeeeee8738 Ай бұрын
Incredible description of your logic!!
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Thank you!
@1972C182
@1972C182 20 күн бұрын
Hello Dr. Nica, If, per chance, you are looking for an interesting problem to solve and post to YT, may I suggest a puzzle I have long wondered about, but have not been able to make progress on-the Strong Birthday Puzzle. Rather than asking how many people you need in a room to have a 50% chance that there is _some_ match (yeah, making all the uniform assumptions and 365 days), I am interested in how many people you need in a room to be 50% sure that _everyone_ has at least one match. Such a simple change, but other than simulation, I can’t make progress on it. Thanks again.
@MihaiNicaMath
@MihaiNicaMath 19 күн бұрын
This is interesting! I think I know how to do it recursively but it's indeed a kind of tricky one. I added to my potential videos list :)
@sheppa28
@sheppa28 16 күн бұрын
3064
@1972C182
@1972C182 16 күн бұрын
@@sheppa28 :-). That is funny. OP here. You are absolutely correct that I phrased my question as my interest being in the number. And, you have provided the number. Perfect Asperger’s response. Love it. Of course, my real interest is in the probability distribution of the number of people sharing a birthday as a function of the number of people, and of the number of days in the year (as I might be interested in, say, people born in the same month). But, also of course, I do not actually want that distribution, I want to understand how it can be figured out. An asymptotic approximation would also be of interest. You have totally teased me now-can you provide your reference? As I am not a mathematician, I hope there is some derivation that uses elementary tools. (Ph.D. in statistics, which is far far from mathematics). Thanks again for the funny answer.
@sheppa28
@sheppa28 15 күн бұрын
@@1972C182 Source: DasGupta, Anirban. "The matching, birthday and the strong birthday problem: a contemporary review." Journal of Statistical Planning and Inference 130.1-2 (2005): 377-389. (Available on google scholars) Section 2.6 with Eq 4 for the probability distribution and Theorem 3 for the asymptotic theory. Following example after Theorem 3, asymptotic formula can be set to 1/2 and solved for n using the -1 branch of Lambert W function yielding n_est = -m LambertW[-1, -(Log[2]/m)] which for m=365 yields n=3063.78.
@ComputerNerd98234616
@ComputerNerd98234616 23 күн бұрын
In the calculation of P(All Different) around 37:40 shouldn't the error term be of order O(m^3/n^2), which is not negligible when m^3 is comparable to n^2?
@ComputerNerd98234616
@ComputerNerd98234616 23 күн бұрын
this error is actually more apparent later when you state that the number of coincidences is O(1/n^2) when clearly as m gets larger the probability of 2 or more coincidences must approach 1
@MihaiNicaMath
@MihaiNicaMath 23 күн бұрын
Yes this is true! The big O analysis I do is for m fixed and n growing large. I believe if you want to do it more carefully it's always powers of m/n. (So the next term would be m^2/n^2)
@ckq
@ckq 23 күн бұрын
1:30 yo the 1/12n reminds me of the adjustment in stirlings formula
@introductiontodatascience8657
@introductiontodatascience8657 Ай бұрын
I proved this in a more pedestrian way in a paper a couple of years ago: Does Gaia Play Dice? : Simple Models of non-Darwinian Selection. eqn 9. There are some other dice games and related problems in there you might find interesting 🙂
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Cool! Here's the link for anyone else reading this that wants to check it out arxiv.org/pdf/2301.02623
@pepebriguglio6125
@pepebriguglio6125 28 күн бұрын
You proved the -1/12 thing!
@MihaiNicaMath
@MihaiNicaMath 28 күн бұрын
Haha yes it's the same -1/12 as the infamous Numberphile meme....
@masonskiekonto590
@masonskiekonto590 Ай бұрын
For m rolls of n sided die of consecutive positive integer faces the expected maximum value of a singular die is n - n^{-m} \sum_{i=1}^{n-1} i^m
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Ya this formula is mentioned at 7:47 :) the rest of the video gives a simple approximation for this sum
@masonskiekonto590
@masonskiekonto590 Ай бұрын
​@@MihaiNicaMaththanks for the reply, that's correct, i must've dozed off for a moment there
@diribigal
@diribigal Ай бұрын
Is the 0 term related to half the Bernoulli numbers being 0, since they appear in Faulhaber's formula?
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Yes, its exactly because of the 0 there. But I don't have a nice probability explanation as to why! Probabilitistically its something like an overestimate for the P(N_max = 2) and an underestimate for P(N_max = 3) being equal or something like that
@mars_titan
@mars_titan 22 күн бұрын
At 38:15 why is it that it's multiplied by (1-2/n)? Shouldn't it be (1-1/n) ? Because the first two dices have the same values so there is only one unique value that the next dice should be different from?
@MihaiNicaMath
@MihaiNicaMath 22 күн бұрын
Yes I agree! Should be (1-1/n)*...*(1-(m-2)/n)
@mars_titan
@mars_titan 22 күн бұрын
@@MihaiNicaMath now would this change the ending that the 1/n^2 coefficient is 0?
@MihaiNicaMath
@MihaiNicaMath 22 күн бұрын
@@mars_titan no I did that correctly on paper, just wrote it wrong in the animation!
@ItayTheItay
@ItayTheItay 19 күн бұрын
not sure if i "discovered" this or not, but i think i found the formula for the average maximum of an N sided die with M advantage(m+1 rolls): Sum(from X=1 to N): (X*Sum(from A=1 to M+1): (((X-1)/N)^(A-1) * (1/N) * (X/N)^(M+1-A)) sorry for the HORRIBLE formmating of the comment, its hard to write in plaintext because the formula i made up uses sigma notation INSIDE a sigma notation. So please, if someone who understands math can tell me if its right/ if theres a mistake in it id be glad :) P.S im not sure if it can even qualify as a formula since it uses sigma notatoin inside of a sigma notation, either way its O(n^2) complexity in computer terms so its not too bad for a computer to calculate. also i just think its neat. EDIT: found an easier way to calculate it, heres the formula: N = amount of sides M = amount of rolls Sum(from x=1 to n): ((x/n)*(x^m * (x-1)^m))
@Babakinha
@Babakinha 23 күн бұрын
so cool >:3 nice animations btw
@11pupona
@11pupona Ай бұрын
thanks!! very nice and instructive video.
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Glad it was helpful!
@ProductionsExoTic
@ProductionsExoTic 16 күн бұрын
Question: If Delta draws from [0,1], does the X-Delta not count {1,2,3,4,5} twice? Thus it´s not exactly the same as nU? And if you simply use Delta draws from (0,1] or [0,1), then you exclude 0 or 6. Also, if you round up nU, and you happened to draw 0, then you round to 0, which is not in the ranga of X. Does this matter for the proof at all?
@MihaiNicaMath
@MihaiNicaMath 16 күн бұрын
@@ProductionsExoTic good question! it doesn't matter because being exactly equally to 0 or exactly equal to 1 has probability zero to happen.b
@alexanderdaum8053
@alexanderdaum8053 16 күн бұрын
I think we want U to be (0, 1] and Δ to be [0, 1). For X = ceil(nU) to hold, U should not include 0, as n0 = 0 and X does not include 0. Then for the same reason, our rounding error can never actually include 1, as when nU is an integer, ceil(nU) = nU.
@MihaiNicaMath
@MihaiNicaMath 16 күн бұрын
​@@alexanderdaum8053 It's completely the same: a (0,1] random variable and a (0,1) random variable and a [0,1] are indistinguishable from each other: the have a 0% chance of being different! This is the notion of "almost sure" equality which is used in probability
@haywardhaunter2620
@haywardhaunter2620 25 күн бұрын
Does the 0 to 1 range of the uniform random variables include both 0 and 1? When you "round up", you use the ceiling notation. If your uniform random number happens to be 0 and you multiply that by the number of sides on a die, then you'd get 0, which is not a valid roll. Likewise, if you got a 1 but the delta that you subtract is also 1, you'd also get a 0. Rounding 0 up to 1 to make it a valid roll adds a minuscule bias, making a roll of 1 ever so slightly more likely than any other value. Since the goal is to improve an approximation that's already ignoring very small terms, perhaps this doesn't matter. But I'm not a mathematician, so maybe I'm wrong about how that endpoints of the uniform random variables affect the reasoning.
@MihaiNicaMath
@MihaiNicaMath 25 күн бұрын
Great thought! The truth is that even though things go slightly wrong when it's exactly equal to 0 (exactly as you explained), it doesn't effect things because there is a 0% chance that it will be exactly equal to 0. For example, the chance of being less than 0.00001 is 0.00001 and the chance of being exactly equal to 0 is less than 0.0000001 for any number of 0s (i.e. the chance is 0)
@R.B.
@R.B. 25 күн бұрын
Didn't you mean: _X_ ≈ _floor(nU +1)_ _nU_ is going to be a value [ 0, _n_ ), or is this why you say approximately equal? Edit: hmm, I should have just watched further.
@Kaepsele337
@Kaepsele337 19 күн бұрын
Isn't the P(N_maxers) dependent on the value of the maxiumum? E.g. if the max of 3 dice is 1 then the probability that all three dice have the maximum value of 1 is 100%. It's probably a higher order term, but I think this isn't considered in your exact formula
@MihaiNicaMath
@MihaiNicaMath 19 күн бұрын
Do you mean P(N_Maxers=2)? (P(N_Maxers) on its own is a non-sensical notation). It's true that if you want to calculate P(N_Maxers=2) and you start conditioning on the value of the maximum it will get complicated, like P(N_maxers=2 and Max=x) depends on x. But the way I do it in the video is correct: you just thinking about assigning whether or not the dice are the same value without looking at their values (like in the birthday paradox)...in other words you think of P(N_maxers =2) on its own without looking at the value of the maximum.
@statisticsmatt
@statisticsmatt 25 күн бұрын
Great video! As always! On a side note, here's a link to a video that also proves the general formula for Matt Parker's max-of-dice conjecture. This video shows the exact probability distribution for any n and m, which an exact mean value can be calculated. kzbin.info/www/bejne/aJTLhaeZord0qbcsi=ZiyYxadGX2axbuJZ
@Theo-iz5cj
@Theo-iz5cj Ай бұрын
great video. Thank you!
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
You are welcome!
@hotdogskid
@hotdogskid 28 күн бұрын
Now im curious is there an exact formula that accounts for all the terms? Surely theres a way to neatly represent it with a big sigma or something
@MihaiNicaMath
@MihaiNicaMath 28 күн бұрын
Ya there is! Basically from the argument at 7:47 , we are just looking at the formula for the sum of powers l, and this is given by Faulhabers formula. But I don't have an intuitive reason why the terms come out the way they do...it's somewhat complicated and I'm not seeing the probability pattern beyond the first three terms
@ronaldking1054
@ronaldking1054 24 күн бұрын
With the subtraction of a uniform distribution, you introduced 0 as an outcome. The only way that would be true is if it never could happen, but it has an infinitely small probability rather than a 0 probability. You claimed an equal distribution that is not the same. It still requires an approximation. The delta at 1 can also tie the maximum as 6 - 1 = 5 - 0. This would be exceptionally rare, but not impossible. This also means that delta is ambiguous when you claim it to be a constant as two terms will have deltas and the delta for one is 1 and the delta for the other is 0. From a statistics standpoint, this is still a 0 for the probability, but it is not a 0 exactly. Yes, it is so small that it probably would be covered by the O(1/n^3), but one could argue with the equal sign.
@MihaiNicaMath
@MihaiNicaMath 24 күн бұрын
Great thinking! There is a counterintuitive fact about probability I think you are confused about: For continuous random variables (like the uniform distribution from this video, but also the Gaussian distribution and many others), the probability of any individual outcome is literally 0% (not approximately). The probability of a uniform being exactly equal to 0 is 0%. So these kinds of exceptional cases don't contribute to the final distribution and don't matter (not even approximately!)
@ronaldking1054
@ronaldking1054 24 күн бұрын
@@MihaiNicaMath No, it is defined as 0 to make most of the mathematics make sense, but it is infinitesimally small. As m approaches infinity, you end up with things that start to break the math. This was the original problem, but this error could grow to something that can be seen. You're trying to claim that dx is 0. It is not. It's a small value that we cannot write directly. I do, however, feel confident that it is well within the bounds of your error no matter how big m is.
@MihaiNicaMath
@MihaiNicaMath 24 күн бұрын
@@ronaldking1054 I like your passion! You are a bit mixed up on the use of infinitesimal here: here's a university lecture I gave for a 1st year probability course on this topic that you can watch if you want to learn kzbin.info/www/bejne/kGGTfaeVfM1ggJI
@ronaldking1054
@ronaldking1054 24 күн бұрын
@@MihaiNicaMath This is a multivariable limit with m being the number of rolls going to infinity with the value of delta approaching the value of 1 or 0. The problem is that I do not know which it is for the first part. Based on your representation it is 1. That, however, is squeezing a value to 0, and that value being squeezed is a divisor. I think that it shouldn't be a problem because the variables are independent. You did not however even argue that there was a term except it definitely exists.
@MihaiNicaMath
@MihaiNicaMath 24 күн бұрын
@ronaldking1054 A couple clarifications: 1. m is fixed (n is the thing going to infinity in this analysis) 2. Delta is always uniform from (0,1), it's not changing or getting squeezed
@justcarcrazy
@justcarcrazy 25 күн бұрын
10:53 Why not 1+(5*rand)? It should be impossible to ever get zero with any n-sided die.
@MihaiNicaMath
@MihaiNicaMath 25 күн бұрын
Yes indeed! How to fix it is explained later in the video
@ronaldking1054
@ronaldking1054 24 күн бұрын
What is the probability of [0,1] in your distribution compared to the probability of [0,1] in nU? They are not the same, and introducing the 0 makes more sense than changing the probability of an entire interval from [0,1] in the proof. I noticed that his maximum might all be 0's for delta for the 6's and the 5's could all have 1, but he claimed it would not change the maximum, and it is true, but his delta no longer is a constant. None of it really matters because it is probably encompassed in the O(1/n^3). He, however, would have to show that the E(delta = 1) = E(delta = 0).
@PerriPaprikash
@PerriPaprikash 27 күн бұрын
hmmm... when drawing an X from U, wouldn't E[X] be 1/2? so wouldn't E[S_1] be 1/2?
@MihaiNicaMath
@MihaiNicaMath 27 күн бұрын
S_1 is not just any uniform: it's the uniform on the furthest left. So technically S_1=min(U_1,U_2,...,U_m), which means its average is less than 1/2
@PerriPaprikash
@PerriPaprikash 27 күн бұрын
@@MihaiNicaMath ok i see that now 👍
@romansapp5219
@romansapp5219 22 күн бұрын
When you say “k-th largest” I think you mean to say “k-th smallest” 18:17
@MihaiNicaMath
@MihaiNicaMath 21 күн бұрын
Yes this is true! I mean the "k-th from the left"
@elonitram
@elonitram Ай бұрын
The circle argument makes sense intuitively! How would you show it rigorously?
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
You make a "probability preserving map": it's a function phi that rotates the points like in the animation. Then you argue that the probability of any event is unchanged under phi (this is because the dots are all uniformly random, so rotating them doesnt change any probabilities). Then showing the expected values are all equal is true since E[S_1]=E[phi(S_1)]=E[S_2]
@elonitram
@elonitram Ай бұрын
Thanks for the answer! Then I question the choice of circle, couldn't you make the same argument using a regular polygon (or any other funny shapes for that matter)? How would you make the argument if the underlying distributions are unknown, but you have prior beliefs that it's uniform, could you make a similar argument?
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
​@@elonitram more technically the operation is just shifting on the interval [0,1] with the convention that what goes off the left reappeares on the right side: but as a picture this is a circle! I'm not quite sure what it would mean to do a shape other than a circle...like in what way are the vertices/edges of it being used? If there aren't any it's the same as a circle! The argument does not work for non-uniform things unfortunately
@BramCohen
@BramCohen Ай бұрын
I'm very curious what the next few terms are
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Well hopefully you saw the bonus 4th term at the end of the video! After that you have to read en.m.wikipedia.org/wiki/Faulhaber%27s_formula and en.m.wikipedia.org/wiki/Bernoulli_number to get more terms...they are truly very weird and I have no intuition on what they mean!
@BramCohen
@BramCohen Ай бұрын
@@MihaiNicaMath Yes I saw the fourth term in the video and I looked up that formula but am a bit confused because the terms given don't correlated exactly to the formula terms given, or at least require the correct name subsiitutions and applying some formulas. It does appear that the the 'fifth' term has both a small polynomial term and a small constant term.
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
@@BramCohen looking at it quickly so I might have a mistake but I think the next term is 1/30*m*(m-1)*(m-2)/n^3 and then therm after that is -1/42*m*(m-1)*(m-2)*(m-3)*(m-4)/n^5 . (Note that these are for the maximum: for the sum of powers the plus/minus signs are reversed)
@BramCohen
@BramCohen Ай бұрын
@MihaiNicaMath why is the coefficient of the first term 1/12 instead of 1/6?
@dirksj
@dirksj 19 күн бұрын
I feel like this doesnt pass the simplest sniff test. As m approaches infinity the expected max should approach n as it becomes extremely likely you roll the highest value. This equation instead approaches n +1/2 - infinity which is very wrong.
@MihaiNicaMath
@MihaiNicaMath 19 күн бұрын
The approximation holds as n to infinity with m fixed as explained in the video :) I.e. the error in the approximation goes to zero when n goes to infinity and m is fixed. if you want m to infinity start with the exact equation in terms of nMaxers and approximate it from there, it will be different than what I did here!
@lame_lexem
@lame_lexem Ай бұрын
ah yess yhe classic mat parker formula case
@Tititototo
@Tititototo Ай бұрын
Hello, your topics are highly original and insightful, but if you can work a bit on the verbosity :)
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Noted!
@shoopinc
@shoopinc Ай бұрын
For m and n = 1 your special term is equal to -1/12 = zeta(-1).
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Yes! I didn't want to bring this up in the video but on some sense the -1/12 is the *same* -1/12 that appears in the "1+2+3+...=-1/12" thing from that one Numberphile video!
@trucid2
@trucid2 Ай бұрын
It's everywhere.
@PhilBoswell
@PhilBoswell Ай бұрын
I think there's something wrong with your green screen: there's a little sliver of something in the middle of the video just about level with the top of your head and it's really distracting, sorry!
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Ya I only noticed this after I uploaded: what happened was my green screen very slightly moved and what your seeing is tiny corner of it. I'm so sorry! Will try to fix for next time (coming at this from the math side of things so this is all new to me!)
@rogerkearns8094
@rogerkearns8094 Ай бұрын
_Roll a n-sided dice m times_ You'd think anyone explaining with a formula would use _s-sided_ and _t times._
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
I thought about this but I wanted to match the notation from Matt Parker's video so people could go back/forth more easily
@rogerkearns8094
@rogerkearns8094 Ай бұрын
@@MihaiNicaMath Fair enough, cheers. :)
@thomashanson3476
@thomashanson3476 Ай бұрын
The fourth term is zero, because the sequence follows a similar, if not the same process as finding successive polynomial equations for sums from 1 to n of i^kth power. i.e 1^k + 2^k + 3^k ... + n^k. k=3 => n^4/4 + n^3/2 + (0)n^2 + n/4 As an amateur I've worked on a method to take the equation for k = x to k = x + 1, and disregarding the effects of integration and other trivial things, the underlying structure of how the equations coefficients change looks exactly the same as this formula from the video
@pialba
@pialba 27 күн бұрын
The formula at 7:47 proves this is indeed the same coefficient And as for why the fourth term of 1^m + 2^m + ... + n^m has to be zero, there is a neat ninja symmetry argument to prove it without big calculations (unfortunately, until dice with a negative number of sides are invented, I'm not able to make this argument while staying in the realm of probabilities). Consider S(n) = 1^m + 2^m + ... + n^m and try to expand it backwards. Then S(0) = 0, and also S(-1) = 0 because S(-1) + 0^m = S(0). (This is basically the 0! = 1 thing all over again). If we keep working backwards we find that S(-2) = - (-1)^m, S(-3) = - (-1)^m - (-2)^m, and more generally S(-n) = - (-1)^m - (-2)^m - ... - (-(n-1))^m. Pulling out the negatives, we find that S(-n) = -(-1)^m * S(n-1) = -(-1)^m * (S(n) - n^m), so that S(-n)/(-n)^m = - S(n)/n^m + 1. Now, going back to S(n)/n^m = n/(m+1) + 1/2 + m/12n + a/n^2 + O(1/n^3) and plugging in -n, we find that S(-n)/(-n)^m = -n/(m+1) + 1/2 - m/12n + a/n^2 + O(1/n^3) (notice the sign in front of a/n^2 didn't get flipped, because (-n)^2 = + n^2) ! It then follows that -n/(m+1) + 1/2 - m/12n + a/n^2 + O(1/n^3) = - [n/(m+1) + 1/2 + m/12n + a/n^2 + O(1/n^3)] + 1, and rearranging the terms we get 2*1/2 + 2*a/n^2 + O(1/n^3) = 1, which can only happen if a = 0.
@simonwillover4175
@simonwillover4175 25 күн бұрын
so, we can add more terms, and they will have n^2, n^3, etc..., upto n^m terms.
@MihaiNicaMath
@MihaiNicaMath 25 күн бұрын
Yes! (Actually the exponents are negative i.e. n^-2 etc)
@damyankorena
@damyankorena Ай бұрын
Is it not nᵐ√(¹/ₙ)
@landsgevaer
@landsgevaer 26 күн бұрын
That is based on a uniform **continous** distribution.
@efkastner
@efkastner 23 күн бұрын
Yahtzee!
@klausolekristiansen2960
@klausolekristiansen2960 26 күн бұрын
Or maybe draw a cards
@trucid2
@trucid2 Ай бұрын
The singular of dice is a die.
@MihaiNicaMath
@MihaiNicaMath 29 күн бұрын
People comment this on all of my videos that involve dice (which is a lot of them!), but singular "dice" can be the more common usage depending on where you live (particularly different in North American English vs British English). See e.g. www.oxfordlearnersdictionaries.com/us/definition/english/dice_1 . I personally find singular "dice" more clear since "die"/"dye" has several other meanings, while "dice" is unambiguous.
@mrosskne
@mrosskne 25 күн бұрын
Why are you pointing? We can see what's on the screen. You don't need to tell us what to look at.
@MihaiNicaMath
@MihaiNicaMath 24 күн бұрын
Do you mean the green "laser pointer" or do you mean when I'm pointing with my fingers?
@georgebeck518
@georgebeck518 Ай бұрын
I'm not watching this because of the background drumbeat.
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
I made a version for you with the background music removed: kzbin.info/www/bejne/kISqXoSme8iCl8k Thanks for the feedback!
@monsterkillerxzx8766
@monsterkillerxzx8766 Ай бұрын
@@MihaiNicaMathwhat an amazing response to that comment!
@MihaiNicaMath
@MihaiNicaMath Ай бұрын
Thanks for the kind words...I'm genuinely unsure how to proceed with the background music so happy to let people have options if possible!
@actions-speak
@actions-speak Ай бұрын
@@MihaiNicaMath Your videos are fantastic. I barely noticed there was music.
@georgebeck518
@georgebeck518 Ай бұрын
@@MihaiNicaMath If you have no background music, a viewer can turn on their own if they want.
The average minimum = The sum of powers
2:58
Dr Mihai Nica
Рет қаралды 1,8 М.
What is algebraic geometry?
1:07:01
Banach Center
Рет қаралды 3,2 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
The Evolution of Technology: A Journey with Jim Al-Khalili
59:21
Doc of the Day
Рет қаралды 3,7 М.
Pi hiding in prime regularities
30:42
3Blue1Brown
Рет қаралды 2,6 МЛН
Go First Dice - Numberphile
17:58
Numberphile
Рет қаралды 347 М.
Researchers thought this was a bug (Borwein integrals)
17:26
3Blue1Brown
Рет қаралды 3,9 МЛН
The Math of "The Trillion Dollar Equation"
30:15
Dr Mihai Nica
Рет қаралды 106 М.
The unexpected probability result confusing everyone
17:24
Stand-up Maths
Рет қаралды 852 М.
Some "Prime Numbers" Are Not Fully Prime!
10:31
Combo Class
Рет қаралды 95 М.
One second to compute the largest Fibonacci number I can
25:55
Sheafification of G
Рет қаралды 473 М.
Stockfish Gets Absolutely EMBARRASSED
28:17
GothamChess
Рет қаралды 611 М.
Math News: The Fish Bone Conjecture has been deboned!!
23:06
Dr. Trefor Bazett
Рет қаралды 221 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН