Sequences of Pairwise Operations 

advertisement
Sequences of Pairwise Operations
Given a sequence S = (s0, s1, …) and a binary operator o we can apply o to the successive pairs in S to
create sequence of bacwards operations (S) = (s1 o s0, s2 o s1, …). We can use  to determine if S is
the result of applying some function f to the som integer sequence (i0, i1, …). For the repeated process
I write  (n)(S) =  ( … (S) …) = n nested applications of . Below I look at backwards differences,
(S) = (s1 – s0, s2 – s1, …), and backwards quotients (S) = (s1  s0, s2  s1, …). If our guess is that f has
the form f(n) = g(n)+ f(n – 1), in which case I say that f is additive, we use , and if our guess is that f
has the form f(n) = g(n)f(n – 1), in which case I say that f is multiplicative, we use .
Bakwards differences and Polynomials
Let S1 = (s0, s1, …). If there is a univariate polynomial P with evaluation f such that f(k) = sk there must
be a d and an e such that dS1 = ed!, i.e., such that the degree of P = d and the first term in P = e.
(a) In order to find d and e, we repeatedly take the backward differences S1', S1'', until the result is constant = (c, c, ...). Then d is the number of derivations and e = c / d! (i.e. given f = axd then f (d)= ad!).
(b) In order to find the (k + 1)th term of P we subtract ek xdk from each element in Sk and apply (a) to
the resultant sequence Sk+1, when Sk is the input to the kth applikation of (a) and dk and ek are the resultant degree and term. In order to catch a zero term we pass the expected degree to (a). For term 1,
not knowing what to expect, we pass zero, and for term k + 1 we pass dk, and if (a) gives a constant sequence before having reached the expected degree the value of ek = 0.
(c) In order to find all the terms of P, we repeat (b) until the computed degree = 0.
E.g.
S = (3, 6, 39, 132, 315, 618, 1071, 1704, 2547, 3630, 4983)
(S) = (3, 33, 93, 183, 303, 453, 633, 843, 1083, 1353)
2(S) = (30, 60, 90, 120, 150, 180, 210, 240, 270)
(1)
3(S) = (30, 30, 30, 30, 30, 30, 30, 30)
The degree of S = 3 and the first term of P = 30/3! = 5.
S2 = S – 5x3 = (3, 1, -1, -3, -5, -7, -9, -11, -13, -15, -17)
(2)
(S2) = (-2, -2, -2, -2, -2, -2, -2, -2, -2, -2)
Since we got a constant sequence after only one derivation and the expected degree here is 2, the
second term of P = 0.
S3 = S2 – 0 = (3, 1, -1, -3, -5, -7, -9, -11, -13, -15, -17)
(S3) = (-2, -2, -2, -2, -2, -2, -2, -2, -2, -2).
The degree of S3 = 1 and the third term of P = –2/1! = –2
(3)
S4 = S3 + 2x = (3, 3, 3, 3, 3, 3, 3 3, 3, 3)
(4)
We have a constant sequence immediately thus the degree of S4 = 0 and the last term of P = 3/0! = 3.
We find that P = (5, 0, -2, 3) and, correspondingly, f(0) = 3, and f –1(0) = –1.
(5)
Here we have assumed that s1 = f(0). If we instead assume that for instance s1 = f(1) we find that
P = (5, -15, 13, 0) and f(0) = f –1 (0) = 0. The function is shifted one position to the right. The shifting
is due to the lower terms since the first term alone gives a function g such that g(0) = g –1 (0) = 0, thus
every polynomial whose evaluation is a horizontal shifting of f will have the same first term. Only a
small shift may change the values of the lower term dramatically. For instance if we assume that
s1 = f(7) we get P = (5, -10, 733, -1698). (An interesting problem is (maybe): Given some polynomial,
what is the shift required to give the simplest corresponding polynomial in terms of the sum of the
absolute values of its terms.)
Bakwards differences and Exponentiation
Applying backwards differences to exponentials is trivial. ak = aak–1 thus ak – ak–1 = (a – 1)ak–1.
E.g.
4x
= (1, 4, 16, 64, 256, 1024, …)
(4 ) = 3 4x = (3, 12, 48, 192, 768, …)
(6)
x
The result of taking repeated backwards differences of exponetials is (probably) as trivial, but it looks
kind of nice. E.g.
0(4x)
x
0
1
2
3
4
5
6
7
8
304x
1
4
16
64
256
1024
4096
16384
65536
1(4x)
314x–1
3
12
48
192
768
3072
12288
49152
2(4x)
3(4x)
4(4x)
324x–2
334x–3
344x–4
9
36
144
576
2304
9216
36864
27
108
432
1728
6912
27648
(7)
81
324
1296
5184
20736
We se that  1(ax) = (a – 1)1ax–1,  2(ax) = (a – 1)2ax–2, etc. and the general case is
 k(ax) = (a – 1)kax–k.
