# Create random matrices in SageMath Create two random 7 × 7 integer matrices A and B. Check whether any of the following identities hold or not: 1. det(AB) = det(A) det(B)

1. det(A + B) = det(A) + det(B) 3. det(A−1)=1/det(A)

2. det ([ A 0 ]) = det(A) det(B)(the 0 denote 7 × 7 zero matrices) 0B

edit retag close merge delete

What have you tried? Woudl it be possible for you to post some of your code. Didi you look at this question? Here's some simply code to help you generate a 7 x 7 matrix with some random integers B = matrix(7,7, sample(xrange(100), 49)); B however, I am not sure that this is what you are looking for. If you specific and post code I'll be happy to try to help you!

1

Are you just copying a homework problem? It looks very much like it. Have you searched the web? Usually adding "sagemath" to your query gives very good results, for instance search [random matrix sagemath].

Sort by » oldest newest most voted Define a 7x7 random matrix (you must give the base ring (in my example integer ring (ZZ)):

A = random_matrix(ZZ,7,7)


Zero matrix:

O = zero_matrix(7,7)


or:

O = matrix(7,7,0)


Identity matrix:

E = identity_matrix(7,7)


or:

E = matrix(7,7,1)

more