WEBVTT
Kind: captions
Language: en

00:00:00.240 --> 00:00:04.880
when most people want some more Randomness in&nbsp;
their life they will turn to something like&nbsp;&nbsp;

00:00:04.880 --> 00:00:12.240
a dice for example a D20 and that's fine if you&nbsp;
want a whole number between one and N but I like&nbsp;&nbsp;

00:00:12.240 --> 00:00:17.880
more nuanced random numbers so I use the random&nbsp;
function on the calculator on my phone which&nbsp;&nbsp;

00:00:17.880 --> 00:00:21.200
you're not going to drop you're going to lower&nbsp;
it in we're not setting up some kind of thank&nbsp;&nbsp;

00:00:21.200 --> 00:00:27.080
you comedic premise here so if I push that random&nbsp;
button on my calculator you'll see I'm getting&nbsp;&nbsp;

00:00:27.080 --> 00:00:36.000
random numbers importantly between Z and one and&nbsp;
that's like Randomness classic reels from 0 to one&nbsp;&nbsp;

00:00:36.000 --> 00:00:40.960
and once we've got one of these random numbers we&nbsp;
can do something with it so for example you could&nbsp;&nbsp;

00:00:40.960 --> 00:00:46.880
take a random number and you could calculate its&nbsp;
square root or you could take two random numbers&nbsp;&nbsp;

00:00:46.880 --> 00:00:54.280
and calculate which one's bigger and it turns out&nbsp;
those two operations are mathematically equivalent&nbsp;&nbsp;

00:00:54.280 --> 00:01:00.400
it's true they're the same thing the first time&nbsp;
I heard this fact I was like no that's not true&nbsp;&nbsp;

00:01:00.400 --> 00:01:05.840
but it is and then I told the fact to Grant&nbsp;
Sanderson from three blue one brown he said no and&nbsp;&nbsp;

00:01:05.840 --> 00:01:10.600
then he realiz like no wait that is true so I was&nbsp;
like oh my goodness this is such an obscure but&nbsp;&nbsp;

00:01:10.600 --> 00:01:16.240
an incredible fact and it's true if you were in&nbsp;
a room doing one of these two operations and you&nbsp;&nbsp;

00:01:16.240 --> 00:01:21.560
didn't tell me which but you gave me the results&nbsp;
I could not distinguish one of them from the other&nbsp;&nbsp;

00:01:21.560 --> 00:01:26.320
so we're going to have a closer look at this and&nbsp;
we're going to prove that it's definitely true&nbsp;&nbsp;

00:01:26.320 --> 00:01:33.680
also there'll be more dice I was sent this F acted&nbsp;
by someone named Dylan from Seattle a viewer of my&nbsp;&nbsp;

00:01:33.680 --> 00:01:41.200
videos they emailed to say they were asking chat&nbsp;
GPT to plot a variety of random based functions so&nbsp;&nbsp;

00:01:41.200 --> 00:01:46.080
for completeness we're going to start with just&nbsp;
plotting a random number between Z and one it's&nbsp;&nbsp;

00:01:46.080 --> 00:01:52.520
completely uniform every real number between zero&nbsp;
and one is equally likely we do have to deal with&nbsp;&nbsp;

00:01:52.520 --> 00:01:58.120
the infinite elephant in the room though which&nbsp;
is that there are uncountably infinitely many&nbsp;&nbsp;

00:01:58.120 --> 00:02:05.200
real numbers between 0 and 1 so technically they&nbsp;
each have a probability of zero of being pecked&nbsp;&nbsp;

00:02:05.200 --> 00:02:11.680
so they're all not going to be pecked but that's&nbsp;
only because real numbers have infinitely many&nbsp;&nbsp;

00:02:11.680 --> 00:02:16.960
uh digits decimal places so what we're actually&nbsp;
going to do is split the number line up into tiny&nbsp;&nbsp;

00:02:16.960 --> 00:02:24.280
tiny bins which is why on the phone it's given&nbsp;
me real numbers but only to 15 decimal places&nbsp;&nbsp;

00:02:24.280 --> 00:02:30.000
so it's 10 to the 15 little buckets that we're&nbsp;
going into so each of them does have a very small&nbsp;&nbsp;

