2

For proving $D(n) = n ! \sum_{k=0}^n \frac{(-1)^k}{k !}$, in this post under "derivation of closed form from Recursion", the fact is used that $\frac {(-1)^n}{n!} + \frac {D(n-1)}{(n-1)!}= \sum_{k=0}^n \frac {(-1)^k}{k!} + C $ where $C$ is a constant, which I am at a loss to understand. I do not see what a constant would have to do with something such as derangements with variables, also. For context, here is the full proof given (I marked my spot with ($*$)):

$ $Given $\mathcal{D}(0)=1, \mathcal{D}(1)=0$: Subtracting $n \mathcal{D}(n-1)$ from both sides of $D(n)= (n-1)(D{n-1}(n) + D{n-2}(n))$ yields $$ \mathcal{D}(n)-n \mathcal{D}(n-1)=-(\mathcal{D}(n-1)-(n-1) \mathcal{D}(n-2)) $$ this implies $$ \mathcal{D}(n)-n \mathcal{D}(n-1)=(-1)^n $$ Dividing both sides by $n$ ! yields $$ \frac{\mathcal{D}(n)}{n !}-\frac{\mathcal{D}(n-1)}{(n-1) !}=\frac{(-1)^n}{n !} $$ This is very simple to solve for $\frac{\mathcal{D}(n)}{n !}$ : $$ \frac{\mathcal{D}(n)}{n !}=\sum_{k=0}^n \frac{(-1)^k}{k !}+C \tag{$*$} $$ Plugging $n=0$ into this equation yields that $C=0$. Therefore, $$ \mathcal{D}(n)=n ! \sum_{k=0}^n \frac{(-1)^k}{k !} $$

I would appreciate an explanation as to $\frac {(-1)^n}{n!} + \frac {D(n-1)}{(n-1)!}= \sum_{k=0}^n \frac {(-1)^k}{k!} + C $.

Mike Earnest
  • 75,930
Princess Mia
  • 2,403
  • Not sure what you don't get. For each value of $C$ we get a solution to the known recurrence for $D_n$. Of course, only one $C$ satisfies the known initial conditions, so we can solve for $C$. this is how recursions generally work out. – lulu Sep 15 '23 at 18:25

3 Answers3

2

In general, let $a_0,a_1,\dots$ and $b_0,b_1,\dots,$ be sequences such that $$ a_n-a_{n-1}=b_n,\qquad \forall n\ge 1\tag1 $$ Then it is always true that $$a_n=(a_0-b_0)+\sum_{k=0}^n b_k,\tag2$$ for all $n\ge 0$. Proof: $$ a_n=a_0+\sum_{k=1}^{n}(a_k-a_{k-1})=a_0+\sum_{k=1}^n b_k=(a_0-b_0)+\sum_{k=0}^n b_k $$ The first equation above holds because the sum $\sum_{k=1}^n (a_k-a_{k-1})$ is telescoping.

To apply this to your problem, set $$ a_n=\frac{D(n)}{n!}, \qquad b_n={(-1)^n\over n!}, \qquad C = a_0-b_0,$$ in $(2)$, and conclude $$ \frac{D(n)}{n!}=C+\sum_{k=0}^n \frac{(-1)^k}{k!}. $$


Compare and contrast with differential equations. Suppose that $F(x)$ is a differentiable function such that $$F'(x)=f(x).\tag{1'}$$ Using FTOC, you can then conclude, for any $x>0$, that $$ F(x)=F(0)+\int_0^x f(t)\,dt\tag{2'} $$ Note the resemblence between $(1)$ and $(1')$. Instead of a sequence, you have a continuous function, and instead of the difference $a_n-a_{n-1}$, there is a derivative $F'(x)$. Furthermore, $(2)$ and $(2')$ are similar, where summation has been replaced with integration. This is the reason that the solution used the $+C$ notation, which is usually reserved for integration.

Mike Earnest
  • 75,930
1

Let $a_n = \frac{\mathcal{D}(n)}{n !}.$ Then the relevant equation becomes

$$a_n = a_{n-1} + \frac{(-1)^n}{n!}.$$ This says to get from one element of the sequence to the next you just add $(-1)^n/n!$. So to get from the first element to the last element, you just continually add terms $(-1)^n/n!$. To write this mathematically (but avoiding sigma notation):

Substituting $n-1$ for $n$ in the above equation, we have $$a_{n-1} = a_{n-2} + \frac{(-1)^{n-1}}{(n-1) !}.$$

Putting those together,

$$a_n = a_{n-2} + \frac{(-1)^{n-1}}{(n-1) !} + \frac{(-1)^n}{n !}.$$

Continuing, we get...

$$a_n = a_{0} + \frac{(-1)^{1}}{(1) !} + \cdots + \frac{(-1)^{n-1}}{(n-1) !} + \frac{(-1)^n}{n !}.$$

Then we just plug in $a_0 = 1$ and we are done.

Coming back to the original approach, it assumes a bit more experience with recurrence relations, namely that any two solution sequences for a recurrence relation of the form $a_n - a_{n-1} = b_n$ will be the same up to a constant $C$, just like (if you are familiar with calculus) any two solutions to a differential equation $f'(x) = g(x)$ will be the same up to a constant $C$. So for example, $a_n = n^2$ and $a_n = n^2 + \sqrt{\pi}$ are both equally good solutions to $a_n - a_{n-1} = 2n -1$, as you can check. So once you have found one such solution, you've found all of them - it's only a matter of finding the right $C$.

Jair Taylor
  • 16,852
0

The equation before the constant appears is a difference. So you know "what increases" in each step, but you don't know - beforehand - "where you started", which is a constant. I'd say this is simply not written detailed, since this constant will be related to the value $D(0)$ in some way, but the "specific way" doesn't matter in this case since you get its value in the next equation.

Burno
  • 343