Discrete Derivative or Summary of How to Sum Series

Introduction


Has it ever happened that you want to sum some infinite series, but you cannot pick up a partial sum of the series? Have you still not used the discrete derivative? Then we go to you!

Definition


Discrete Derivative Sequence an call this sequence  Deltaan that for any natural n>1 performed:

 Deltaan=anan1



Consider the following examples:


Well, you get the point. Something like a derivative of a function, right? We understood how to calculate discrete derivatives of the "simplest" sequences. Ahem, but what about the sum, difference, product, and quotient of sequences? The “ordinary” derivative has some differentiation rules. Let's come up with a discrete one!

First, consider the amount. It is logical that the sum of sequences is also some kind of sequence. Let's try to find the derivative by definition:

 Delta(an+bn)=an+bn(an1+bn1)==anan1+bnbn1= Deltaan+ Deltabn


Phenomenally! We have obtained that the derivative of the sum of sequences is the sum of the derivatives of these sequences! thanks, Cap
Let's try to prove the same with the difference

 Delta(anbn)=anbn(an1bn1)==anan1(bnbn1)= Deltaan Deltabn


And we move on to the work!
Similarly, we find by definition:

 Delta(anbn)=anbnan1bn1==anbnanbn1+anbn1an1bn1==an(bnbn1)+bn1(anan1)==an Deltabn+bn1 Deltaan


Cool, right? Consider the quotient:

 Delta( fracanbn)= fracanbn fracan1bn1= fracanbn1an1bnbnbn1== fracanbn1anbn+anbnan1bnbnbn1== fracbn Deltaanan Deltabnbnbn1


Cool ...

But this is all derivative. Maybe there is a discrete antiderivative ? It turns out there is!

More definitions


Discrete primitive sequence an call such a sequence An that for any natural n>1 performed:

an= DeltaAn



This is understandable. Guo come up with an analogue of Newton-Leibniz!

 sumni=1ai=a1+a2+a3+...+an==A1A0+A2A1+...+AnAn1=  =AnA0


Come on! This joke is a coincidence! And now the same prettier:

 sumni=1a= sumni=1 DeltaAi=Ai bigg|n1


And generalize to the set of natural numbers from a before b :

 sumbi=af(i)=Fi bigg|ba


Application


Who remembers the very formula for the sum of a series of squares of natural numbers from 1 before n ? And here I do not remember. Let's get her out!
But first you need to find the antiderivative for the sequence ai=i2 :

i2=(3i23i+1) frac13+i frac13=(3i23i+1) frac13+i frac13== frac13 Deltai3+ frac12 Delta(i2+i) frac13 Deltai== Delta frac2i3+3i2+3i2i6= Delta frac2i3+3i2+i6


And now, in fact, the sum itself:

 sumni=1i2= frac2i3+3i2+i6 bigg|n0= frac2n3+3n2+n6


What about the sum of the cubes?

First we calculate

 Deltai4=i4(i1)4=i4(i44i3+6i24i+1)=4i36i2+4i1


Antiderivative for i3 :

i3= frac14(4i36i2+4i1)+ frac32i2i+ frac14=  = frac Deltai44+ frac32 Delta frac2i3+3i2+i6 Delta fraci2+i2+ frac Deltai4== Delta fraci4+2i3+3i2+i2i22i+i4= Delta fraci4+2i3+i24== Delta bigg( fraci(i+1)2 bigg)2 sumni=1i3= bigg( fraci(i+1)2 bigg)2 bigg|n0= bigg( fracn(n+1)2 bigg)2



Ahem, it would seem, nothing complicated ...

For advanced


Finding the integral is not always so easy, right? What do we do in difficult cases? That's right, integrate in parts. Perhaps there is an analogue? I will not torment you, he is, and now we will get him out.

Suppose we need to calculate the sum of a series

p=const sumni=1ipi=?

What to do? It is unlikely that you will be able to so easily pick up the discrete antiderivative to the sequence. Let's watch.

We already know that:

 Delta(f(n)g(n))=f(n) Deltag(n)+g(n1) Deltaf(n)