00:02:30.000 --> 00:02:34.520
but nonzero probability so when now when I say&nbsp;
real number or whatever that's what I mean we're&nbsp;&nbsp;

00:02:34.520 --> 00:02:41.640
using little buckets it's fine it's not rigorous&nbsp;
but it's fine we can now take all those random&nbsp;&nbsp;

00:02:41.640 --> 00:02:48.440
numbers between zero and one and uh Dylan asked&nbsp;
chat GPT to show for example uh the square if you&nbsp;&nbsp;

00:02:48.440 --> 00:02:51.720
squared them all that's what you end up with&nbsp;
that's the distribution where the height show&nbsp;&nbsp;

00:02:51.720 --> 00:02:57.920
you the probability of getting that value what if&nbsp;
we did uh two random numbers multiplied together&nbsp;&nbsp;

00:02:57.920 --> 00:03:03.600
subtly different that's what you get you can take&nbsp;
I don't know the minimum of two random numbers you&nbsp;&nbsp;

00:03:03.600 --> 00:03:09.200
can take and here it comes the maximum of two&nbsp;
random numbers and then you can take the square&nbsp;&nbsp;

00:03:09.200 --> 00:03:17.640
root of one random number and Dylan realized those&nbsp;
last two plots were identical they emailed this to&nbsp;&nbsp;

00:03:17.640 --> 00:03:26.360
me I was like no so I plotted them myself and&nbsp;
yes and then I realized that maximum plot was&nbsp;&nbsp;

00:03:26.360 --> 00:03:34.840
a bit familiar I made a video a year or two go&nbsp;
about if you have two D6 Dice and you and you&nbsp;&nbsp;

00:03:34.840 --> 00:03:40.600
roll them both then choosing the highest which if&nbsp;
you're playing Dungeons and Dragons is rolling a&nbsp;&nbsp;

00:03:40.600 --> 00:03:47.840
dice with Advantage I analyzed what the average&nbsp;
value is if you do that for dice of different&nbsp;&nbsp;

00:03:47.840 --> 00:03:54.280
sizes including of course the D20 I then had a&nbsp;
look at what the distributions appear like and&nbsp;&nbsp;

00:03:54.280 --> 00:03:59.040
you may find it very familiar I'll link to the&nbsp;
whole video below but the summary version is if&nbsp;&nbsp;

00:03:59.040 --> 00:04:05.120
you do the sample space of all 36 combinations&nbsp;
of two d6s being rolled and then you group them&nbsp;&nbsp;

00:04:05.120 --> 00:04:11.080
into the ones with the same highest value there's&nbsp;
only one square which if you roll both dice the&nbsp;&nbsp;

00:04:11.080 --> 00:04:16.320
highest value is a one so that's a 1 and 36 chance&nbsp;
there were three with the biggest value was are&nbsp;&nbsp;

00:04:16.320 --> 00:04:23.400
two five for three and all the way up and if you&nbsp;
rearrange that into a bar chart you get pretty&nbsp;&nbsp;

00:04:23.400 --> 00:04:31.400
much a triangle shape and if you were to increase&nbsp;
the number of sides your the dice has that would&nbsp;&nbsp;

00:04:31.400 --> 00:04:38.360
eventually approach the same triangle distribution&nbsp;
that we saw in I guess the extreme version where&nbsp;&nbsp;

00:04:38.360 --> 00:04:44.440
you have two numbers between zero and one pick&nbsp;
the biggest and in that limit you get a perfect&nbsp;&nbsp;

00:04:44.440 --> 00:04:49.120
triangular distribution oh and if you're bored&nbsp;
you can spend a while staring at that and see if&nbsp;&nbsp;

00:04:49.120 --> 00:04:56.360
you can work out why that means the average value&nbsp;
is 2/3 of the maximum value so by just taking the&nbsp;&nbsp;

00:04:56.360 --> 00:05:01.200
limit of a result from a previous video we're&nbsp;
halfway there now we just need to know what&nbsp;&nbsp;

00:05:01.200 --> 00:05:07.200
does it mean to take the square root of rolling a&nbsp;
dice or picking a random number and this is where&nbsp;&nbsp;

