Skip to content
GATEiit

GATE CSE 2022 Q36: Generating function of a_n = n + 1 for odd n, 1 otherwise

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}

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
Show answer and explanation

Answer: A (official GATE 2022 final answer key)

Concept used: Split an=1+bna_n = 1 + b_n, where bn=nb_n = n for odd nn and 0 otherwise, and sum the two generating functions.

First step: ∑n1⋅xn=11−x\sum_n 1 \cdot x^n = \frac{1}{1-x}; for the rest, find ∑k≥0(2k+1)x2k+1\sum_{k \ge 0} (2k+1) x^{2k+1} by differentiating a geometric series in x2x^2.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2022 CS question paper and final answer key, organised by IIT Kharagpur. Question paper · Answer key