Linear Systems

CoCoA can solve linear systems. You just need to
write every equation 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]

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

Non-negative Integer Solutions

Can you find the triples of non-negative integer
solutions of the following system?

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]

Heron's Formula

Is it possible to express the area of a triangle as
a function of the length of its sides?