This method returns a random symmetric matrix of a given size $n$ with integer entries. This can in turn be specialized to any ring, which may be provided as an argument.
i1 : randomIntegerSymmetric 5 o1 = | 16 4 8 10 14 | | 4 6 14 14 17 | | 8 14 16 8 5 | | 10 14 8 12 15 | | 14 17 5 15 12 | 5 5 o1 : Matrix ZZ <--- ZZ |
i2 : randomIntegerSymmetric 20 o2 = | 18 9 3 10 9 5 13 14 8 10 10 10 11 7 11 16 8 8 6 13 | | 9 2 16 14 4 3 12 6 11 6 10 9 6 10 17 7 11 11 6 14 | | 3 16 4 6 7 15 5 10 14 13 5 9 2 4 13 10 8 6 10 5 | | 10 14 6 18 16 11 7 13 15 11 10 16 18 1 13 10 5 10 14 10 | | 9 4 7 16 6 8 15 5 9 7 14 13 10 13 12 6 16 12 9 9 | | 5 3 15 11 8 16 3 5 15 10 8 13 10 7 9 1 16 10 9 7 | | 13 12 5 7 15 3 4 13 9 11 18 10 4 4 8 15 9 8 10 14 | | 14 6 10 13 5 5 13 4 16 14 4 14 15 7 4 17 9 7 8 5 | | 8 11 14 15 9 15 9 16 0 8 10 6 5 11 3 12 2 14 15 7 | | 10 6 13 11 7 10 11 14 8 16 12 6 6 6 9 10 11 9 9 12 | | 10 10 5 10 14 8 18 4 10 12 18 9 6 8 5 9 3 9 12 11 | | 10 9 9 16 13 13 10 14 6 6 9 8 14 6 12 6 6 4 8 11 | | 11 6 2 18 10 10 4 15 5 6 6 14 16 12 2 13 5 7 4 5 | | 7 10 4 1 13 7 4 7 11 6 8 6 12 4 9 10 10 12 12 4 | | 11 17 13 13 12 9 8 4 3 9 5 12 2 9 4 4 3 11 8 11 | | 16 7 10 10 6 1 15 17 12 10 9 6 13 10 4 4 3 15 13 7 | | 8 11 8 5 16 16 9 9 2 11 3 6 5 10 3 3 0 10 14 10 | | 8 11 6 10 12 10 8 7 14 9 9 4 7 12 11 15 10 18 7 14 | | 6 6 10 14 9 9 10 8 15 9 12 8 4 12 8 13 14 7 10 11 | | 13 14 5 10 9 7 14 5 7 12 11 11 5 4 11 7 10 14 11 4 | 20 20 o2 : Matrix ZZ <--- ZZ |
i3 : R = RR[x,y] o3 = R o3 : PolynomialRing |
i4 : randomIntegerSymmetric(3, R) o4 = | 14 13 6 | | 13 0 13 | | 6 13 2 | 3 3 o4 : Matrix R <--- R |
The entries of the constructed matrix will be integers between 0 and 18, inclusive.
The object randomIntegerSymmetric is a method function.