00:00:01
[Music]
00:00:12
hi good to have you back at this point
00:00:15
your legs are probably a toucha from all
00:00:17
the random walking we've been doing so
00:00:19
let's take a break to roll some dice
00:00:25
[Music]
00:00:33
[Music]
00:00:36
I'm going to keep rolling a standard
00:00:38
sixer dice tracking the sum of my dice
00:00:41
rolls as I go and I'm going to stop
00:00:43
rolling as soon as the sum is at least
00:00:47
[Music]
00:00:50
six how many times do I expect to roll
00:00:53
this
00:00:54
dice probably not many times what do you
00:00:57
think maybe like two or three rolls
00:01:00
let's do our usual thing of seeing what
00:01:03
we can get without trying too hard for
00:01:06
our first rle there is a one and six
00:01:08
chance that we get a six so it's pretty
00:01:11
unlikely we hit the stopping threshold
00:01:12
of six on roll one however with two
00:01:16
roles the sample space of the sum is
00:01:18
this familiar from high school
00:01:21
grid we can see that it is more likely
00:01:23
than not that we have terminated by the
00:01:25
second
00:01:26
roll actually there's less than a one in
00:01:29
three chance we make it past two rolls
00:01:32
what is the chance we make it past roll
00:01:34
three very small to keep going Beyond
00:01:38
three rolls the first three rolls are
00:01:41
required to sum to at most five this
00:01:44
forces all of the dice rolls to be quite
00:01:47
small in value in fact none of them are
00:01:49
allowed to be four or greater and that
00:01:51
knocks off half the outcomes for each
00:01:54
dice we can use this to quickly NAB an
00:01:57
upper Bound for the probability here
00:01:59
each dice has a 1 half chance of rolling
00:02:01
a number less than four so there is a
00:02:04
one on eight chance that we roll three
00:02:06
Dice and they all show something less
00:02:08
than four we can already see that the
00:02:10
bulk of this roll distribution is close
00:02:13
to two rolls and so that's probably
00:02:15
going to be around where the expected
00:02:17
value is and will the actual answer be
00:02:20
slightly above or slightly below two see
00:02:24
if you can reason your way to a decision
00:02:26
on this
00:02:32
it's time for us to prove it the
00:02:34
solution is kind of neat and I'm going
00:02:35
to keep things fairly General so that
00:02:37
you can extend the solution later on to
00:02:41
do things right we will let X denote the
00:02:43
thing of interest that is X is the
00:02:46
number of times the dice has to be
00:02:47
rolled so that the sum of the rolls is
00:02:50
at least six the formula for the
00:02:53
expected value of x looks like this we
00:02:56
take each outcome K that's the number of
00:02:59
RS it takes for the sum to be six or
00:03:02
greater and we multiply by its
00:03:04
Associated probability and then we take
00:03:07
the sum of all of these now in our case
00:03:10
we know that it will take at least one
00:03:12
roll and at most six rolls so we can
00:03:15
attach a range of 1 through six to our
00:03:18
[Music]
00:03:21
sum let me show you a little trick that
00:03:24
comes in handy with such calculations
00:03:26
it's easier to see if we first write the
00:03:28
sum in full and then stack it all up
00:03:31
like a triangle now what are the sums of
00:03:34
each of these columns each column sum is
00:03:37
in itself a sum of probabilities and
00:03:40
therefore a probability for example the
00:03:43
First Column is the probability that X
00:03:46
is greater than zero the second column
00:03:48
is the probability that X is greater
00:03:50
than 1 and so on therefore we have
00:03:53
established that the expected value of x
00:03:56
is equal to the sum of these cumulative
00:03:58
probabilities as k goes from 0 to 5 why
00:04:01
did we do this well it turns out in this
00:04:05
case that these cumulative probabilities
00:04:08
are easier to calculate let's take a
00:04:11
look with an example say we want to
00:04:13
calculate the probability that X is
00:04:15
greater than three then we just need to
00:04:18
count all of the ways we can roll three
00:04:20
Dice and still not have gotten to six
00:04:22
yet for then we know that X is greater
00:04:24
than 3 basically I need to count
00:04:27
solutions to this inequality
00:04:30
where dice one dice two and dice three
00:04:33
are the values of the three dice I've
00:04:35
rolled of course I will eventually need
00:04:37
to divide out by all of the possible
00:04:39
dice rolls to transfer over to
00:04:41
probability land to reduce further we
00:04:45
can just count the solutions to each of
00:04:47
the following equations now we could
00:04:49
Brute Force this but I want to do this
00:04:52
in such a way that you can see how you
00:04:54
might structure the general solution
00:04:56
first three dice must sum to at least
00:04:59
three so we only care about the bottom
00:05:02
three equations and now we have a more
00:05:04
General mathematical thing to work out
00:05:07
given some positive integer M how many
00:05:10
ways can I express it as the sum of
00:05:13
three positive
00:05:14
[Music]
00:05:18
integers the so-called stars and bars
00:05:21
method Works a treat I'll illustrate it
00:05:23
with the bottom equation how many ways
00:05:26
are there to write five as the sum of
00:05:28
three positive integers
00:05:30
well simply take five stars we want to
00:05:34
split this up into three smaller pieces
00:05:37
and we can do this by inserting two bars
00:05:40
into the four possible spaces between
00:05:43
the
00:05:43
stars for example something like this
00:05:47
illustrates that 1 + 2 + 2 is a way of
00:05:50
summing to five therefore to count all
00:05:54
possible ways that three dice can sum to
00:05:56
five we just count all possible ways we
00:05:59
can insert two bars into the above row
00:06:01
of stars well there are four spaces so
00:06:05
the answer is four choose
00:06:10
[Music]
00:06:14
two now in general this approach lifts
00:06:17
and the number of solutions to each
00:06:19
equation can be found reminder our
00:06:22
current goal is to find the probability
00:06:24
that X is greater than 3 as such we
00:06:28
basically need to add up the above
00:06:29
solution counts and divide by how many
00:06:32
possible ways there are to roll three
00:06:34
dice it won't come to you as news that
00:06:37
there are 6 to the power of three
00:06:39
possible outcomes from three dice rolls
00:06:42
so we can see that the probability that
00:06:45
X is greater than 3 is equal to 1 6
00:06:48
cubed multiplied by 2 choose 2 plus 3
00:06:51
choose 2 plus 4 choose 2 summing
00:06:55
binomial coefficients it feels like
00:06:57
we're back in video one we are not not
00:07:00
these are a little bit different and we
00:07:02
can actually use something called the
00:07:04
Christmas stocking theorem to smush this
00:07:07
sum into a single
00:07:09
coefficient the Christmas stocking
00:07:11
theorem tells you that whenever you take
00:07:13
a diagonal sum of numbers in Pascal's
00:07:16
triangle starting from a top edge of the
00:07:19
triangle you can find the answer to the
00:07:21
sum by completing the Christmas stocking
00:07:24
it's also sometimes called the hockey
00:07:27
stick
00:07:28
theorem thus for our sum we can simply
00:07:31
rewrite it as five choose
00:07:34
[Music]
00:07:38
three I'll leave the details to you but
00:07:41
you can generalize this method to find
00:07:43
the other probabilities for our dice in
00:07:45
a similar way you can show that the
00:07:48
probability that X is greater than K is
00:07:51
equal to 1 6 K * 5 choose k for K
00:07:56
ranging from 0 to
00:07:58
5 we done the analysis on the
00:08:00
probability and we now apply the direct
00:08:04
substitution oh is there anything we can
00:08:06
do with this indeed there is and I'll
00:08:09
give you a two-word hint binomial
00:08:11
theorem we can recognize that our
00:08:14
expression is what you get if you expand
00:08:17
1 + 1 16 all to the power of
00:08:20
5 ah thus we have the answer and this
00:08:23
comes out around 2.16 or something like
00:08:26
that which is pretty close to where our
00:08:28
intuitive estimate placed
00:08:31
us okay if you followed all of that well
00:08:34
done and if your Curiosity has flared up
00:08:37
looking at this expression then well
00:08:39
done again because it looks very close
00:08:41
to the form 1 + 1 on N all to the power
00:08:45
of n which many of you know tends to e
00:08:48
the exponential number as n tends to
00:08:51
Infinity okay our has a slightly
00:08:54
different form but you can prove in a
00:08:55
couple of lines that this still tends to
00:08:58
e and actually you can use what we've
00:09:01
learned today to show that the expected
00:09:03
number of times an insid a dice must be
00:09:06
rolled so that the sum of the rols is at
00:09:08
least n is equal to 1 + 1 on N all to
00:09:12
the power of
00:09:15
[Music]
00:09:19
nus1 finally here's something a bit more
00:09:22
challenging for you to work on and send
00:09:24
in you and your friend take turns
00:09:27
rolling a six-sided Dice and you keep a
00:09:29
joint running total the player who first
00:09:32
gets the sum to six or greater gets paid
00:09:35
out the sum my question is do you want
00:09:38
to go first or second when you get the
00:09:42
answer make sure you prove it as usual
00:09:44
send it in for me to look at until next
00:09:47
time enjoy the maths
00:09:50
[Music]