1

I am trying to find the generating function for the sequence: $-2, 4, -8, 16, -32, 64, ...$ and I am not sure what the answer is.

I have colleagues who are saying that $g(x) = \frac{1}{(1+2x)}$ is the correct answer but based on my work below I believe $g(x) = \frac{-2x}{(1+2x)}$ is the correct answer. What is correct and how did you solve this problem?


My work

Recursive equation: \begin{cases} a_{1} = -2 \\ a_{n+1} = -2a_{n}, & n \geq 1 \end{cases}

$$ a_{n+1} = -2a_{n} $$

$$ a_{n+1}x^{n+1} = -2a_{n}x^{n+1} $$

$$ \sum_{n \geq 1} a_{n+1}x^{n+1} = \sum_{n \geq 1} -2a_{n}x^{n+1} $$

$$ \sum_{n \geq 2} a_{n}x^{n} = -2x\sum_{n \geq 1} a_{n}x^{n} $$

$$ \sum_{n \geq 1} a_{n}x^{n} - (\underbrace{-2x}_\text{$a_{1}x$}) = -2x\sum_{n \geq 1} a_{n}x^{n} $$

Let $S = \sum_{n \geq 1} a_{n}x^{n}$

$$ S + 2x = -2xS \implies S + 2xS = -2x \implies S(1 + 2x) = -2x $$

$$ S = \sum_{n \geq 1} a_{n}x^{n} = \frac{-2x}{(1+2x)} $$

NoName123
  • 437
  • 1
    If, for $\lvert x \rvert < 1$

    $$\frac{1}{1 - x} = 1 + x + x^{2} + \dots$$

    then

    \begin{align} \frac{1}{1 + 2x} &= \frac{1}{1 - (-2x)} \ &= 1 + (-2x) + (-2x)^{2} + \dots \ &= 1 - 2x + 4x^{2} + \dots \ \implies \frac{-2}{1 + 2x} &= -2 + 4x - 8x^{2} + \dots \ \end{align}

    – Matthew Cassell Oct 06 '21 at 14:23
  • multiply mattos' idea by $-2x$ and what do you find? –  Oct 06 '21 at 14:31
  • 2
    There are various way to define a generating function. For your case, in comes down whether your sequence start at $n = 0$ or $n = 1$. If you sequence start at $n = 0$, the answer is $\frac{-2}{1+2x}$. If your sequence start at $n = 1$ w/o any implicit $a_0$, the answer is $\frac{-2x}{1+2x}$. If sequence start at $n = 1$ w/ an implicit $a_0 = 1$, the answer is $\frac{1}{1+2x}$. Which one to use depends on how are you going to use your generating function. As a rule of thumb, pick one which make your life easier and inform others about your convention. – achille hui Oct 06 '21 at 14:35
  • @achillehui Your answer seems like exactly what I am looking for. Do you want to create a complete actual answer on the topic where you explain the differences? I feel like that would clear up a lot of things for me. I'll accept the answer afterwards. – NoName123 Oct 06 '21 at 14:40

1 Answers1

1

Comment expanded to answer per request.

An infinite sequence is a list of numbers in particular order. The most common convention is index them by natural numbers $\mathbb{N} = \{0,1,\ldots\}$. If we call them $a_0, a_1,\ldots$, its OGF (ordindary generating function) is defined to be the formal power series: $$G(a_n; x) = \sum_{n=0}^\infty a_n x^n$$ The whole point of OGF is transform the sequence to a "function like object", and by manipulating the OGF, one hopefully extract useful information about the underlying sequence.

Since OGF is a tool, we are typically not that strict to insist indexing the sequence start at $n = 0$. Depends on application, sometimes it is more natural to start the sequence at $n = 1$.

As an example, if one want to study the number of ways of tiling a $2\times n$ rectangle by dominos. It will be more natural to directly use the height of the rectangle $n$ as index. So $n$ start at $1$ and $a_n$ is the number ways of tiling.

In that case, one can define the OCF as $$\tilde{G}(a_n;x) = \sum_{n=1}^\infty a_n x^n$$ As long as you inform others about your convention, everything will be fine.

For your sequence $-2,4,-8,\ldots$, its comes down to whether your sequence start at $n=0$ or $n=1$.

  1. If you sequence start at $n=0$ (this is the default), the answer is $\frac{-2}{1+2x}$.
  2. If your sequence start at $n=1$ (without any implicit $a_0$), the answer is $\frac{-2x}{1+2x}$.
  3. In the case where sequence start at $n=1$ with an implicit/preferable $a_0 = 1{}^{\color{blue}{[1]}}$, the answer is $\frac{1}{1+2x}$. However, I don't see any reason one should assign $1$ to $a_0$.

Which one to use depends on how are you going to use your generating function. As a rule of thumb, pick one which make your life easier and inform others about your convention.

Note

  • $\color{blue}{[1]}$ For a lot of problem where the natural choice of $n$ start at $1$, the expression can be simplified by an appropriate choice of $a_0$ (usually $0$ or $1$). In that case, you extend your sequence to include an extra $a_0$ and use OCF $G(\cdots)$ instead of $\tilde{G}(\cdots)$.
achille hui
  • 125,323
  • Please see the comments that I left, immediately following this answer. In effect, I am requesting that someone provide an extremely detailed generating function oriented answer to this question. Bulbasaur has declined to provide such an answer. So now, I am asking you to please provide such an answer. – user2661923 Oct 08 '21 at 01:13