Docsity

Combinatorics Midterm 2: Surjective function | MCS 421, Slides of School management&administration

Toggle sidebar
bg1
MCS 421 Midterm 2: 11/8/06
Time: 50 minutes
No aids allowed
Each question is worth 25 points
Good luck!
1. Three candidates A, B, C run for office. A poll has found that 65%, 57%,
58% of the voters think that A, B, C respectively is appropriate, 28%, 30%,
27% think that A and B, A and C, B and C respectively are appropriate,
and 12% think that all three candidates are appropriate. What do you
conclude?
Solution: By the inclusion-exclusion principle, the total percentage of
voters is (65% + 57% + 58%) −(28% + 30% + 27%) + 12% = 107%. Since
this is more than 100%, the data are inconsistent.
2. A surjection is mapping ffrom a set Sonto a set T, that is to say,
every element of Thas the form f(s) for some s∈S. Recall that [n]
denotes {1, . . . , n}. Prove that the number of surjections from [n] to [k]
is Pk
i=0(−1)i¡k
i¢(k−i)n. What identities are obtained when k=nand
when k > n?
Solution: Let Sbe the set of all mappings from [n] to [k], and let Ap
be the set of those members of Sthat do not assume the value pfor
p= 1, . . . , k. The number of surjections is |A1∩ · · · ∩ Ak|. We have
|S|=kn,|Ap|= (k−1)nfor all p,|Ap∩Aq|= (k−2)nfor all p < q,
and so on. By the inclusion-exclusion principle, the number of surjections
is Pk
i=0(−1)i¡k
i¢(k−i)n. When k=nthe surjections are bijections, and
therefore we obtain the identity Pn
i=0(−1)i¡n
i¢(n−i)n=n!. When k > n
there are no surjections, and therefore Pk
i=0(−1)i¡k
i¢(k−i)n= 0.
3. Solve the recurrence hn+1 = 1 + Pn
i=0hi,n≥0 with initial condition
h0= 1.
Solution 1: Let g(x) = h1+h2x+h2x2+· · · . Multiplying by 1
1−xwe
obtain
1
1−xg(x) = X
i≥0
xiX
j≥0
hjxj=X
n≥0Ãn
X
k=0
hk!xn=X
n≥0
(hn+1 −1)xn
=g(x)−1
x−X
n≥0
xn=g(x)−1
x−1
1−x.
Solving this equation for g(x) we obtain g(x) = 1
1−2x, and therefore hn=
2n.
Solution 2: By looking at small values of nwe observe that hn= 2n.
We prove it by induction. The base case n= 0 is clear. If the statement
holds for n, then hn+1 = 1 + Pn
i=0 2i= 1 + (2n+1 −1) = 2n+1 .
1
pf2

Partial preview of the text

Download Combinatorics Midterm 2: Surjective function | MCS 421 and more Slides School management&administration in PDF only on Docsity!

MCS 421 Midterm 2: 11/8/ Time: 50 minutes No aids allowed Each question is worth 25 points Good luck!

  1. Three candidates A, B, C run for office. A poll has found that 65%, 57%, 58% of the voters think that A, B, C respectively is appropriate, 28%, 30%, 27% think that A and B, A and C, B and C respectively are appropriate, and 12% think that all three candidates are appropriate. What do you conclude? Solution: By the inclusion-exclusion principle, the total percentage of voters is (65% + 57% + 58%) − (28% + 30% + 27%) + 12% = 107%. Since this is more than 100%, the data are inconsistent.
  2. A surjection is mapping f from a set S onto a set T , that is to say, every element of T has the form f (s) for some s ∈ S. Recall that [n] denotes { 1 ,... , n}. Prove that the number of surjections from [n] to [k] is

∑k i=0(−1)

i(k i

(k − i)n. What identities are obtained when k = n and when k > n? Solution: Let S be the set of all mappings from [n] to [k], and let Ap be the set of those members of S that do not assume the value p for p = 1,... , k. The number of surjections is |A 1 ∩ · · · ∩ Ak|. We have |S| = kn, |Ap| = (k − 1)n^ for all p, |Ap ∩ Aq | = (k − 2)n^ for all p < q, and so on. By the inclusion-exclusion principle, the number of surjections is

∑k i=0(−1) i(k i

(k − i)n. When k = n the surjections are bijections, and therefore we obtain the identity

∑n i=0(−1) i(n i

(n − i)n^ = n!. When k > n there are no surjections, and therefore

∑k i=0(−1)

i(k i

(k − i)n^ = 0.

  1. Solve the recurrence hn+1 = 1 +

∑n i=0hi,^ n^ ≥^ 0 with initial condition h 0 = 1. Solution 1: Let g(x) = h 1 + h 2 x + h 2 x^2 + · · ·. Multiplying by (^1) −^1 x we obtain

1 1 − x

g(x) =

i≥ 0

xi^

j≥ 0

hj xj^ =

n≥ 0

( (^) n ∑

k=

hk

xn^ =

n≥ 0

(hn+1 − 1)xn

g(x) − 1 x

n≥ 0

xn^ =

g(x) − 1 x

1 − x

Solving this equation for g(x) we obtain g(x) = (^1) −^12 x , and therefore hn = 2 n. Solution 2: By looking at small values of n we observe that hn = 2n. We prove it by induction. The base case n = 0 is clear. If the statement holds for n, then hn+1 = 1 +

∑n i=0 2

i (^) = 1 + (2n+1 (^) − 1) = 2n+1.

  1. Find the number of n-letter words over the alphabet {a, b, c} in which a and b occur an even number of times each, and c occurs an odd number of times. Solution: The exponential generating function for the permutations of a’s is e

x+e−x 2.^ The same is true for^ b’s, and the egf for^ c’s is^

ex−e−x

The total egf is therefore

ex+e−x 2

ex−e−x 2 =^

1 8 (e

3 x (^) + ex (^) − e−x (^) − e− 3 x).

Therefore hn = 18 (3n^ + 1 − (−1)n^ − (−3)n). For even n hn = 0, and for odd n hn = 14 (3n^ + 1).