00:05:07.200 --> 00:05:13.480
it got interesting because I made the let's say&nbsp;
mistake of mentioning this to Grant Sanderson when&nbsp;&nbsp;

00:05:13.480 --> 00:05:18.720
he was visiting me uh when he was over in the&nbsp;
UK because I explained roughly where I was at&nbsp;&nbsp;

00:05:26.680 --> 00:05:31.160
journey together and we were both supposed to be&nbsp;
working and I made the mistake of uh mentioning&nbsp;&nbsp;

00:05:31.160 --> 00:05:36.840
a maass problem and I'll talk you through the&nbsp;
rough outline that I showed Grant and we filled&nbsp;&nbsp;

00:05:36.840 --> 00:05:41.880
in some gaps uh together and we're going to call&nbsp;
the ROM number X none of this is rigorous by the&nbsp;&nbsp;

00:05:41.880 --> 00:05:52.440
way this is our y = um the square &lt; TK of X graph&nbsp;
you could just put y^2 = X I'm going to call that&nbsp;&nbsp;

00:05:52.440 --> 00:05:58.640
DX it's a little section of this we can then&nbsp;
map that to the amount over here we're going&nbsp;&nbsp;

00:05:58.640 --> 00:06:09.080
to get so we just differentiate both sides and&nbsp;
so we end up with uh two lots of Y Dy equals DX&nbsp;&nbsp;

00:06:09.080 --> 00:06:13.200
and I'm going to leave that as it is for now&nbsp;
the next one I'm going to draw in a way that&nbsp;&nbsp;

00:06:13.200 --> 00:06:18.680
is unnecessarily complicated this is a square if I&nbsp;
fill in the rest of it there's a square that's our&nbsp;&nbsp;

00:06:18.680 --> 00:06:26.520
space we we kind of end up with the outer I mean&nbsp;
Shell's probably not quite the right word is y is&nbsp;&nbsp;

00:06:26.520 --> 00:06:32.080
also just that distance how far out in the Square&nbsp;
we've gone that's also Y and then that little bit&nbsp;&nbsp;

00:06:32.080 --> 00:06:46.440
there is uh d y that area is our d x so we can say&nbsp;
that total area d x X is equal to this rectangle&nbsp;&nbsp;

00:06:46.440 --> 00:07:04.560
which is y * d y plus this area which is y * Dy oh&nbsp;
my goodness it equals 2 y Dy DX = 2 y Dy DX = 2 y&nbsp;&nbsp;

00:07:04.560 --> 00:07:13.280
Dy this was our hand wavy convincing ourselves&nbsp;
yeah these two situations while not in rigor&nbsp;&nbsp;

00:07:13.280 --> 00:07:19.760
terms have the same underlying logic we convinced&nbsp;
ourselves yeah it feels like this is a true fact&nbsp;&nbsp;

00:07:19.760 --> 00:07:28.760
and then Grant was silent for a second and then&nbsp;
said yeah but maybe there's a nicer visual way&nbsp;&nbsp;

00:07:28.760 --> 00:07:35.800
of looking at it classic three blue one brown and&nbsp;
I'm sure enough he came up with one so let's think&nbsp;&nbsp;

00:07:35.800 --> 00:07:40.960
about one of our random values which I'm going to&nbsp;
call X1 and we're assuming this is randomly chosen&nbsp;&nbsp;

00:07:40.960 --> 00:07:45.840
in the interval from 0 to 1 Accord according to&nbsp;
a uniform distribution which in this case just&nbsp;&nbsp;

00:07:45.840 --> 00:07:51.480
means that the probability of falling within a&nbsp;
given range is equal to the size of that range&nbsp;&nbsp;

00:07:51.480 --> 00:07:56.200
for the second random value I'm going to have&nbsp;
you think about it on a kind of Y AIS and again&nbsp;&nbsp;

00:07:56.200 --> 00:08:01.800
this one is chosen uniformly at random between the&nbsp;
values 0er and one and by putting it on a second&nbsp;&nbsp;

00:08:01.800 --> 00:08:08.080
axis like this it means we can think of all the&nbsp;
possible pairs of values X1 X2 as being a point&nbsp;&nbsp;

00:08:08.080 --> 00:08:14.920
in two-dimensional space more specifically a point&nbsp;
inside this little 1 by 1 square now take a moment&nbsp;&nbsp;

