Ila G. answered 08/03/22
Tutor
4.9
(109)
Ph.D. tutor for Physics and Math for High School and College Students
import numpy as np
Q=np.array([[1,2],[3,4]])
R=np.array([[5,6],[7,8]])
T=np.array([[9,10],[11,12]])
def associative(Q,R,T):
l_h_s = Q*(R*T)
r_h_s= (Q*R)*T
return (l_h_s, r_h_s)
def distributive(Q,R,T):
l_h_s= (Q+R)*T
r_h_s = Q*R + R*T
return (l_h_s,r_h_s)
print(associative(Q, R, T))
print(distributive(Q, R, T))