Fall 2009
CS131 – Combinatorial Structures
Homework 3
Homework 3, due Sept 29
You must prove your answer to every question.
Do not rely only on the homework for exercise: there are several selfcheck ex
ercises of the easier kind in the book, try to solve them, too!
Problem 1.
(10pt) Let
A
,
B
be ﬁnite sets,

A
 =
m
>
0,

B
 =
n
>
0. Express the
number of injective functions from
A
to
B
in terms of
m
and
n
. When is this number
0?
Solution.
If
m
>
n
then this number is 0, one cannot map a smaller set into a larger
one injectively. Otherwise, it is
n
(
n

1)
···
(
n

m
+
1). Indeed, let
f
(
x
) be the function.
If
A
=
{
a
1
,...,
a
m
}, then there are
n
choices for
f
(
a
1
), then to keep injectivity,
n

1
choices for
f
(
a
2
), then
n

2 choices for
f
(
a
3
), and so on.
Problem 2.
(10pt) Let
A
,
B
be ﬁnite sets,

A
 =
m
>
0,

B
 =
2. Express the number
of surjective functions from
A
to
B
in terms of
m
.
Solution.
There are 2
m
functions from
A
to
B
=
{
b
1
,
b
2
}, but some of them take only
one value, not two, so they are surjective. In fact there are just two functions taking