JAMES GRIME: Today, we're going
to talk about one of the questions that we get sent in a
lot at Numberphile, and the question is-- well, Brady,
what's the question? BRADY HARAN: The question is,
why does 0 factorial equal 1? JAMES GRIME: Right. Why does 0 factorial equal 1? So let's start off with a
quick recap of what a factorial is. For our whole number, let's
pick a number n-- n factorial, which is written
like that. n with an exclamation mark. This is equal to. You multiply all the
whole numbers less than or equal to n. It's n multiplied by n minus
1 multiplied by n minus 2 multiplied by-- and you keep going down,
and you'll go down to 3 times 2 times 1. Quick example. Let's do 5 factorial. 5 times 4 times 3
times 2 times 1. And you do that. It's 120. OK. The question we've been asked
is what is 0 factorial. So the way you can answer this--
one of the ways you can answer this is to complete
the pattern. Let's complete the pattern. This pattern in particular,
4 factorial, is equal to 5 factorial divided by 5. If you can see that, if I take 5
factorial here and divide by 5, that means I can knock
off that 5, and you end up with 4 factorial. So 5 factorial divided
by 5, or 120 divided by 5, that's 24. That's 4 factorial. 3 factorial is going to be
4 factorial divided by 4. That's 24 divided by 4. That's 6. That's the answer
to 3 factorial. 2 factorial, 3 factorial divided
by 3, 6, which we've just worked out, divided
by 3, equals 2. 1 factorial. Do it again. It's 2 factorial divided by 2. 2 factorial is 2 divided by 2. We've got 2 divided by 2. That's equal to 1. Now this is where it's
getting exciting. Do you feel the anticipation? So 0 factorial. We're going to complete
the pattern. 0 factorial is 1 factorial
divided by 1. 1 factorial is 1. It's 1 divided by 1, and
that is equal to 1. So 0 factorial is equal to 1. You complete the pattern. BRADY HARAN: Who says the
pattern has to be complete? Where's that rule come from? JAMES GRIME: I guess it doesn't
necessarily have to be a pattern that completes. It is a pattern that
competes, though. Let me try another way
to explain it. BRADY HARAN: Let me continue
the pattern first. Does that mean negative 1
factorial would be next in that sequence? JAMES GRIME: Let's
see what happens. I'm not sure what's
going to happen. Let's try. Minus 1 factorial. So what shall I get? 0 factorial divided by 0. 1 divided by 0. BRADY HARAN: Oh, divided by 0. JAMES GRIME: You've broken
maths, Brady. Stop that. Another way to explain what
0 factorial might be. n factorial is the number
of ways you can arrange n objects. Let me just try to show
you what I mean. Let's get some objects. I'll get the wallet out. I'll get some coins out. See? Who says mathematicians don't
make a lot of money? There's literally 50p here. Let's pick a silver
one and a 5p one. Three objects here, and how many
ways are there to arrange three objects? There's six ways to do it. It's 3 factorial. Let's just check them. That's one, that's two, or we
could have this one here-- that's three, that's four. Or we could have-- I think it was that one we
didn't have at the front. So that would be five and six. If we take one away, we
have now two objects. How many ways are there to
arrange two objects? That's one, that's two. Take one away. How many ways are there
to arrange one object? There it is. There's one way to do it. One way to arrange one object. Now we're going to take
the last coin away. This is where it gets a
little philosophical. We have zero objects. How many ways are there to
arrange zero objects? There's one way to do it. There it is. Do you want to see
me do it again? There it is. Slightly philosophical, but
we say there is one way to arrange zero objects. So again, the pattern holds. 0 factorial equals 1. Just to continue the idea just a
little bit further, if we're talking about factorials, let's
try and graph them. So let's say let's have one,
two, three, four, five. 1 factorial is 1, so
if you call that 1. 2 factorial is 2, so somewhere
about here. 3 factorial is 6. I don't know. Somewhere like this. 4 factorial is 24, so that's
going to be actually quite high up here. And then 5 factorial is
going quite high. If we join these together,
I've also said that 0 factorial is 1, so I reckon
this is the graph. So in theory, we should be
able to get values for in between, like, say, the
number 1 and 1/2. 1 and 1/2 factorial. What is 1 and 1/2 factorial? So mathematicians
have done that. They generalize the idea. And there is the idea of
1 and 1/2 factorial. We call it gamma. That's the Greek letter gamma. We call it gamma of. And the way we write it-- actually, now this is getting
a bit more sophisticated. We say gamma of n is equal to
the integral between 0 and infinity of-- let's pick something-- t to the power n minus 1,
multiplied by e to the power minus n dn. Some people won't be
familiar with that. Some of you will be familiar
with that. Some of you won't be. It's a much more complicated
mathematical idea, but this would agree with
the factorials. But it gives you in between
values as well. It plots this line. There is something
I do need to say. It's slightly unexpected, but if
we take a value for a whole number, gamma of n, and n is
whole, this actually gives you n minus 1 factorial, so
be careful of that. That might catch you out. Bit of a pain, that. So what's the point of having a
function that will give you factorials in between whole
numbers when you can't arrange 1 and 1/2 objects? So it's a generalization, and
it turns out to be quite useful in many things. Particularly, I'm thinking
of probability. You can use them in formulas
that you find in probability where you're thinking about
continuous time instead of just arranging objects in
discreet probability. You're now starting to think
about continuous events. Time is the best example. Then you start to generalize the
ideas, and therefore you need a generalized factorial. BRADY HARAN: 9, 6, and 3. 20. 44.