Math 132
Midterm II
April 29, 2012
14:00 - 16:00
Name
:
Section :
ID# :
Department
:
• The exam consists of 5 questions of equal weight.
• Please read the questions carefully.
• Show all your work in legibly written, well-organized mathematical
sentences.
• Calculators and dictionaries are not allowed.
• Simplify as far as possible unless otherwise stated.
• Please turn off your cellular phones before the exam starts.
• Extra sheets of paper, if needed, will be provided.
Please do not write below this line.
Q1
Q2
Q3
Q4
Q5
Total
20
20
20
20
20
100
1) For A = {(−4, −20), (−3, −9), (−2, −4), (−1, −11), (−1, −3), (1, 2), (1, 5),
(2, 10), (2, 14), (3, 6), (4, 8), (4, 12)}, define the relation < on A by (a, b)<(c, d)
if ad = bc.
a) Verify that < is an equivalence relation on A.
Solution We need to show that < is reflexive, symmetric and transitive.
Since ab = ba, (a, b)<(a, b) and so < is reflexive.
if (a, b)<(c, d), then ad = bc that is cb = da and so (c, d)<(a, b). Hence, < is
symmetric.
if (a, b)<(c, d) and (c, d)<(e, f ), then ad = bc and cf = de. Therefore, adcf = bcde
or af = be that is (a, b)<(e, f ). Hence, < is transitive.
b) Find the equivalence classes [(2, 14)], [(−3, −9)], and [(4, 8)].
Solution (x, y)<(2, 14) ⇔ 14x = 2y ⇔ y = 7x and so [(2, 14)] = {(2, 14)}.
Similarly, (x, y)<(−3, −9) ⇔ y = 3x and (x, y)<(4, 8) ⇔ y = 2x. Hence,
[(−3, −9)] = {(−3, −9), (1, 3), (4, 12)} and [(4, 8)] = {(1, 2), (4, 8), (−2, −4), (3, 6)}.
2) Find the number of permutations of a, b, c, ....x, y, z (26 letters) in which none
of the patterns “spin”, “game”, “path” or “net” occurs.
Solution
Let c1 , c2 , c3 and c4 be the set of permutations where “spin”, “game”, “path”
or “net” occurs respectively. Therefore, we need to determine N (c¯1 c¯2 c¯3 c¯4 ). Clearly,
N = 26!, N (c1 ) = N (c2 ) = N (c3 ) = (26−4+1)! = 23! and N (c4 ) = (26−3+1)! = 24!
Similarly, N (c1 c2 ) = (26 − 8 + 2)! = 20!, N (c1 c4 ) = (26 − 6 + 1)! = 21! since “spin”
and “net” both occurs simultaneously only in the form ....spinet..... Furthermore,
N (c1 c3 ) = N (c2 c3 ) = N (c2 c4 ) = N (c3 c4 ) = N (c1 c2 c3 ) = ... = N (c2 c3 c4 ) =
N (c1 c2 c3 c4 ) = 0. Hence, by inclusion exclusion principle, we find that
N (c¯1 c¯2 c¯3 c¯4 ) = 26! − (3.23! + 24!) + 20! + 21!.
3) a) For n ≥ 49, let a(n) be the number of ways a father can divide n dollars
among his 3 children aged 3, 4 and 5 proportional to their age in such a way that
the youngest child receives at least 9 dollars and the other children receive at least
20 dollars each. Write a generating function for a(n).
Solution The generating function is
(x9 + x12 + x15 + ...)(x20 + x24 + x28 + ...)(x20 + x25 + x30 + .....)
x49
=
.
(1 − x3 )(1 − x4 )(1 − x5 )
b) Show that the number of partitions of a positive integer n where no summand
(part) appears more than twice equals the number of partitions of n where no
summand is divisible by 3.
Solution Let a(n) be the number of partitions of n where no summand (part)
appears more than twice and b(n) be the number of partitions of n where no
summand is divisible by 3. It suffices to show that a(n) and b(n) have the same
generating function. Observe that the generating function for a(n) is
1
(1 + q + q
1+1
2
)(1 + q + q
2+2
3
)(1 + q + q
3+3
)··· =
∞
Y
(1 + q n + q 2n ).
n=1
Next,
∞
Y
Q∞
(1 − q 3n )
(1 + q + q ) = Qn=1
∞
n
n=1 (1 − q )
n=1
Q∞
3n
1
n=1 (1 − q )
Q
= ∞
= Q∞
,
3n
3n−1
3n−2
3n−1
)(1 − q
)
)(1 − q 3n−2 )
n=1 (1 − q )(1 − q
n=1 (1 − q
n
2n
which is the generating function for b(n) and so we are done.
4) For n ≥ 7, let b(n) be the number of integer solutions of
x1 + x2 + x3 + x4 = n
with x1 , x2 ≥ 0, 4 ≤ x3 ≤ 7 and 3 ≤ x4 ≤ 11.
Find a generating function for b(n) and use it to calculate b(22).
Solutions Here the generating function is
(1 + x + x2 + x3 + ....)(1 + x + x2 + x3 + ....)(x4 + x5 + ... + x7 )(x3 + x4 + ... + x11 )
x7 (1 − x4 )(1 − x9 )
=
(1 − x)4
∞ X
4+k−1 k
7
4
9
13
= x (1 − x − x + x )
x
k
k=0
∞ X
3+k k
7
4
9
13
= x (1 − x − x + x )
x .
k
k=0
It suffices to compute the coefficient of x22−7 = x15 in
∞ X
3+k k
(1 − x − x + x )
x
k
k=0
4
9
13
and we find the coefficient to be
18
14
9
5
−
−
+
.
15
11
6
2
5) a) Consider ternary strings —that is, strings where 0, 1 and 2 are the only
symbols used. For n ≥ 1, let c(n) count the number of ternary strings of length n
where there are no consecutive 1’s and no consecutive 2’s. Find a recurrence relation
for c(n).
Solution Observe that c(1) = 3 and c(2) = 7. Let α(n), β(n) and γ(n) be the
number of ternary strings of length n that ends with 0,1 and 2 respectively. Clearly,
c(n) = α(n) + β(n) + γ(n). Moreover, α(n) = c(n − 1), β(n) = α(n − 1) + γ(n − 1)
and γ(n) = α(n − 1) + β(n − 1). Therefore,
c(n) = α(n) + β(n) + γ(n)
= c(n − 1) + α(n − 1) + γ(n − 1) + α(n − 1) + β(n − 1)
= c(n − 1) + c(n − 1) + α(n − 1)
= c(n − 1) + c(n − 1) + c(n − 2)
= 2c(n − 1) + c(n − 2)
Hence, c(n) = 2c(n − 1) + c(n − 2), n ≥ 2, c(1) = 3, c(2) = 7.
b) Solve the recurrence relation
kn+2 = 4(kn+1 − kn ), k0 = 1, k1 = 8.
Solution The characteristic polynomial x2 −4x+4 has only one root, namely x = 2.
Therefore, kn = a2n + nb2n = (a + nb)2n for some constants a and b.
From k0 = 1, we find that a = 1. Similarly, from k1 = 8, we find that 2(a + b) = 8
or b = 3. Hence, kn = (1 + 3n)2n .
© Copyright 2026 Paperzz