Today I toyed a bit with guessing package and immediatly I
hit a few quirks:
1) I tried to guess polynomial from its values. So I wrote:
myPol(x) == (x^3-x+1)
guessPRec [myPol(i) for i in 1..15]
and I got:
3 2
(22) [[function= n + 3n + 2n + 1,order= 0]]
Type: List(Record(function: Expression(Integer),order: NonNegativeInteger))
Time: 0.004 (IN) + 0.01 (EV) + 0.01 (OT) = 0.02 sec
Since myPol(n+1) gives:
3 2
(23) n + 3n + 2n + 1
Type: Polynomial(Integer)
this looks like off by one error.
2) plain guess gives:
guess [myPol(i) for i in 1..15]
Compiling function myPol with type PositiveInteger -> Integer
(33)
[
n 4 3 2 3 2
[function= [[x ]f(x): (x - 4x + 6x - 4x + 1)f(x) + x - 3x - 3x - 1=
0] ,
order= 0]
]
Type: List(Record(function: Expression(Integer),order: NonNegativeInteger))
Time: 0.004 (IN) + 0.004 (EV) + 0.02 (OT) = 0.02 sec
Description of guess says that it tries guessRec and guessADE.
Description of guessADE says that that it finds equations satified
by function with given first Taylor coefficients, so technically this
result is probably OK. But our polynomial is determined just by
4 coefficients, while in the equation we have 9 numbers, so the
reslut is much more complicated than necessary (and it requires
a little effort to realize that it really decribes a polynomial).
3) I tried guessExpRat to force the result to be polynomial, but
guessExpRat seems to a lot of time (I was too impatient to actually
see any answer). I wonder what method is used in guessExpRat?
guessRec seem to reasonably quickly find difference equation
satisfied by a function. Once we know f(n+1)/f(n) asymptotic
at infinity should immediatly give us exponential factor.
Finally, resultant computation should discover if remaning quotient
is a rational function and recover it (maybe we got stuck at
this stage, but that part should be relatively easy).
4) Typing:
myFun(x) == 2^x*(x^3-x+1)/(x+7)
guess [myFun(i) for i in 1..15]
I get:
4 3 2
n - 1 2p + 28p + 118p + 190p + 112
++-++ 15 15 15 15
| | ---------------------------------------
| | 4 3 2
p = 0 p + 12p + 29p + 19p + 9
15 15 15 15 15
(4) [[function= -----------------------------------------------,order= 0]]
4
Type: List(Record(function: Expression(Integer),order: NonNegativeInteger))
For n = 0 the above gives 1/4, by the correct values is 1/7, for n = 1
the above gives 28/9 while the correct value is 1/4. myFun(2) gives
28/9, so again this looks like off by one error. Also, the p_{15}
variable is confusing and the result looks cluttered.
--
Waldek Hebisch
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---