Skip to content

GATE CS 2022 Q26 — Combinatorics: Counting, Recurrence Relations, Generating Functions

Explain with AI

Which one of the following is the closed form for the generating function of the sequence {an}n≥0\{ a_{n} \}_{n \geq 0} defined below?

an={n+1,n is odd1,otherwisea_{n} = \left\{\begin{matrix} n + 1, & \text{n is odd} & \\ 1, & \text{otherwise} & \end{matrix}\right.

Choose one option
View worked solution

Answer: A

The given sequence is defined as:

an={n+1,if n is odd1,otherwisea_n = \begin{cases} n+1, & \text{if } n \text{ is odd} \\ 1, & \text{otherwise} \end{cases}

Writing out the first few terms of the sequence {an}n≥0\{a_n\}_{n \ge 0}:

a0=1,a1=2,a2=1,a3=4,a4=1,a5=6,…a_0 = 1, \quad a_1 = 2, \quad a_2 = 1, \quad a_3 = 4, \quad a_4 = 1, \quad a_5 = 6, \dots

The generating function A(x)A(x) for this sequence is:

A(x)=∑n=0∞anxn=1+2x+x2+4x3+x4+6x5+…A(x) = \sum_{n=0}^{\infty} a_n x^n = 1 + 2x + x^2 + 4x^3 + x^4 + 6x^5 + \dots

We can separate A(x)A(x) into even and odd powers of xx:

A(x)=(1+x2+x4+… )+(2x+4x3+6x5+… )A(x) = (1 + x^2 + x^4 + \dots) + (2x + 4x^3 + 6x^5 + \dots)

The even part is a standard geometric series:

E(x)=1+x2+x4+⋯=11−x2E(x) = 1 + x^2 + x^4 + \dots = \frac{1}{1-x^2}

The odd part can be simplified by factoring out 2x2x:

O(x)=2x(1+2x2+3x4+4x6+… )O(x) = 2x(1 + 2x^2 + 3x^4 + 4x^6 + \dots)

Using the standard binomial series ∑k=0∞(k+1)yk=1(1−y)2\sum_{k=0}^{\infty} (k+1)y^k = \frac{1}{(1-y)^2} with y=x2y = x^2:

O(x)=2x(1−x2)2O(x) = \frac{2x}{(1-x^2)^2}

Combining both parts, we get:

A(x)=2x(1−x2)2+11−x2=2x+1−x2(1−x2)2A(x) = \frac{2x}{(1-x^2)^2} + \frac{1}{1-x^2} = \frac{2x + 1 - x^2}{(1-x^2)^2}

Now, let us simplify the expression in Option A to see if it matches:

x(1+x2)(1−x2)2+11−x=x+x3(1−x2)2+1+x1−x2\frac{x(1+x^2)}{(1-x^2)^2} + \frac{1}{1-x} = \frac{x+x^3}{(1-x^2)^2} + \frac{1+x}{1-x^2} =x+x3+(1+x)(1−x2)(1−x2)2= \frac{x+x^3 + (1+x)(1-x^2)}{(1-x^2)^2} =x+x3+1−x2+x−x3(1−x2)2=2x+1−x2(1−x2)2= \frac{x+x^3 + 1 - x^2 + x - x^3}{(1-x^2)^2} = \frac{2x + 1 - x^2}{(1-x^2)^2}

Since both expressions are identical, Option A is the correct closed form.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Combinatorics: Counting, Recurrence Relations, Generating Functions questions