combinat::guess – guessing sequences

A guessed sequence is a list of expressions math. Each expression has the property that it is generated by a list of complex numbers (or a list of polynoms in future versions) math and for all i lesser than the length of math, and j lesser than the length of the guessed sequence, math.

For instance an expression E is: - a rational function i.e. math where math and math are two polynoms. (In fact, a Pade interpolation is used, so we can also find sequences with some strange terms, such as math) - linear recursive i.e. Error: 'expression' expected [line 2, col 33]

- a sum of guessed sequence, such as: math - a product of guessed sequence, such as: math

→ Examples

Entries

"Void"

This is the guessed sequence corresponding tu an unguessed sequence: the list contains no element.

term – term constructor

combinat::guess::term(integer degree)

Returns the counting function corresponding to the generating series math.

new, func_call – guessed sequence constructor

combinat::guess::new(Type::ListOf(Type::Complex) Error: Unexpected 'identifier' [line 2, col 37]

, Method=DOM_TABLE Error: ')' expected [line 2, col 26]

, Index=Type::ListOf(DOM_IDENT) Error: Unexpected 'identifier' [line 2, col 36]

, Next=DOM_IDENT Error: Unexpected 'identifier' [line 2, col 37]

, Leaf=DOM_IDENT Error: Unexpected 'identifier' [line 2, col 36]

, OutPut=Type::Integer Error: Unexpected 'of' [line 2, col 35]

)

combinat::guess::new(combinat::guess Error: Unexpected 'identifier' [line 2, col 38]

, Type::Integer Error: Unexpected 'identifier' [line 2, col 36]

, Type::Integer Error: Unexpected 'identifier' [line 2, col 36]

)

Returns less than OutPut (or exactly OutPut) formulas describing a sequence which first terms are the one given. Only the first terms are necessary, the other parameters have default values. The parameters of a method are: MaxDepth which controls how many time... MinPoints which decides how many values are required to make a guess TestPoints which decides how many values are remembered for testing purpouses Block_Guess decides if Guess Method needs not to be run (don't toggle it!) Block_LinRec idem with LinRec (Sum and Prod automatically block it by default) Block_RatInterp idem with RatInterp Block_Sum idem with Sum Block_Prod idem with Prod

If math is the guessed sequence, math is the i-th term of the n-th sequence of the list of guessed sequence math. And math is the i-th term of the 1st sequence (same as math).

Example 1:

We can try to guess [1,1,1,1,1,1]

Ones := [1,1,1,1,1,1];

math

Default values give(fastest result):

combinat::guess(Ones);

math

Now, for more results:

combinat::guess(Ones, Output = 3)

math

For best result:

combinat::guess(Ones, Output = 1)

math

And how to use a guessed sequence:

W := combinat::guess([1,1,2,6,24,120], Output = 3)

math

Naturally they all define n!, so the 7th term of each formula is the same:

W[1](7), W[2](7)

math

Example 2:

The parameters have default values, (read guess.mu), but other values can be used:

LinRecTest := table(TestPoints = 0):RatInterpTest := table(TestPoints = 0):

math

Now, there won't be any test

T := combinat::guess([0,1,1,2,3,5],LinRec = LinRecTest,RatInterp = RatInterpTest,Output = 5)

math

With no test too many expressions are found and they are different:

T[1](7), T[2](7), T[3](7), T[4](7), T[5](7)

math

if i,j,k,i1,i2... are no good names, you can do:

U := combinat::guess([0,1,1,2,3,5],LinRec = LinRecTest,RatInterp = RatInterpTest,Output = 5,Indices = [x,y,z],Next = t, Leaf = i):extop(U)[2];

math

Example 3:

RatInterp and LinRec use a "clever" Pade Interpolation, that allows unexpected values:

combinat::guess([1,23,1,1,1,1])

math

In fact, for Rationnal Interpolation, the formula computed is: math, that means u(i)=1 for all i excepted i=1 and is undefined in 1. The program memorize that for i=1, u(i)=23