|Back to . . .||This section . . .||
Computer Output (1st part)
Computer Output (2nd part)
Below is a session of Maple, a symbolic algebra program, used to solve the first part of Archimedes' Cattle Problem. The input is in blue, the output is in red, and comments are in black.
Comment: Load the Linear Algebra library.
Warning: new definition for norm
Comment: Enter the 7x8 coefficient matrix A.
> A := array( [ [6,-5,-6,0,0,0,0,0], [0,20,-20,-9,0,0,0,0], [-13,0,-42,42,0,0,0,0], [0,-7,0,0,12,-7,0,0], [0,0,0,-9,0,20,0,-9], [0,0,-11,0,0,0,-11,30], [-13,0,0,0,-13,0,42,0] ]);
Comment: Find a basis for the nullspace of the matrix A.
Comment: The result is in the form of a set with one basis vector. Thus the dimension of the nullspace of A is one, and so A has rank seven.
Comment: Pick out the sole entry of the set of basis vectors of the null space of A.
> C:= B;
Comment: Every solution of the homogeneous system is a scalar multiple of this one vector C. Next, we wish to multiply C by a suitable constant so that the resulting entries are integers with no common divisor.
Comment: Find the least common multiple of the denominators of the entries of C.
> m:=ilcm( denom(C), denom(C), denom(C), denom(C), denom(C), denom(C), denom(C), denom(C) );
m := 3515820
Comment: Multiply C by m to obtain a vector with integer entries.
> F:= scalarmul(C, m);
F := [10366482 7460514 4149387 7358060 7206360 4893246 5439213 3515820]Comment: The eight entries of this vector are the smallest numbers of white bulls, black bulls, yellow bulls, dappled bulls, white cows, black cows, yellow cows, and dappled cows, respectively, that solve Archimedes' cattle problem.
Comment: Compute the total number of cattle.
summ := 50389082