Midsem
Midsem
Exam
Mathematics For Computer
Science
Indian Institute of Technology, Kanpur
Question 1
n
We have seen generating functions for m for variable m keeping n fixed, and for
variable n keeping m fixed. If we wish to make both variable then the generating
function needs to be over two variables.
1 n
P P m n
1. Prove that 1−y−xy
= n≥0 m≥0 m x y .
Solution
1 Part (a) :
The following property can be proved by using the taylor’s expansion of it’s one vari-
able counterpart. First, let us define another variable z as
z = y(1 + x) (1.1)
1 1
= (1.2)
1 − y − xy 1 − y(1 + x)
1 1
= (1.3)
1 − y(1 + x) 1−z
1
We also know by taylor’s expansion of single variable functions that
1 X
= z n f or |z| ≤ 1 (1.4)
1−z n≥0
1 X
= (y(1 + x))n f or |y(1 + x)| < 1 (1.5)
1 − y − xy n≥0
X
= y n (1 + x)n (1.6)
n≥0
1 X X n
= yn xm (1.7)
1 − y − xy n≥0 m≥0
m
X X n
= x yn
m
(1.8)
n≥0 m≥0
m
X X n
= xm y n (1.9)
n≥0 m≥0
m
Note: We were able to move the terms in parenthesis around as m and n were inde-
pendent of each other. Also the above relation is only true for |y(1 + x)| < 1 as only
then the sum on the RHS would converge.
Hence, proved that the given relation holds true.
2 Part (b) :
First, we would be proving some preliminary results that would help us further.
2u 2n−2u
= 4n
P
Claim 1: u≥0 u n−u
X 2i2n − 2i
fn (x) = xn−i (1.10)
i≥0
i n−i
GP 5 2
For proving the claim, we need to find the value of fn (1), which can be found if we try
to find some sort of recursive definition for fn (x). Now, let’s try to define some recur-
sive definition for this function using some observations.
Proof. The intuition behind defining such a relation comes from the fact that if we
substitiute n − i in place of i we do not change the value of binomial coefficient ni .
X 2n − 2i2i
n
x fn (1/x) = xn−i (1.14)
i≥0
n−i i
= fn (x) (1.15)
Hence, proved.
Now, the natural next step for solving for fn (1) is to differentiate the original function
and try to find another relation to eliminate the derivatives at x = 1. So, let’s proceed
GP 5 3
with it.
X 2i2n − 2i + 2
fn+1 (x) = xn+1−i (1.19)
i≥0
i n−i+1
X 2i2n − 2i + 2
0
=⇒ fn+1 (x) = (n + 1 − i)xn−i (1.20)
i≥0
i n − i + 1
X 2i2n − 2i (2n − 2i + 2)(2n − 2i + 1)
0
=⇒ fn+1 (x) = (n + 1 − i)xn−i (1.21)
i≥0
i n−i (n − i + 1)(n − i + 1)
X 2i 2n − 2i
0
=⇒ fn+1 (x) = (2)(2n − 2i + 1)xn−i (1.22)
i≥0
i n − i
X 2i2n − 2i n+1
0 n−i
X 2i 2n − 2i
=⇒ fn+1 (x) = 2 x +4 (n − i)xn−i (1.23)
i≥0
i n − i i=0
i n − i
0
=⇒ fn+1 (x) = 2fn (x) + 4xfn0 (x) (1.24)
0
=⇒ fn+1 (1) = 2fn (1) + 4fn0 (1) (1.25)
Using the relation between value of differential at x = 1 obtained for general n in eq.
(1.18), we can substitute them in eq. (1.25) to get a nice recursive relation which we
desire for.
n+1
fn+1 (1) = 2nfn (1) + 2fn (1) (1.26)
2
=⇒ fn+1 (1) = 4fn (1) (1.27)
Therefore, we got the final recursive relation for value of function at x = 1. Now,
observe the fact that the value of f0 (1) is 1. Hence, fn (1) is a geometric progression
with common ratio 4 and initial term 1, which implies the general value of fn (1) is 4n .
Hence, proved.
Moving further, if we plug in the value of variable x to be 3 in the equation of Part (a)
we get
1 X X n
= 3m y n (1.28)
1 − 4y n≥0 m≥0
m
X
= y n (1 + 3)n (1.29)
n≥0
GP 5 4
X
= 4n y n (1.30)
n≥0
2n
Let f (y) be the generative function for n
, therefore
X 2u
f (y) = yu (1.31)
u
u≥0
X X 2u2v
2
=⇒ f (y) = y (u+v) (1.32)
u≥0 v≥0
u v
Let u + v = n (1.33)
X X 2u2n − 2u
2
=⇒ f (y) = yn (1.34)
n≥0 u≥0
u n − u
(1.35)
Now, we can easily see that amongst the two possible f (y) obtained in the equation
(1.26) only one is acceptable as one of them is strictly the negative of the other and
hence the sequence represented by the it is just the negative of the sequence obtained
using the other. Therefore, we need to select only one out of these two and this can
easily be checked by plugging in y = 0 in the taylor expansion of both of these. Since,
f (0) should be positive number, hence (1 − 4y)−1/2 is the only acceptable solution
amongst the two. Therefore,
f (y) = (1 − 4y)−1/2
GP 5 5
Question 2
For a fixed number k > 0, find the recurrence relation and generating function for the
sequence akn = b nk c. Use these two to derive the generating function for the sequence
2
bkn = b nk c .
Solution
Assuming that n and k both are natural numbers.
For the recurrence relation, we observe that :
n+k n
akn+k − akn = b c−b c=1
k k
. Each integer q occurs k times as coefficient of terms xkq , xkq+1 . . . xkq+k−1 . Taking xkq
as common from these terms we obtain,
1
xi .
P
. For |x| < 1, we have 1−x
=
i≥0
Differentiating it w.r.t. x and multiplying by x, we get
x X
= ixi = G(x)
(1 − x)2 i≥0
GP 5 6
xk X
=⇒ G(xk ) = = ixki
(1 − xk )2 i≥0
1 − xk X 2 ki 1 − xk
fk∗ (x) = · ix = · G∗ (xk )
1 − x i≥0 1−x
say.
So, we differentiate both sides of the equation
x X x−1+1 1 1
2
= ixi = 2
= 2
−
(1 − x) i≥0
(1 − x) (1 − x) 1−x
to get:
2 1 x+1
3
− 2
=
(1 − x) (1 − x) (1 − x)3
. Multiplying by x,
X x(x + 1)
i2 xi = = G∗ (x)
i≥0
(1 − x)3
. Then,
GP 5 7
Question 3
Given numbers from 0 to 2n − 1 in a sequence, what is the number of permutations
of this sequence such that no even number is in its original position (express the
number of permutations in terms of derangement number dn )?
Solution
Derangement: dn is the number of ways we can permute n objects in such a way that,
none of the objects occupy their original position.
Let P denote the set of all permutations of [0, 2n − 1]. Define Ak ⊂ P s.t. ∀ a ∈ Ak
where a is a permutation, then n − k odd numbers in a are in their original place
while the other k odd numbers and all n even numbers are not in their original place
for k ∈ [0, n].
{Ak } ∀ k ∈ [0, n] are disjoint :
For k, l ∈ [0, n], Ak ∩ Al = φ as if a ∈ Ak , then n − k odd numbers in a are in their origi-
nal place and others are in different place, so total number of odd integers in original
place in a can never be more or less than n − k and hence a ∈ / Al ∀ l ∈ [0, n]/k.
Let set of permutations in which even number are not in their original place, AE ⊂ P.
S
AE = (set of permutations where no number is in its original place) (set of permuta-
tions where one odd number is in its original place and others not in original place)
S
. . . (set of permutations where all odd numbers are in their original place and all
other even numbers are not in original place)
[
AE = Ak
k∈[0,n]
[
|AE | = Ak
k∈[0,n]
X
= |Ak | (Ak ∪ Al = φ, ∀k, l ∈ [0, , n])
k∈[0,n]
GP 5 8
For each Ak :
Let the 2n numbers be broken into 2 subgroups where the first subgroup is to be de-
arranged and the second subgroup occupies their original position as before.
For the first subgroup, we must take all the n even numbers and k odd numbers
that will not occupy their original position, by nk ways.Then the rest n − k odd num-
bers must occupy their original position in exactly 1 way. We can derange the first
group by dn+k ways. For a particular value of k, we have dn+k nk permutations.
So, the total number of all such permutations will be sum of cardinalities of all
n
dn+k nk .
P
these sets which is AE =
k=0
GP 5 9
Question 4
Q
Let A be a set containing non-empty sets and define A× = B∈A B. Prove that Axiom
of Choice is equivalent to the statement that for every set A as above, A× 6= ∅.
Solution
Consider the tuple a = {f (g(α))|α ∈ I}. Since f (g(α)) ∈ g(α), for α ∈ I by definition of
f,
⇒ {f (g(α))|α ∈ I} ∈ {{bα |bα ∈ g(α), α ∈ I}}
⇒ {f (g(α))|α ∈ I} ∈ AX
∴ AX 6= φ
GP 5 10
By statement in question, AX 6= φ ⇒ ∃a ∈ AX .
Since the statement in question and Axiom of Choice both imply each other, they
are equivalent.
GP 5 11