Thursday, May 10, 2007

Singular

A software that comes with cygwin, and it is "capable of doing algebraic calculations." I need to calculate some polynomial coefficients and I don't have mathematica installed on my computer, so I figured I should at least give it a try.

The problem is to calculate the first five terms of 8 {[(1+x)(1+x^2)(1+x^3).....(1+x^n)]/[(1-x)(1-x^2)(1-x^3)......(1-x^n)]}^8. I only need the terms up to x^4, so I write out the terms up to x^4. For the denominator I used 1+x+x^2....=1/(1-x). Putting everything into the formula....

the first three terms comes out correctly, but the forth and fifth terms look suspicious. Expecially with the coefficient of x^4, which turns out to be negative. Looks like it overflew already.

Just for reference, the answer is 8 + 128 x + 1152 x^2 + 7680 x^3 + 42112 x^4. Does this mean that it uses 2-byte integer? lol.

No comments: