Using Python come up with a program that will multiply matricesand show that the commutative properties do not hold formatrix multiplication.
Solution
`Hey,
Note: Brother in case of any queries, just comment inbox I would be very happy to assist all your queries
import numpy as np
A=np.random.randint(10,size=(3,3))
print(“A IS”);
print(A);
B=np.random.randint(100,size=(3,3))
print(“B IS”);
print(B);
C=np.dot(A,B)
print(“A*B IS”);
print(C);
C=np.dot(B,A);
print(“B*A IS”);
print(C);
Kindly revert for any queries
Thanks.
main.py 1 import numpy as np 2 A-np.random.randint (10,size-(3,3)) 3 print (“A IS”; 4 print (A); 5 B-np.random.randint (100,size-(3,3)) 6 print(“B IS”) 7
OR
OR