Thanks!!

[En]

- CoCoA is a program to compute with numbers and polynomials.
- It is free.
- It works on many operating systems.
- It is used by many researchers, but can be useful even for "simple" computations.

2^32-1;

4294967295

2^64-1;

18446744073709551615

(1/3) * 3;

1

0.3333333333333 * 3;

9999999999999/10000000000000

(x-y)^2 * (x^4-4*z^4) / (x^2+2*z^2);

x^4 -2*x^3*y +x^2*y^2 -2*x^2*z^2 +4*x*y*z^2 -2*y^2*z^2

Factor(x^4 -2*x^3*y +x^2*y^2 -2*x^2*z^2 +4*x*y*z^2 -2*y^2*z^2);

Record[ Exponents := [1, 2], Factors := [x^2 -2*z^2, x -y], RemainingFactor := 1 ]

`f = c`

as the polynomial ```
f -
c
```

. CoCoA can also solve polynomial systems, but this is a
bit more difficult and we'll see it later. Now we solve
x-y+z | =2 |

3x-z | =-6 |

x+y | =1 |

System := Ideal(x-y+z-2, 3*x-z+6, x+y-1); ReducedGBasis(System);

[z - 21/5, x + 3/5, y - 8/5][En] Hence the solution is (z=21/5, x=-3/5, y=8/5)

3x - 4y + 7z | =2 |

2x - 2y + 5z | =10 |

M := Mat([[3, -4, 7, -2], [2, -2, 5, -10]]); H := HilbertBasis(M); L := [A In H | A[4] <= 1]; L;

[[0, 10, 6, 1], [6, 11, 4, 1], [12, 12, 2, 1], [18, 13, 0, 1]][En] The interpretation is that there are just four solutions: (0, 10, 6), (6, 11, 4), (12, 12, 2), (18, 13, 0).

B says: "C lies."

C says: "A and B lie."

Now, just who is lying here?

To answer this question we code TRUE with 1 and FALSE with 0 in ZZ/(2):

Use ZZ/(2)[a,b,c]; I1 := Ideal(a, b-1); I2 := Ideal(a-1, b); A := Intersection(I1, I2); I3 := Ideal(b, c-1); I4 := Ideal(b-1, c); B := Intersection(I3, I4); I5 := Ideal(a, b, c-1); I6 := Ideal(b-1, a, c); I7 := Ideal(b, a-1, c); I8 := Ideal(b-1, a-1, c); C := Intersection(I5, I6, I7, I8); ReducedGBasis(A + B + C);

[a, b+1, c][En] The unique solution is that A and C were lying, and B was telling the truth.

Use P ::= ZZ/(3)[x[1..6]]; Define F(X) Return X*(X-1)*(X+1); EndDefine; VerticesEq := [ F(x[I]) | I In 1..6 ]; Edges := [[1,2],[1,3],[2,3], [2,4], [2,5], [3,4], [3,6], [4,5], [4,6], [5,6]]; EdgesEq := [ (F(x[A[1]])-F(x[A[2]]))/(x[A[1]]-x[A[2]]) | A In Edges ]; I := Ideal(VerticesEq) + Ideal(EdgesEq) + Ideal(x[1]-1, x[2]); ReducedGBasis(I);

[x[2], x[1] - 1, x[3] + 1, x[4] - 1, x[6], x[5] + 1][En] The interpretation is that there is indeed a colouring in this case. For instance, if 0 means blue, 1 means red, and -1 means green, we get [country 1 = red; country 2 = blue; country 3 = green; country 4 = red; country 5 = green; country 6 = blue]

Use QQ[x[1..2],y,a,b,c,s]; A := [x[1], 0]; B := [x[2], 0]; C := [ 0, y]; Hp := Ideal(a^2 - (x[2]^2+y^2), b^2 - (x[1]^2+y^2), c - (x[2]-x[1]), 2*s - c*y); E := Elim(x[1]..y,Hp); F := Monic(Comp(Gens(E),1)); F;

a^4 -2*a^2*b^2 +b^4 -2*a^2*c^2 -2*b^2*c^2 +c^4 +16*s^2

Factor(F - 16*s^2);

[[a + b + c, 1], [a + b - c, 1], [a - b + c, 1], [a - b - c, 1]][En] The interpretation is that we have

Written by ...you?? ;-)

Please send comments or suggestions to cocoa(at)dima.unige.it

`Last Update: 19 September 2011`