(8)
If we look at the top of each column we see that (0(4x)1, 1(4x)1, 2(4x)1, …) = 3x, and the general
case here is
(0(ax)1, 1(ax)1, 2(ax)1, …) = (a – 1)x.
(9)
The Powers of 2 and the Fibonacci numbers
For 2x we have 2k – 2k–1 = 2k–1 thus 2k = 2k–1 + 2k–1, (2x) = 2x–1 and k(2x) = 2x–k. We can compare this
with the backwards differences of the fibonacci function. From the definition fib(0) = fib(1) = 1,
fib(n) = fib(n – 1) + fib(n – 2) for n > 1, it follows that
(fib(x)) = fib(x – 2).
(10)
Let
gib(n, a, b) = gib(n – a, a, b) + gib(n – b, a, b).
(10)
Then
fib(n) = gib(n, 1, 2)
(11)
2n = gib(n, 1, 1),
(12)
and
and the difference between the two suddenly seems very slight.
(We could have generalized further by defining.
hib(n, a1, …, am) = hib(n – a1, a1, …, am) + … + hib(n – am, a1, …, am).
(13)
which would have given
3n = hib(n, 1, 1, 1), 4n = hib(n, 1, 1, 1, 1), etc.,
(14)
but it does not seem particularily interesting.)
Bakwards Quotients and the Factorial
The factorial n! has the form f(n) = g(n)f(n – 1), with g(n) = n, and is thus multiplicative. However, the
result of taking the backwards quotients of n! is as trivial as the result of taking the backwards differences of an. Since k! = k(k – 1)!, k! (k – 1)! = k. So, to make it more interesting, we look at functions
where g(n) ≠ n for at least some n. The problem is then, given some number sequence that assumedly
is a result of the application of f to (1, 2, ...), to deduce g from ( f(x).
E.g.
From (f(x)) = (3, 5, 7, 9, 11, 13, 15, 17, 19, ...) we deduce that g(x) = 2x – 1.
(13)
From (f(x)) = (1, 2/3, 1/2, 2/5, 1/3, 2/7, 1/4, 2/9, 1/5) we deduce that g(x) = 2 ⁄x.
(14)
From (f(x)) = (5/2, 2, 7/4, 8/5, 3/2, 10/7, 11/8, 4/3, 13/10)
(16)
= (5/2, 6/3, 7/4, 8/5, 9/6, 10/7, 11/8, 12/9, 13/10)
(17)
we deduce that g(x) = (x + 3)/x.
From (f(x)) = (1, 2, 5/2, 14/5, 3, 22/7, 13/4, 10/3, 17/5, 38/11)
(18)
= (5/2, 6/3, 10/4, 14/5, 18/6, 22/7, 26/8, 30/9, 34/10, 38/11)
(19)
we deduce that g(x) = 2(2x – 3)/x = 4 – 3/x
(20)
The Straightening Function
In order to get from (18) to (19) we have made som guesses. The following straightening function
can be used a guessing aid.

(x, y, z) =
{
(x, (x + z)/2, z)
if y < (x + z)/2
(x, y, z)
if y  (x + z)/2
(21)
(X) = the result of applying  to the successive triples in the sequence X.
(X) = the result of applying  repeatedly until no changes were made,
i.e., until  k+1(X) =  k(X).
Let S = (s1 ... sn) be a sequence. If s1 is the smallest and sn is the largest number in S and n – 1 divides
sn – s1 then (S) will be a linearily increasing sequence. As we can see, the numerator and the denominator sequences in (18) satisfy these conditions. Otherwise the behaviour of  is less straightforward
and it can only be a guessing aid. (More about this later).
(22)
Download