CMPUT 272 (Stewart)
University of Alberta
Lecture 19
Reading:
Epp 9.19.3
Counting
Recall:
A set is
finite
if it has no elements or there is a onetoone corre
spondence from
{
1
,
2
, . . . , n
}
to it for some
n
∈
Z
+
.
If
A
is a finite set, then the number of elements in
A
, denoted

A

or
N
(
A
),
is

A

=
0
if
A
=
∅
n
if there is a bijection from
{
1
,
2
, . . . , n
}
to
A,
for some
n
∈
Z
+
Example:
If
m
and
n
are integers,
m
≤
n
, then the number of integers from
m
to
n
inclusive is
n

m
+ 1.
To justify this, we find a bijection from
{
1
,
2
, . . . , n

m
+ 1
}
to
{
m, . . . , n
}
.
Consider matching elements of
{
1
,
2
, . . . , n

m
+1
}
with elements of
{
m, . . . , n
}
:
m
m
+ 1
m
+ 2
. . .
n
l
l
l
l
1
2
3
n

m
+ 1
m
m
+ 1
m
+ 2
. . .
n
=
=
=
=
(
m

1) + 1
(
m

1) + 2
(
m

1) + 3
(
m

1) +
n

(
m

1)
l
l
l
l
1
2
3
n

m
+ 1
Thus
f
:
{
1
, . . . , n

m
+ 1
} 7→ {
m, . . . , n
}
where
f
(
x
) = (
m

1) +
x
is a bijection.
Therefore,
{
m, . . . , n
}
=
n

m
+ 1, that is,
the number of integers from
m
to
n
inclusive is
n

m
+ 1.
1