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:
an=1 Deltaan=an−an−1=1−1=0
an=n Deltaan=an−an−1=n−(n−1)=1
an=n2an=n2−(n−1)2=n2−(n2−2n+1)=2n−1
an=n3 Deltaan=n3−(n−1)3=3n2−3n+1
an=kn Deltaan=kn−kn−1=kn−1(k−1)
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, CapLet'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
f(x)=px+1x, spacex inRp= frac1q, space0<p<1 iffq>1 lim limitsx to inftyf(x)= lim limitsx to inftypx+1x= lim limitsx to infty fracxqx+1== lim limitsx to infty fracx′(qx+1)′= lim limitsx to infty frac1qx+1 lnq=0 lim limitsx to inftyf(x)=0 implies lim limitsn to inftyf(n) iff lim limitsn to inftynpn+1=0
f(x)=px(x+1), spacex inRp= frac1q, space0<p<1 iffq>1 lim limitsx to inftyf(x)= lim limitsx to inftypx(x+1)= lim limitsx to infty fracx+1qx== lim limitsx to infty frac(x+1)′(qx)′= lim limitsx to infty frac1qx lnq=0 lim limitsx to inftyf(x)=0 implies lim limitsn to inftyf(n) iff lim limitsn to infty(n+1)pn=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:
- We understood what a discrete derivative is.
- Derived the inherent rules of differentiation
- We understood what a discrete antiderivative is.
- We derived an analogue of the Newton-Leibniz formula
- Derived an analog of integration by parts
- 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!