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=anβˆ’anβˆ’1









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βˆ’(anβˆ’1+bnβˆ’1)==anβˆ’anβˆ’1+bnβˆ’bnβˆ’1= 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(anβˆ’bn)=anβˆ’bnβˆ’(anβˆ’1βˆ’bnβˆ’1)==anβˆ’anβˆ’1βˆ’(bnβˆ’bnβˆ’1)= Deltaanβˆ’ Deltabn







And we move on to the work!

Similarly, we find by definition:





 Delta(anbn)=anbnβˆ’anβˆ’1bnβˆ’1==anbnβˆ’anbnβˆ’1+anbnβˆ’1βˆ’anβˆ’1bnβˆ’1==an(bnβˆ’bnβˆ’1)+bnβˆ’1(anβˆ’anβˆ’1)==an Deltabn+bnβˆ’1 Deltaan







Cool, right? Consider the quotient:





 Delta( fracanbn)= fracanbnβˆ’ fracanβˆ’1bnβˆ’1= fracanbnβˆ’1βˆ’anβˆ’1bnbnbnβˆ’1== fracanbnβˆ’1βˆ’anbn+anbnβˆ’anβˆ’1bnbnbnβˆ’1== fracbn Deltaanβˆ’an Deltabnbnbnβˆ’1







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==A1βˆ’A0+A2βˆ’A1+...+Anβˆ’Anβˆ’1=  =Anβˆ’A0







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=(3i2βˆ’3i+1) frac13+iβˆ’ frac13=(3i2βˆ’3i+1) frac13+iβˆ’ frac13== frac13 Deltai3+ frac12 Delta(i2+i)βˆ’ frac13 Deltai== Delta frac2i3+3i2+3iβˆ’2i6= 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βˆ’(iβˆ’1)4=i4βˆ’(i4βˆ’4i3+6i2βˆ’4i+1)=4i3βˆ’6i2+4iβˆ’1







Antiderivative for i3 :





i3= frac14(4i3βˆ’6i2+4iβˆ’1)+ frac32i2βˆ’i+ frac14=  = frac Deltai44+ frac32 Delta frac2i3+3i2+i6βˆ’ Delta fraci2+i2+ frac Deltai4== Delta fraci4+2i3+3i2+iβˆ’2i2βˆ’2i+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(nβˆ’1) Deltaf(n)







Then





 sumbi=a Delta(f(i)g(i))= sumbi=af(i) Deltag(i)+ sumbi=ag(iβˆ’1) Deltaf(i) iff iff sumbi=af(i) Deltag(i)= sumbi=a Delta(f(i)g(i))βˆ’ sumbi=ag(iβˆ’1) Deltaf(i)







And now one nontrivial step:





 sumbi=a Delta(f(i)g(i))=f(a)g(a)βˆ’f(aβˆ’1)g(aβˆ’1)+f(a+1)g(a+1)βˆ’f(a)g(a)++...+f(b)g(b)βˆ’f(bβˆ’1)g(bβˆ’1)=f(b)g(b)βˆ’f(aβˆ’1)g(aβˆ’1)







Substitute the equality obtained before:





 sumbi=af(i) Deltag(i)=f(b)g(b)βˆ’f(aβˆ’1)g(aβˆ’1)βˆ’ sumbi=ag(iβˆ’1) Deltaf(i)







Finita la comedy.



Find the same amount:





 sumni=1ipi=Snpi= Delta fracpi+1pβˆ’1Sn= sumni=1i Delta fracpi+1pβˆ’1







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+1pβˆ’1 then:





 sumni=1f(i) Deltag(i)=f(n)g(n)βˆ’f(0)g(0)βˆ’ sumni=1g(iβˆ’1) Deltaf(i)==n fracpn+1pβˆ’1βˆ’0βˆ’ sumni=1 fracpipβˆ’1=n fracpn+1pβˆ’1βˆ’ bigg( frac1pβˆ’1 sumni=1pi bigg)==n fracpn+1pβˆ’1βˆ’ bigg( frac1pβˆ’1 sumni=1 Delta fracpi+1pβˆ’1 bigg)==n fracpn+1pβˆ’1βˆ’ bigg( fracpn+1βˆ’p(pβˆ’1)2 bigg)= fracnpn+2βˆ’(n+1)pn+1+p(pβˆ’1)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)=1βˆ’p







2 hours





P(2)=p(1βˆ’p)...







n hours:





P(n)=pnβˆ’1(1βˆ’p)







Then the expectation is:





E[X]= lim limitsn to infty sumni=1iβˆ—P(i)= lim limitsn to infty sumni=1iβˆ—(1βˆ’p)piβˆ’1==(1βˆ’p) lim limitsn to infty sumni=1iβˆ—piβˆ’1







It’s familiar, right?



We already found that





 sumni=1ipi= fracnpn+2βˆ’(n+1)pn+1+p(pβˆ’1)2







then the row we need is quite obvious:





 sumni=1ipiβˆ’1= frac1p sumni=1ipi= fracnpn+1βˆ’(n+1)pn+1(pβˆ’1)2







And the task comes down to finding the limit of sequence





 lim limitsn to infty fracnpn+1βˆ’(n+1)pn+1(pβˆ’1)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(pβˆ’1)2= frac1(pβˆ’1)2







AND





E[X]=(1βˆ’p) lim limitsn to infty sumni=1ipiβˆ’1=(1βˆ’p) frac1(pβˆ’1)2= frac11βˆ’p









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!



All Articles