WEBVTT
00:00:00.590 --> 00:00:05.150
In this segment we introduce a
simple but powerful tool, the
00:00:05.150 --> 00:00:08.450
basic counting principle, which
we will be using over
00:00:08.450 --> 00:00:11.820
and over to deal with
counting problems.
00:00:11.820 --> 00:00:15.070
Let me describe the idea through
a simple example.
00:00:15.070 --> 00:00:18.380
You wake up in the morning and
you find that you have in your
00:00:18.380 --> 00:00:23.120
closet 4 shirts, 3 ties,
and 2 jackets.
00:00:23.120 --> 00:00:27.000
In how many different ways can
you get dressed today?
00:00:27.000 --> 00:00:30.580
To answer this question, let
us think of the process of
00:00:30.580 --> 00:00:36.220
getting dressed as consisting of
three steps, three stages.
00:00:36.220 --> 00:00:40.910
You first choose a shirt, let's
say this one, and you
00:00:40.910 --> 00:00:44.600
have 4 choices of shirts.
00:00:44.600 --> 00:00:50.600
But each shirt can be used
together with 1 of the 3
00:00:50.600 --> 00:00:55.710
available ties to make
3 different shirt-tie
00:00:55.710 --> 00:00:58.520
combinations.
00:00:58.520 --> 00:01:03.540
But since we had 4 choices for
the shirt, this means that we
00:01:03.540 --> 00:01:09.970
have 4 times 3, equals 12,
shirt-tie combinations.
00:01:09.970 --> 00:01:12.160
Finally, you choose a jacket.
00:01:12.160 --> 00:01:15.240
Each shirt-tie combination can
go together with either
00:01:15.240 --> 00:01:19.400
jacket, and so the fact that you
have 2 jackets available
00:01:19.400 --> 00:01:25.320
doubles the number of options
that you have, leading to 24
00:01:25.320 --> 00:01:27.340
different options overall.
00:01:27.340 --> 00:01:31.190
So 24 is the answer to
this simple problem.
00:01:31.190 --> 00:01:33.530
And how did the number
24 come about?
00:01:33.530 --> 00:01:37.420
Well, 24 is the same as the
number of options you had in
00:01:37.420 --> 00:01:40.009
the first stage times the number
of options you had in
00:01:40.009 --> 00:01:43.530
the second stage times the
number of options you had in
00:01:43.530 --> 00:01:45.539
the third stage.
00:01:45.539 --> 00:01:48.610
Let us generalize.
00:01:48.610 --> 00:01:51.840
Suppose we want to construct
some kind of object, and we're
00:01:51.840 --> 00:01:55.110
going to construct it through a
sequential process, through
00:01:55.110 --> 00:01:58.890
a sequence of r different
stages.
00:01:58.890 --> 00:02:02.140
In the example that we just
considered, the number of
00:02:02.140 --> 00:02:05.600
stages was equal to 3.
00:02:05.600 --> 00:02:09.600
At each one of the stages, you
have a number of options that
00:02:09.600 --> 00:02:10.699
are available.
00:02:10.699 --> 00:02:14.500
So in our example, at the first
stage we had 4 options,
00:02:14.500 --> 00:02:19.270
at the second stage we had 3
options, and at the last stage
00:02:19.270 --> 00:02:21.990
we had 2 options.
00:02:21.990 --> 00:02:27.930
What is important is that when
you reach stage i, no matter
00:02:27.930 --> 00:02:31.430
what you chose, no matter what
you did at the previous
00:02:31.430 --> 00:02:35.329
stages, the number of options
that you will have available
00:02:35.329 --> 00:02:42.180
at stage i is going to be that
fixed number, n-sub-i.
00:02:42.180 --> 00:02:44.200
So what is the answer?
00:02:44.200 --> 00:02:47.500
How many different objects can
you construct this way?
00:02:47.500 --> 00:02:50.950
Well, just generalizing from
what we did in our specific
00:02:50.950 --> 00:02:56.500
example, the answer is the
product of the number of
00:02:56.500 --> 00:03:02.950
choices or options that
you had at each stage.
00:03:02.950 --> 00:03:05.240
This is the counting
principle.
00:03:05.240 --> 00:03:08.740
It's a very simple idea,
but it is powerful.
00:03:08.740 --> 00:03:11.140
It will allow us
to solve fairly
00:03:11.140 --> 00:03:13.790
complicated counting problems.
00:03:13.790 --> 00:03:17.990
However, before we go into more
complicated problems, let
00:03:17.990 --> 00:03:21.760
us first deal with a few
relatively easy examples.
00:03:26.300 --> 00:03:31.660
In our first example, let us
consider license plates that
00:03:31.660 --> 00:03:35.240
consist of 2 letters followed
by 3 digits.
00:03:35.240 --> 00:03:37.320
The question is, how
many different
00:03:37.320 --> 00:03:39.620
license plates are there?
00:03:39.620 --> 00:03:43.250
We think of the process of
constructing a license plate
00:03:43.250 --> 00:03:45.130
as a sequential process.
00:03:45.130 --> 00:03:51.700
At the first stage we choose a
letter, and we have 26 choices
00:03:51.700 --> 00:03:53.460
for the first letter.
00:03:53.460 --> 00:03:57.690
Then we need to choose the
second letter, and we have 26
00:03:57.690 --> 00:03:59.700
choices for that one.
00:03:59.700 --> 00:04:01.210
Then we choose the
first digit.
00:04:01.210 --> 00:04:03.160
We have 10 choices for it.
00:04:03.160 --> 00:04:06.870
We choose the second digit, for
which we have 10 choices.
00:04:06.870 --> 00:04:09.460
And finally, we choose the last
digit, for which we also
00:04:09.460 --> 00:04:10.790
have 10 choices.
00:04:10.790 --> 00:04:13.880
So if you multiply these
numbers, you can find the
00:04:13.880 --> 00:04:16.560
number of different license
plates that you can make with
00:04:16.560 --> 00:04:18.930
2 letters followed
by 3 digits.
00:04:18.930 --> 00:04:23.540
Now let us change the problem a
little bit and require that
00:04:23.540 --> 00:04:28.775
no letter and no digit can
be used more than once.
00:04:31.300 --> 00:04:35.960
So, let us think of a process
by which we could construct
00:04:35.960 --> 00:04:38.580
license plates of this kind.
00:04:38.580 --> 00:04:44.480
In the first stage, we choose
the first letter that goes to
00:04:44.480 --> 00:04:48.450
the license plate, and
we have 26 choices.
00:04:48.450 --> 00:04:51.620
Now, let us go into a second
stage where we choose the
00:04:51.620 --> 00:04:54.070
second letter.
00:04:54.070 --> 00:04:57.930
Because we used 1 letter in the
first stage, this means
00:04:57.930 --> 00:05:02.690
that there's only 25 available
letters that can be used.
00:05:02.690 --> 00:05:06.900
We only have 25 choices
at the second stage.
00:05:06.900 --> 00:05:08.790
Now, let us start dealing
with the digits.
00:05:08.790 --> 00:05:12.530
We choose the first digit, and
we have 10 choices for it.
00:05:12.530 --> 00:05:17.400
However, when we go and choose
the next digit we will only
00:05:17.400 --> 00:05:20.780
have 9 choices, because
1 of the digits has
00:05:20.780 --> 00:05:22.620
already been used.
00:05:22.620 --> 00:05:26.450
At this point, 2 digits have
been used, which means that at
00:05:26.450 --> 00:05:30.630
the last stage we have only
8 digits to choose from.
00:05:30.630 --> 00:05:34.590
So by multiplying these numbers,
we can find out the
00:05:34.590 --> 00:05:37.590
answer to this question, the
number of license plates if
00:05:37.590 --> 00:05:40.860
repetition is prohibited.
00:05:40.860 --> 00:05:43.830
Let us now consider a
different example.
00:05:46.450 --> 00:05:49.450
Suppose that we start
with a set that
00:05:49.450 --> 00:05:51.710
consists of n elements.
00:05:54.540 --> 00:05:57.130
What we want to do is
to take these n
00:05:57.130 --> 00:06:00.230
elements and order them.
00:06:00.230 --> 00:06:03.650
A terminology that's often used
here is that we want to
00:06:03.650 --> 00:06:07.290
form a permutation of
these n elements.
00:06:07.290 --> 00:06:11.850
One way of visualizing
permutations is to say that
00:06:11.850 --> 00:06:14.720
we're going to take these
elements of the set, which are
00:06:14.720 --> 00:06:18.010
unordered, and we're
going to place them
00:06:18.010 --> 00:06:20.590
in a sequence slots.
00:06:20.590 --> 00:06:23.030
So we create n slots.
00:06:26.390 --> 00:06:31.750
And we want to put each one of
these elements into one of
00:06:31.750 --> 00:06:33.500
these slots.
00:06:33.500 --> 00:06:36.350
How do we go about it?
00:06:36.350 --> 00:06:39.760
We think of putting the
elements into slots,
00:06:39.760 --> 00:06:41.890
one slot at a time.
00:06:41.890 --> 00:06:44.350
We first consider
the first slot.
00:06:44.350 --> 00:06:48.740
We pick one of the elements
and put it there.
00:06:48.740 --> 00:06:50.820
How many choices do we
have at this stage?
00:06:50.820 --> 00:06:54.260
We have n choices, because we
can pick any of the available
00:06:54.260 --> 00:06:56.930
elements and place
it in that slot.
00:06:56.930 --> 00:07:00.420
Next, we pick another
element and put it
00:07:00.420 --> 00:07:02.380
inside the second slot.
00:07:02.380 --> 00:07:04.765
How many choices do we
have at this step?
00:07:04.765 --> 00:07:10.180
Well, we have already used one
of the available elements,
00:07:10.180 --> 00:07:13.280
which means that there's n minus
1 elements to choose
00:07:13.280 --> 00:07:17.160
from at the next stage.
00:07:17.160 --> 00:07:20.190
At this point, we have used
2 of the elements.
00:07:20.190 --> 00:07:24.120
There is n minus 2
that are left.
00:07:24.120 --> 00:07:30.100
We pick one of them and put it
in the third slot, and we have
00:07:30.100 --> 00:07:33.080
n minus 2 choices
at this point.
00:07:33.080 --> 00:07:34.580
We continue this way.
00:07:34.580 --> 00:07:36.230
We keep going on.
00:07:36.230 --> 00:07:39.640
At some point we have placed
n minus 1 of the
00:07:39.640 --> 00:07:41.090
elements into slots.
00:07:41.090 --> 00:07:44.730
There's only one element left,
and that element, necessarily,
00:07:44.730 --> 00:07:47.610
will get into the last slot.
00:07:47.610 --> 00:07:50.730
There are no choices to
be made at this point.
00:07:50.730 --> 00:07:57.500
So the overall number of ways
that we can carry out this
00:07:57.500 --> 00:08:01.160
process, put the elements into
the n slots, by the counting
00:08:01.160 --> 00:08:04.510
principle is going to be the
product of the number of
00:08:04.510 --> 00:08:09.870
choices that we had at each
one of the stages.
00:08:09.870 --> 00:08:13.710
So it's the product of the
numbers n, n minus 1, n minus
00:08:13.710 --> 00:08:17.660
2, all the way down to 1.
00:08:17.660 --> 00:08:24.430
And this product we denote as a
shorthand this way, which we
00:08:24.430 --> 00:08:26.300
read as n factorial.
00:08:26.300 --> 00:08:31.100
n factorial is the product of
all integers from 1 all the
00:08:31.100 --> 00:08:32.799
way up to n.
00:08:32.799 --> 00:08:37.640
And in particular, the number of
permutations of n elements
00:08:37.640 --> 00:08:40.900
is equal to n factorial.
00:08:40.900 --> 00:08:44.039
Let us now consider
another example.
00:08:44.039 --> 00:08:48.460
We start again with a
general set, which
00:08:48.460 --> 00:08:51.500
consists of n elements.
00:08:51.500 --> 00:08:55.120
And we're interested
in constructing a
00:08:55.120 --> 00:08:56.880
subset of that set.
00:08:59.472 --> 00:09:02.350
In how many different
ways can we do that?
00:09:02.350 --> 00:09:06.540
How many different subsets
are there?
00:09:06.540 --> 00:09:09.700
Let us think of a sequential
process through which we can
00:09:09.700 --> 00:09:11.040
choose the subset.
00:09:11.040 --> 00:09:14.580
The sequential process proceeds
by considering each
00:09:14.580 --> 00:09:18.640
one of the elements of our
set, one at a time.
00:09:18.640 --> 00:09:20.750
We first consider the
first element, and
00:09:20.750 --> 00:09:22.650
here we have 2 choices.
00:09:22.650 --> 00:09:27.090
Do we put it inside
the set or not?
00:09:27.090 --> 00:09:29.260
So 2 choices for the
first element.
00:09:29.260 --> 00:09:31.600
Then we consider the
second element.
00:09:31.600 --> 00:09:32.990
Again, we have 2 choices.
00:09:32.990 --> 00:09:36.910
Do we put it in the
subset or not?
00:09:36.910 --> 00:09:42.770
We continue this way until we
consider all the elements.
00:09:42.770 --> 00:09:45.020
There's n of them.
00:09:45.020 --> 00:09:48.020
And the overall number of
choices that we have is the
00:09:48.020 --> 00:09:53.520
product of 2 times 2 times
2, n times, which is 2
00:09:53.520 --> 00:09:56.620
to the power n.
00:09:56.620 --> 00:09:59.760
At this point, we can also do
a sanity check to make sure
00:09:59.760 --> 00:10:02.320
that our answer is correct.
00:10:02.320 --> 00:10:07.770
Let us consider the simple and
special case where n is equal
00:10:07.770 --> 00:10:12.270
to 1, which means we're starting
with this set with 1
00:10:12.270 --> 00:10:14.650
element, and we want to
find the number of
00:10:14.650 --> 00:10:16.320
subsets that it has.
00:10:16.320 --> 00:10:20.820
According to the answer that we
derived, this should have 2
00:10:20.820 --> 00:10:24.740
to the first, that
is 2 subsets.
00:10:24.740 --> 00:10:26.830
Which ones are they?
00:10:26.830 --> 00:10:33.160
One subset of this set is the
set itself and the other
00:10:33.160 --> 00:10:36.090
subset is the empty set.
00:10:36.090 --> 00:10:39.720
So we do have, indeed, 2 subsets
out of that set, which
00:10:39.720 --> 00:10:42.600
agrees with the answer
that we found.
00:10:42.600 --> 00:10:47.460
Notice that when we count
subsets of a given set, we
00:10:47.460 --> 00:10:52.720
count both the set itself, the
whole set, and we also count
00:10:52.720 --> 00:10:53.630
the empty set.
00:10:53.630 --> 00:10:56.420
All of these are subsets
of our set.
00:10:58.960 --> 00:11:03.430
At this point, we can now
pause and you can try to
00:11:03.430 --> 00:11:07.290
answer some simple questions of
the same kind as the ones
00:11:07.290 --> 00:11:08.600
that we just practiced.