Question

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

an={n+1,n is odd1,otherwisea_n = \begin{cases} n + 1, & n \text{ is odd} \\ 1, & \text{otherwise} \end{cases}
Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2022 answer key

Solution

Decompose the sequence into a constant base sequence and an odd-indexed linear term.

The sequence is defined as:

an={n+1,n is odd1,n is evena_n = \begin{cases} n + 1, & n \text{ is odd} \\ 1, & n \text{ is even} \end{cases}

We can decompose ana_n as an=1+bna_n = 1 + b_n, where:

bn={n,n is odd0,n is evenb_n = \begin{cases} n, & n \text{ is odd} \\ 0, & n \text{ is even} \end{cases}

The generating function for the constant sequence 1,1,1,…1, 1, 1, \dots is:

∑n=0∞xn=11−x\sum_{n=0}^\infty x^n = \frac{1}{1 - x}

For bnb_n, only the odd terms are non-zero: ∑k=0∞(2k+1)x2k+1=x∑k=0∞(2k+1)(x2)k\sum_{k=0}^\infty (2k + 1) x^{2k+1} = x \sum_{k=0}^\infty (2k + 1) (x^2)^k.

Letting y=x2y = x^2:

∑k=0∞(2k+1)yk=2∑k=0∞kyk+∑k=0∞yk=2y(1−y)2+11−y=2y+(1−y)(1−y)2=1+y(1−y)2=1+x2(1−x2)2\sum_{k=0}^\infty (2k + 1) y^k = 2 \sum_{k=0}^\infty k y^k + \sum_{k=0}^\infty y^k = 2 \frac{y}{(1 - y)^2} + \frac{1}{1 - y} = \frac{2y + (1 - y)}{(1 - y)^2} = \frac{1 + y}{(1 - y)^2} = \frac{1 + x^2}{(1 - x^2)^2}

Multiplying by xx gives x(1+x2)(1−x2)2\frac{x(1 + x^2)}{(1 - x^2)^2}. Adding the constant component 11−x\frac{1}{1-x}:

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

This matches Option (A).

Final answer

Option (A)

Common trap

Omitting the xx factor in front of the odd power series.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2022 Computer Science and Information Technology (CS)
Question
36 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.