📜 ⬆️ ⬇️

Set method

While reading the book “Specific Mathematics” , at the same time gaining knowledge and realizing my incompetence in the question, in the very first chapter I came across the method of sets that the authors use to solve the Problem of Josephus . They do not explain the method, considering it too elementary, so I had to look for information about it myself. I didn’t find a detailed description in the Russian-speaking segment of the Internet, so I used the answer from math.stackexchange.com , which I translated later, and now I present it to you so that those who do not understand the method instinctively can also penetrate.
Further - translation from the first person.

Note : in the beginning I will try to describe several key ideas of the repetition method using a (very) simple example. This should give us some basic understanding of this method. But in order to understand what is really going on , we will also consider one much more complicated example ( comment re.: You can find it in the original article, here is just a basic explanation ).

Method of repetition (basic concepts)

This method is based on two main ingredients . The first is the ability to build a linear combination of already known recurrences.
Suppose there is recurrence for xn

\ begin {align *} {x_0} & = {a_0} \\ {x_n} & = {a_n} + {x_ {n-1}}, \ quad n> 0 \ end {align *}


and we have a second recurrence for yn

\ begin {align *} {y_0} & = {b_0} \\ {y_n} & = {b_n} + {y_ {n-1}}, \ quad n> 0 \ end {align *}


In this case, provided that the recurrence data is known, we also know by linearity that the equation with the term added is

 alphaan+ betabn


will have a result

 alphaxn+ betayn


To show it clearly, let's say an=3and bn=5n2+1. Assuming we know the results xnand ynrecurrence

\ begin {align *} {x_0} & = {3} & {y_0} & = {1} \\ {x_n} & = {3} + {x_ {n-1}}, \ quad n> 0 & {y_n} & = {5n ^ 2} + {1} + {y_ {n-1}}, \ quad n> 0 \ end {align *}


we also know from linearity that the result of recurrence

\ begin {align *} {z_0} & = {7} \\ {z_n} & = {2n ^ 2} + {7} + {z_ {n-1}} \ end {align *}


equals

 beginalignzn= frac115xn+ frac25yn endalign


It can be seen that in this case we have a set of two solutions xnand ynwhich we can linearly combine to find the desired solution zn.
')
BUT: we usually start with recurrence. znnot having suitable candidates available. And this is the second ingredient. We have to build a set.

The second ingredient is building a kit , which can be used for linear combinations. Let's say we start with recurrence

\ begin {align *} {z_0} & = {7} \\ {z_n} & = {2n ^ 2} + {7} + {z_ {n-1}}, \ quad {n}> 0 \ tag {1} \ end {align *}


If we try to solve this recurrence using the set method, then first we need to generalize the recurrence and use instead

\ begin {align *} {\ mathcal {Z} _0} & = {a_0} \\ {\ mathcal {Z} _n} & = {a_n} + {\ mathcal {Z} _ {n-1}}, \ quad {n}> 0 \ end {align *}


It's time for some creative ideas, which is usually the most difficult part in using this method. We want to find a set of two members. One of them with an=constand the other with anequal to the square of n. To do this, we must select several suitable candidates for  mathcalZnwhose term is the sought an.

Let's pick up the first candidate . It is quite simple (in this case), because equality  mathcalZn=ngives

\ begin {align *} {a_0} & = {0} \\ {n} & = {a_n} + n - 1, \ quad {n}> 0 \ end {align *}


and we find: a0=0and an=1, quadn>0.
We got the first candidate, let's say xnsuch that

\ begin {align *} {x_0} & = {0} \\ {x_n} & = {1} + {x_ {n-1}}, \ quad {n}> 0 \ tag {2} \ end { align *}


By a similar principle, we can find a suitable second candidate who will provide us an=square from n, noting that the sum of natural numbers to the degree kusually comes down to something in degree k+1. Let's pick up  mathcalZn=n3which gives

\ begin {align *} {a_0} & = 0 \\ {n ^ 3} & = {a_n} + {({n} - {1})} ^ 3, \ quad {n}> {0} \ end {align *}


and get a0=0and an=3n23n+1, quadn>0.

We got the second candidate, let's say ynfor which it is true

\ begin {align *} {y_0} & = {0} \\ {y_n} & = {3n ^ 2} - {3n} + {1} + {y_ {n-1}}, \ quad {n} > {0} \ tag {3} \ end {align *}


We see that ynalso contains a linear term in nwhich is unnecessary for us, because we are looking for (following formula (1)) an=2n2+7. Therefore, we will expand our recruitment by a third member, who will provide us anlinear on n. This way we will be able to get rid of the linear addend ncorresponding linear combination of the three members of the set. We will pick up such  mathcalZn=n2which gives

\ begin {align *} a_0 & = 0 \\ n ^ 2 & = a_n + (n-1) ^ 2, \ quad n> 0 \ end {align *}


and find a0=0and an=2n1, quadn>0.

So we get a third candidate , let's say unfor which it is true

\ begin {align *} u_0 & = 0 \\ u_n & = 2n-1 + u_ {n-1}, \ quad n> 0 \ tag {4} \ end {align *}


Let's take a look at the set:

Overview of the three candidates

\ begin {array} {rlcr} \ mathcal {Z} _n && a_n & \\ \ hline \\ x_n = & n \ qquad & 1 & \ qquad \ qquad \ text {acc. to} (2) \\ y_n = & n ^ 3 \ qquad & 3n ^ 2-3n + 1 & \ qquad \ qquad \ text {acc. to} (3) \\ u_n = & n ^ 2 \ qquad & 2n-1 & \ qquad \ qquad \ text {acc. to} (4) \\ \ end {array}


Using a suitable linear combination you can notice that

\ begin {align *} a_n & = 2n ^ 2 + 7 \\ & = \ frac {2} {3} \ left (3n ^ 2-3n + 1 \ right) + \ left (2n-1 \ right) + \ frac {22} {3} \ end {align *}


so we come to

\ begin {align *} z_n & = \ frac {22} {3} x_n + \ frac {2} {3} y_n + u_n + c_0 \\ & = \ frac {1} {3} n \ left (2n ^ 2 + 3n + 22 \ right) + c_0 \ end {align *}



Note that we need to define a constant. c0, given that we also need to meet the initial condition z0=7. We do it by defining s0=7and in the end we get:

zn= frac13n left(2n2+3n+22 right)+7, quadn geq0


To summarize

Description of the set method:
To solve form recurrence

 beginalignxn=f(n)+g(xn1,xn2, ldots,x0) tag5 endalign



Note: There may be situations in which you have to define more than one initial condition.
Note: It is possible that the set will require further expansion in order to get rid of the extra components that appear when calculating xn(l).

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


All Articles