Then

 sumbi=a Delta(f(i)g(i))= sumbi=af(i) Deltag(i)+ sumbi=ag(i1) Deltaf(i) iff iff sumbi=af(i) Deltag(i)= sumbi=a Delta(f(i)g(i)) sumbi=ag(i1) Deltaf(i)


And now one nontrivial step:

 sumbi=a Delta(f(i)g(i))=f(a)g(a)f(a1)g(a1)+f(a+1)g(a+1)f(a)g(a)++...+f(b)g(b)f(b1)g(b1)=f(b)g(b)f(a1)g(a1)


Substitute the equality obtained before:

 sumbi=af(i) Deltag(i)=f(b)g(b)f(a1)g(a1) sumbi=ag(i1) Deltaf(i)


Finita la comedy.

Find the same amount:

 sumni=1ipi=Snpi= Delta fracpi+1p1Sn= sumni=1i Delta fracpi+1p1


It may seem to someone that the formula has become even more cumbersome, and we only complicated our work. But this is not so. Let be f(i)=i,g(i)= fracpi+1p1 then:

 sumni=1f(i) Deltag(i)=f(n)g(n)f(0)g(0) sumni=1g(i1) Deltaf(i)==n fracpn+1p10 sumni=1 fracpip1=n fracpn+1p1 bigg( frac1p1 sumni=1pi bigg)==n fracpn+1p1 bigg( frac1p1 sumni=1 Delta fracpi+1p1 bigg)==n fracpn+1p1 bigg( fracpn+1p(p1)2 bigg)= fracnpn+2(n+1)pn+1+p(p1)2



Cool puzzle


I propose to practice with this on the example of a problem from the selection in Tinkoff Generation for courses on Machine Learning . Here is the problem itself:

You are tired of solving problems from the selections to Tinkoff Generation courses and decided to take a break by watching several episodes of the new series that everyone is talking about.

You start to watch all the series, starting with the first. Each episode lasts one hour. After watching the next series, you with constant probability ppp start watching the next one, otherwise your break will end and you will return to work.

Starvation, sleep, and other needs do not stop you, and the series has an infinite number of episodes; in theory, your break can last forever.

How long will your average break last?

Strictly speaking, here we need to find the mathematical expectation. Let's get it right.

Decision


The probability that the break will last 1 hour is:

P(1)=1p


2 hours

P(2)=p(1p)...


n hours:

P(n)=pn1(1p)


Then the expectation is:

E[X]= lim limitsn to infty sumni=1iP(i)= lim limitsn to infty sumni=1i(1p)pi1==(1p) lim limitsn to infty sumni=1ipi1


It’s familiar, right?

We already found that

 sumni=1ipi= fracnpn+2(n+1)pn+1+p(p1)2


then the row we need is quite obvious:

 sumni=1ipi1= frac1p sumni=1ipi= fracnpn+1(n+1)pn+1(p1)2


And the task comes down to finding the limit of sequence

 lim limitsn to infty fracnpn+1(n+1)pn+1(p1)2


Where p<1 , as p - probability of the event.
We prove now that

 lim limitsn to inftynpn+1=0, space lim limitsn to inftypn(n+1)=0



Now it’s easy to understand that

 lim limitsn to infty fracnpn+1(n+1)pn+1(p1)2= frac1(p1)2


AND

E[X]=(1p) lim limitsn to infty sumni=1ipi1=(1p) frac1(p1)2= frac11p



Some up


Fuh ... It was easy-peasy tough, even for me, dear readers. List of achievements for today:

  1. We understood what a discrete derivative is.
  2. Derived the inherent rules of differentiation
  3. We understood what a discrete antiderivative is.
  4. We derived an analogue of the Newton-Leibniz formula
  5. Derived an analog of integration by parts
  6. We solved the difficult task of selecting ML courses at Tinkoff Generation

Not bad for a start, what do you think?

Waiting for your comments in the comments, the kites are the most attentive!

Source: https://habr.com/ru/post/469073/


All Articles