C O M P U T E R . O U T P U T . ( 1 S T . P A R T )
 Back to . . . Archimedes Home Page This section . . . Statement (English) Solution (1st part) Solution (2nd part) Statement (Greek) 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. > with(linalg): Warning: new definition for norm Warning: new definition for trace 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. > B:=kernel(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[1]; 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[1]), denom(C[2]), denom(C[3]), denom(C[4]), denom(C[5]), denom(C[6]), denom(C[7]), denom(C[8]) ); 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:=F[1]+F[2]+F[3]+F[4]+F[5]+F[6]+F[7]+F[8]; summ := 50389082