00:08:14.920 --> 00:08:20.000
to think about what it looks like for the maximum&nbsp;
of these two values to be equal to some specific&nbsp;&nbsp;

00:08:20.000 --> 00:08:28.000
number like 0.7 well one way that could happen&nbsp;
would be if X1 is equal to 0.7 and X2 is anything&nbsp;&nbsp;

00:08:28.000 --> 00:08:32.120
smaller than it which would put us on this&nbsp;
vertical line here but it could also be the case&nbsp;&nbsp;

00:08:32.120 --> 00:08:37.560
that X2 is equal to 0.7 and X1 is smaller than&nbsp;
that which puts you somewhere on this horizontal&nbsp;&nbsp;

00:08:37.560 --> 00:08:43.440
line here in general when you're dealing with&nbsp;
probabilities over continuous values like this&nbsp;&nbsp;

00:08:43.440 --> 00:08:48.520
it's not very helpful to ask about equality like&nbsp;
the probability that this Max is exactly equal&nbsp;&nbsp;

00:08:48.520 --> 00:08:55.120
to 0.7 since these lines are infantes thin so that&nbsp;
exact probability is actually zero and you kind of&nbsp;&nbsp;

00:08:55.120 --> 00:09:00.040
can't deduce anything about the distribution from&nbsp;
that but what's much more helpful is to switch to&nbsp;&nbsp;

00:09:00.040 --> 00:09:06.120
inequalities and ask what's the probability that&nbsp;
this maximum is something less than or equal to&nbsp;&nbsp;

00:09:06.120 --> 00:09:11.640
this specific value which in our diagram would&nbsp;
mean you fall anywhere inside this green square&nbsp;&nbsp;

00:09:11.640 --> 00:09:16.800
here in that case because everything is uniform&nbsp;
the probability equals the area of that little&nbsp;&nbsp;

00:09:16.800 --> 00:09:23.120
green square so the probability that your max is&nbsp;
below a given value R is always going to equal R&nbsp;&nbsp;

00:09:23.120 --> 00:09:28.560
SAR there's a fancy name here this is called the&nbsp;
cumulative distribution function for our random&nbsp;&nbsp;

00:09:28.560 --> 00:09:34.000
variable on the other hand suppose you just took&nbsp;
one of these values like X1 and you asked what's&nbsp;&nbsp;

00:09:34.000 --> 00:09:39.120
the probability that its square root is less&nbsp;
than R essentially asking for this cumulative&nbsp;&nbsp;

00:09:39.120 --> 00:09:45.720
distribution of the square root of a random value&nbsp;
that's the same is asking when is X1 less than R 2&nbsp;&nbsp;

00:09:45.720 --> 00:09:51.360
and because it's uniform at random in this range&nbsp;
from 0 to 1 the answer there is R 2 exactly what&nbsp;&nbsp;

00:09:51.360 --> 00:09:57.240
you get for the maximum case okay I agree the&nbsp;
visual way of looking at it is really good it&nbsp;&nbsp;

00:09:57.240 --> 00:10:03.160
also means we can generalize what we've seen&nbsp;
so far we can take it up into more Dimensions&nbsp;&nbsp;

00:10:03.160 --> 00:10:07.920
so more random numbers and if you remember my&nbsp;
previous video those of you who saw it about&nbsp;&nbsp;

00:10:07.920 --> 00:10:16.160
the dice you know I went from trying to imagine&nbsp;
that 2D Square elbow plot using dice up into the&nbsp;&nbsp;

00:10:16.160 --> 00:10:23.320
third dimension which we're going to do again&nbsp;
but for that we need a lot more Dice and huh oh&nbsp;&nbsp;

00:10:23.320 --> 00:10:30.880
no so now we can build a 3D version of the plot we&nbsp;
saw um before in 2D we'll start with one dice and&nbsp;&nbsp;

00:10:30.880 --> 00:10:39.320
then we build up uh shells of dice around that to&nbsp;
represent a three-dimensional plot where each axis&nbsp;&nbsp;

00:10:39.320 --> 00:10:46.920
is one of rolling uh three d6s and then picking&nbsp;
the biggest and um this is the same model we had&nbsp;&nbsp;

