Derivative of a sequence

My colleagues were recently discussing the idea of taking the derivative of a sequence. For example, consider the Fibonacci sequence F(n)={0n=01n=1F(n1)+F(n2)n2. F(n) = \begin{cases} 0 & n = 0 \\ 1 & n = 1 \\ F(n-1) + F(n-2) & n \ge 2 \end{cases}. What meaning can we assign to dFdn?\frac{\mathrm{d} F}{\mathrm{d} n}?

My first instinct was that this is obviously a pointless exercise, since differentiation is inherently a limiting process. The best you could hope to do is a finite difference approach: ΔFΔnn+=F(n+1)F(n)(n+1)n=F(n+1)F(n), \left. \frac{\Delta F}{\Delta n} \right|_{n^+} = \frac{F(n+1) - F(n)}{(n+1) - n} = F(n+1) - F(n), but that's hardly interesting. It's also possible to make the sequence into a continuous function, whose derivative is then straightforward to calculate, but by doing so, I feel that you lose the nature of the sequence.

Chemical potential

It later occurred to me that I had seen something like this before. In thermodynamics, the chemical potential is defined as the change in internal energy with particle number: μ=UN. \mu = \frac{\partial U}{\partial N}. The number of particles is an integer, so this appears to be similar to the above quantity. In fact, I had previously been perplexed by the presence of an infinitesimal change in particle number.

My mistake was forgetting that all values in thermodynamics are averages, so NN in that expression is not necessarily an integer. It is the average number of particles, and may very well be a fractional quantity. The above expression is more explicitly written as μ=UN, \mu = \frac{\partial \langle U \rangle}{\partial \langle N \rangle}, where the average internal energy is U=ipiEi \langle U \rangle = \sum_{i} p_i E_i and the average number of particles is N=ipiNi. \langle N \rangle = \sum_{i} p_i N_i. I'm using pip_i to mean the probability of microstate ii to avoid all the business with writing out partition functions and Boltzmann factors.

We can apply this idea to taking the derivative of a sequence F(n)F(n) with respect to nn. Instead of the initial question, we ask about dFdn, \frac{\mathrm{d} \langle F \rangle}{\mathrm{d} \langle n \rangle}, where F=n=0pnF(n) \langle F \rangle = \sum_{n=0}^\infty p_n F(n) and n=n=0pnn. \langle n \rangle = \sum_{n=0}^\infty p_n n. This requires us to have a probability distribution for the indices, so it's not a property of the sequence alone, but it is a concrete definition.

Fibonacci & Poisson

The simplest distribution with which to start is the Poisson distribution, with one parameter λ\lambda and pmf pn=eλλnn!. p_n = e^{-\lambda} \frac{\lambda^n}{n!}. This immediately gives us the simple expression n=λ. \langle n \rangle = \lambda. I don't know of anything as nice for F\langle F \rangle, but we can calculate it numerically as a function of n\langle n \rangle: Average F for Fibonacci & Poisson. For comparison, 10F(n)10 F(\langle n \rangle) is plotted with points and en104 \frac{e^{\langle n \rangle}}{10^4} is dashed. The variance of the distribution grows as n\langle n \rangle, so we expect the average value to contain contributions from higher and higher values of F(n)F(n), and it's not surprising that F\langle F \rangle increases much faster than F(n)F(\langle n \rangle).

What about the derivative? Since F(n+1)F(n)={1n=0F(n1)n1, F(n+1) - F(n) = \begin{cases} 1 & n = 0 \\ F(n-1) & n \ge 1 \end{cases}, we find that dFdn=p0+n=1pnF(n1), \frac{\mathrm{d} \langle F \rangle}{\mathrm{d} \langle n \rangle} = p_0 + \sum_{n=1}^\infty p_n F(n-1), which looks like Derivative of average F for Fibonacci & Poisson. For comparison, we also have (dotted) F2. \frac{\langle F \rangle}{2}. There's a degree of similarity, like what we might expect for an exponential function.

Fibonacci & geometric

The geometric distribution, with parameter pp and pmf pn=(1p)np p_n = (1-p)^n p is quite different from the Poisson distribution, so let's see what effect this change has on the derivative. The mean value is n=1pp. \langle n \rangle = \frac{1-p}{p}. Using the generating function for the Fibonacci sequence, we get the closed form expression F=pp1p23p+1, \langle F \rangle = p \frac{p - 1}{p^2 - 3 p + 1}, which only holds for 1p<1ϕ0.61803, 1 - p < \frac{1}{\phi} \approx 0.61803, where ϕ\phi is the golden ratio. This is equivalent to p>ϕ1ϕ0.38197, p > \frac{\phi - 1}{\phi} \approx 0.38197, and n<ϕ1.61803. \langle n \rangle < \phi \approx 1.61803. At that point, the denominator of F\langle F \rangle vanishes and F\langle F \rangle diverges. Before that, we have Average F for Fibonacci & geometric

Application of the chain rule then gives us dFdn=p22p22p+1(p23p+1)2 \frac{\mathrm{d} \langle F \rangle}{\mathrm{d} \langle n \rangle} = p^2 \frac{2 p^2 - 2 p + 1}{(p^2 - 3 p + 1)^2} which looks like Derivative of average F for Fibonacci & geometric Unlike the exponential behaviour we seemed to get with the Poisson distribution, this derivative behaves as a rational function.

Clearly, the behaviour of a single sequence can vary greatly under this operation depending on the choice of distribution. Unless one has a particular distribution already in mind (as in statistical mechanics), it's probably not a very useful approach for studying the sequence itself.