1

Consider the following recurrences allowing function $g_2:\mathbb N\to \mathbb N.$ $g_2(n)=\begin{cases} n+1 &\;\text{if $n=0$ or $n=1$}\\ n+1+\sum_{i=1}^{n-1} (i.g_2(n-1-i)) &\;\text{if $n>1$} \end{cases}$

$g_2(n) = 2^n$ for all $n\in\mathbb N$ is what I want to prove. Here's the original image.


My attempt:

Prove $g_2(n) = 2^n, \forall n \in \mathbb N$

Base cases:

let n = 0

$g_2(0) = 0 + 1 = 1 = 2^0 = 2^n$ [def of both functions] as wanted

let n = 1

$g_2(1) = 1 + 1 = 2 = 2^1 = 2^n$ [def of both functions] as wanted

Inductive step: let $n > 1$

Suppose $g_2(j) = 2^j$ whenever $0 \leq j < n$ [I.H]

WTP: $g_2(n) = 2^n$

$g_2(n) = n + 1 + \sum_{i=1}^{n-1} (i \cdot g_2(n-1-i))$ [def of $g_2(n); n > 1$]

= $n + 1 + \sum_{i=1}^{n-1} i \cdot 2^{n-1-i}$ [I.H]

= $n + 1 + \sum_{i=0}^{n-1} i \cdot 2^{n-1-i}$ [Since $i=0$ is just $0$ so same thing?]

Confused on the above step. Could someone help?

SarGe
  • 3,010
Tinler
  • 1,061
  • You're almost there! Notice $\sum_{i=0}^{n-1} i \cdot 2^{n-1-i}$ can be factored as $2^{n-1} \cdot \sum_{i=0}^{n-1} \frac{i}{2^{i}}$. Then use https://math.stackexchange.com/questions/129302/finite-sum-sum-i-1n-frac-i-2i – User203940 Sep 18 '17 at 18:14

1 Answers1

1

Take your inductive hypothesis to be \begin{eqnarray*} \sum_{i=1}^{n-1} i 2^{n-i-1} =2^n-(n+1). \end{eqnarray*} Then \begin{eqnarray*} \sum_{i=1}^{n} i 2^{n-i} =n+ 2\sum_{i=1}^{n-1} i 2^{n-i-1} =n+2(2^n-(n+1)) =2^{n+1}-(n+2). \end{eqnarray*}

Donald Splutterwit
  • 36,613
  • 2
  • 26
  • 73