00:10:46.920 --> 00:10:53.280
last time in case you're curious except we did&nbsp;
drop it and we broke the outer one which is why&nbsp;&nbsp;

00:10:53.280 --> 00:11:00.440
it's now um shanier than ever but it's fine it's&nbsp;
good enough so what this represents is you 6X 6X&nbsp;&nbsp;

00:11:00.440 --> 00:11:06.520
6 Cube so that's taking three distinguishable dice&nbsp;
rolling them picking the biggest Bay which in this&nbsp;&nbsp;

00:11:06.520 --> 00:11:14.360
case is a six and so there's only one way to get&nbsp;
one that's rolling a 111 combo there's all these&nbsp;&nbsp;

00:11:14.360 --> 00:11:20.080
ways there's seven ways to get a two and then you&nbsp;
count all the way up and last time I got obsessed&nbsp;&nbsp;

00:11:20.080 --> 00:11:26.520
with working out a closed nice neat formula using&nbsp;
hexagonal numbers to calculate the average result&nbsp;&nbsp;

00:11:26.520 --> 00:11:32.080
of what you're going to get what Grant realized&nbsp;
is if you generalize his visual proof the kind&nbsp;&nbsp;

00:11:32.080 --> 00:11:37.200
of the same way I've done this you can look at&nbsp;
what happens if you pick three random numbers&nbsp;&nbsp;

00:11:37.200 --> 00:11:42.880
between zero and one and it turns out that's&nbsp;
indistinguishable from taking their cube root&nbsp;&nbsp;

00:11:42.880 --> 00:11:48.760
and four random numbers well you imagine the 4D&nbsp;
version of this and that's equivalent to taking&nbsp;&nbsp;

00:11:48.760 --> 00:11:56.840
the fourth power root of a single random number&nbsp;
absolutely phenomenal the question now is how do&nbsp;&nbsp;

00:11:56.840 --> 00:12:05.120
we apply this back to Rolling dice we can't just&nbsp;
roll let's say 1 D6 and take its square root to be&nbsp;&nbsp;

00:12:05.120 --> 00:12:11.520
the equivalent of rolling 2 d6s and picking the&nbsp;
highest for two issues the first is and this is&nbsp;&nbsp;

00:12:11.520 --> 00:12:16.320
something a lot of people get hung up up on very&nbsp;
early on we're now dealing with numbers bigger&nbsp;&nbsp;

00:12:16.320 --> 00:12:21.080
than one and a lot of people when I originally&nbsp;
told them this fact if they weren't mathematical&nbsp;&nbsp;

00:12:21.080 --> 00:12:28.720
their first objection is no but square roots make&nbsp;
things smaller and that's true if you're above one&nbsp;&nbsp;

00:12:28.720 --> 00:12:34.840
below one because if you multiply something by&nbsp;
a number below one it gets smaller squaring goes&nbsp;&nbsp;

00:12:34.840 --> 00:12:40.560
smaller if you take the square root that makes it&nbsp;
bigger which is why from 0 to 1 the square root&nbsp;&nbsp;

00:12:40.560 --> 00:12:45.800
is equivalent to taking a Max if we're above one&nbsp;
however that no longer works so what you need to&nbsp;&nbsp;

00:12:45.800 --> 00:12:54.120
do is roll the dice a D6 and then divide whatever&nbsp;
you get by six and that scales it all down to be&nbsp;&nbsp;

00:12:54.120 --> 00:13:02.000
between zero and one so for a D20 you'd roll it&nbsp;
divide by 20 we can fix that issue the bigger&nbsp;&nbsp;

00:13:02.000 --> 00:13:08.120
issue is the resolution so if you did it with&nbsp;
a D6 and you divide that by six you're still&nbsp;&nbsp;

00:13:08.120 --> 00:13:12.560
only going to have six possible values because&nbsp;
there only six faces it can land on and that&nbsp;&nbsp;

00:13:13.160 --> 00:13:21.960
it's not enough detail to recreate the nuances of&nbsp;
that 6x6 that 36 value possible space of outcomes&nbsp;&nbsp;

00:13:21.960 --> 00:13:28.640
you need to be able to have enough results to&nbsp;
proportionally get the different values so the&nbsp;&nbsp;

