4

I have the recursive Equation $$ T(n) = \begin{cases} 0 & \text{for } n = 0,\\ 1 & \text{for } 0 < n \leq 2,\\ \displaystyle 1 + \frac{2}{n} \sum_{i=1}^{n-2} T(i) &\text{else.} \end{cases} $$

Now I want to solve it for large $n$.

Experimentally, I could determine $\lim_{n \to \infty} T(n)/n \approx 0.4324314$, but is there a systematic proof for that?

// EDIT: Experimental result corrected. In my calculation, one constant had slipped up into the nominator, sorry.

  • @openspace It does not hold for $n\in{0,1}$. Do you mean to suggest it for $n\geq 2$? – Clement C. Sep 03 '16 at 21:55
  • @ClementC. but the task is find the expression for large n – openspace Sep 03 '16 at 21:58
  • If $S_n:=T(n)+1$, then $$n,S_n=(n-1),S_{n-1}+2,S_{n-2}$$ for all $n=3,4,\ldots$. Not sure if this is helpful. – Batominovski Sep 03 '16 at 21:58
  • @openspace Yes, but you suggest an equality without quantifiers, not an asymptotic equivalence. – Clement C. Sep 03 '16 at 21:59
  • @Crostul I was thinking along the same lines, but an on mobile. I would recommend you flesh this into answer, as I cannot! – Brevan Ellefsen Sep 04 '16 at 00:08
  • @Crostul How do you conclude the above? I may be missing something, but are you taking the limit as $n\to\infty$ for some terms and not the others — if so, how is that valid? – Clement C. Sep 04 '16 at 02:23
  • @Crostul But you cannot do that (neglect the low-order terms) to cancel out the rest and you the conclusion you wrote above. – Clement C. Sep 04 '16 at 12:01
  • Your own answer (now) shows it, as you do find the solution, with $\frac{T(n)}{n}$ converging to some non-zero value $L$. – Clement C. Sep 04 '16 at 14:21

1 Answers1

5

I suggest you to consider the generating function $f(t) = \sum_{n=0}^{\infty}T(n)t^n$. Then, one can prove by the definition of $T(n)$ that $$\frac{\mathrm{d}}{\mathrm{d}t}f(t) = \frac{2t}{1-t} f(t) + \frac{1}{(1-t)^2}$$ with the initial condition $f(0)=0$.

This differential equation has a solution $$f(t) = \frac{1-e^{-2t}}{2(1-t)^2} = \mbox{tedious computations}= \sum_{n=1}^{\infty} \left( \sum_{k=1}^n \frac{(n+1-k)}{k!}(-2)^{k-1} \right) t^n$$ so that $$T(n)=\sum_{k=1}^n \frac{(n+1-k)}{k!}(-2)^{k-1}$$

PS: Thanks to Christian Blatter who patiently checked and corrected my computations. If one considers large $n$ one can approximate $T(n)$ with

$$\sum_{k=1}^{\infty} \frac{(n+1-k)}{k!}(-2)^{k-1} = \frac{n+1}{-2} \sum_{k=1}^{\infty} \frac{1}{k!}(-2)^{k} - \sum_{k=1}^{\infty} \frac{k}{k!}(-2)^{k-1} = \frac{1-e^{-2}}{2} (n+1) - e^{-2}$$ so that $$\lim_{n \to + \infty} \frac{T(n)}{n} = \frac{1-e^{-2}}{2}$$

Crostul
  • 36,738
  • 4
  • 36
  • 72
  • Are you sure? Using your formula, the first few terms I get are $0,0,1,-1/2,1/2,-1/12$, which doesn't match the OP's definition (and, also, the obvious non-negativity of $T(n)$) – Clement C. Sep 04 '16 at 02:12
  • I am quite sure up to $f(t) = \frac{1-e^{-2t}}{2(1-t)^2}$. Up to that (it took me more than two hours of ink and paper) I didn't check the last "tedious computations" and I went to sleep. – Crostul Sep 04 '16 at 08:31
  • This doesn't work since $T(n)$ would converge to $0$, thus $T(n)/n$ would do the same even faster. – Monkey Supersonic Sep 04 '16 at 09:09
  • 1
    Your $f(t)$ is correct. Its Taylor coefficients are indeed the $T(n)$. The correct formula is $$T(n)=\sum_{k=1}^n{(-2)^{k-1}(n+1-k)\over k!}\ .$$ – Christian Blatter Sep 04 '16 at 10:09
  • @ChristianBlatter Thank you! I'm editing right now. – Crostul Sep 04 '16 at 10:25
  • Again, I inserted large values for $n$ and the result looks correct now. Thank you a thousand times. – Monkey Supersonic Sep 04 '16 at 11:27
  • 1
    It seems that $$\lim_{n\to\infty}{T(n)\over n}={1\over2}(1-e^{-2})\ .$$ – Christian Blatter Sep 04 '16 at 11:40
  • 1
    @ChristianBlatter Indeed, with the new expression, we have $T(n) = n\cdot \frac{1}{-2}\left(\sum_{k=0}^n \frac{(-2)^k}{k!}-1\right)+\frac{1}{2}\sum_{k=1}^n\frac{k-1}{k!}(-2)^k$. The second term converges, so is negligible in front of the first; the first parenthesis converges to $e^{-2}-1\neq 0$, so overall the first term dominates and is equivalent to $\frac{n}{-2}(e^{-2}-1) = n\frac{1-e^{-2}}{2}$. – Clement C. Sep 04 '16 at 12:10
  • (Funnily, the value in question is approximately $0.432$, not the $1.729$ found experimentally by the OP, which appears to be off by a factor $4$.) – Clement C. Sep 04 '16 at 12:17
  • @Clement C. That was my fault. I corrected the experimental result. – Monkey Supersonic Sep 04 '16 at 13:48
  • @Crostul regarding your last edit: it's roughly correct, but a bit sloppy if you do that approximation (basically, finding the equivalent), for it to be fully correct I'd suggest you keep only the leading term. Here, you discard some low-order terms (as you replace thr partial sums by infinite sums) yet keep some others (the $n+1$ instead of $n $, and the other constant term $-e^{-2}$). In short: to get morebthan the asymptotically leading term, you'd need to be more rigorpus than that (and anyway only that term is required here). – Clement C. Sep 04 '16 at 13:53