00:13:28.640 --> 00:13:35.840
lack of resolution we cannot fix or at least we&nbsp;
can't fix it with a normal dice like this I found&nbsp;&nbsp;

00:13:35.840 --> 00:13:44.280
one dice for which it works so we no longer&nbsp;
need rd20 instead we need a d 36 if you want&nbsp;&nbsp;

00:13:44.280 --> 00:13:52.520
to recreate rolling uh two dice and picking the&nbsp;
biggest d6s you need a single dice which has the&nbsp;&nbsp;

00:13:52.520 --> 00:13:58.160
square of the number of faces instead of six you&nbsp;
got 36 and that's because it gives you the entire&nbsp;&nbsp;

00:13:58.160 --> 00:14:05.920
sample space but the math works out so nicely so&nbsp;
if you were to roll this and then scale it between&nbsp;&nbsp;

00:14:05.920 --> 00:14:11.760
zero and one You' be dividing it by 36 or 6 squar&nbsp;
you then take the square root of whatever you&nbsp;&nbsp;

00:14:11.760 --> 00:14:18.240
end up with which is equivalent of whatever you&nbsp;
rolled take the square root now divided by just&nbsp;&nbsp;

00:14:18.240 --> 00:14:24.920
a single six but then you got to scale it back&nbsp;
up to represent rolling a D6 so you multiply it&nbsp;&nbsp;

00:14:24.920 --> 00:14:31.880
by that six everything cancels out so it means if&nbsp;
you have a 36 sided dice and you roll it and you&nbsp;&nbsp;

00:14:31.880 --> 00:14:35.960
just take the square root of whatever number you&nbsp;
see and then round that up to the nearest whole&nbsp;&nbsp;

00:14:35.960 --> 00:14:42.920
number that is indistinguishable from Rolling&nbsp;
two d6s and picking the highest value it works&nbsp;&nbsp;

00:14:42.920 --> 00:14:47.680
a fact that I came across which seemed&nbsp;
unbelievable and I realized half of the&nbsp;&nbsp;

00:14:47.680 --> 00:14:53.800
fact applied to something I'd done previously&nbsp;
because it's mass and because the fact was true&nbsp;&nbsp;

00:14:53.800 --> 00:15:00.600
I knew somehow the other half must apply as well&nbsp;
the square root must work and it does you just&nbsp;&nbsp;

00:15:00.600 --> 00:15:05.080
got to pick the right number of sides thank you&nbsp;
so much for watching this video two last things&nbsp;&nbsp;

00:15:05.080 --> 00:15:10.720
to clear up one is uh where on Earth do you get&nbsp;
a d36 from and this is shouldn't be possible&nbsp;&nbsp;

00:15:10.720 --> 00:15:15.800
yeah the fine people at the dice lab made this I&nbsp;
don't think it's strictly completely fair I think&nbsp;&nbsp;

00:15:15.800 --> 00:15:20.440
they just distributed 36 points on a sphere and&nbsp;
then put some planes on it but I will link to the&nbsp;&nbsp;

00:15:20.440 --> 00:15:28.080
dice Lab website below where you can get these if&nbsp;
you're in the UK I think we'll have some not many&nbsp;&nbsp;

00:15:28.080 --> 00:15:35.120
a handful on math gear so I'll link that below&nbsp;
as well and thanks to Dylan from Seattle who I&nbsp;&nbsp;

00:15:35.120 --> 00:15:41.160
have to say did at the time ask chat GPT why the&nbsp;
square root of a random number is the same as the&nbsp;&nbsp;

00:15:41.160 --> 00:15:48.160
max of two random numbers and two chat gpts credit&nbsp;
they put together something that looks like a lot&nbsp;&nbsp;

00:15:48.160 --> 00:15:54.240
like a proof involving cumulative distribution&nbsp;
functions I have not gone through it carefully&nbsp;&nbsp;

00:15:54.240 --> 00:16:00.120
to see if it's actually correct I would be&nbsp;
quite surprised if it was but it went in the&nbsp;&nbsp;

00:16:00.120 --> 00:16:07.520
same direction as well granted so well played&nbsp;
chat GTP not as random as I thought it would be

