<jupyter_start><jupyter_text><jupyter_code>import numpy as np
matrix1 = np.array([
                    [2,1,3],
                    [5,4,6],
                    [8,7,9],
])

matrix2 = np.array([
                    [4,2,6],
                    [9,7,5],
                    [3,6,2],
])

matrix3 = np.array([
                    [9,6,8],
                    [1,5,2],
                    [5,7,4],
])<jupyter_output><empty_output><jupyter_text>1. COMMUTATIVE PROPERTY$AB \neq BA$<jupyter_code>AB = matrix1 @ matrix2
BA = matrix2 @ matrix1
print("AB = \n", AB)
print("BA = \n", BA)
np.array_equiv(AB, BA)<jupyter_output><empty_output><jupyter_text>2. DISTRIBUTIVE PROPERTY$A(B + C) = AB + AC$<jupyter_code>A_BC = matrix1 @ (matrix2+matrix3)
AB_AC = (matrix1 @ matrix2) + (matrix1 @ matrix3)
print("A(B+C) = \n", A_BC)
print("AB + AC = \n", AB_AC)
np.array_equiv(A_BC, AB_AC)<jupyter_output><empty_output><jupyter_text>3. ASSIOCIATIVE PROPERTY$(AB)C = A(BC)$<jupyter_code>AB_C = (matrix1 @ matrix2) @ matrix3
A_BC = matrix1 @ (matrix2 @ matrix3)
print("(AB)C = \n", AB_C)
print("A(BC) = \n", A_BC)
np.array_equiv(AB_C, A_BC)<jupyter_output><empty_output><jupyter_text>4. MULTIPLICATIVE IDENTITY PROPERTY$AI = A $<jupyter_code>I = np.eye(3, dtype = int)
AI = matrix1 @ I
print("AI = \n", AI)
print("A = \n", matrix1)
np.array_equiv(AI, matrix1)<jupyter_output><empty_output><jupyter_text>5. MULTIPLICATIVE PROPERTY OF ZERO$A0 = 0$<jupyter_code>zero = np.zeros(matrix1.shape)
A_zero = matrix1 @ zero
print("A0 = \n", A_zero)
print("zero = \n", zero)
np.array_equiv(zero, A_zero)<jupyter_output><empty_output><jupyter_text>6. TRANSPOSITION PROPERTY OF MULTIPLICATION$A\cdot A^{-1} = I$<jupyter_code>mat2 = matrix2 @ np.linalg.inv(matrix2)
I = np.eye(3,dtype=int)
print("A(A inv) = \n", mat2.astype(int))
print("I = \n", I)
np.array_equiv(mat2.astype(int), np.eye(3,dtype=int))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17975751186083289, 'fraction_numerical': 0.03690036900369004, 'mean_word_length': 3.7096774193548385, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '144452', 'license': 'Apache-2.0', 'n_tokens_mistral': 837, 'n_tokens_neox': 820, 'n_words': 131, 'path': 'Week 7/LinAlg_58051_Imbat_Matrix_Operations.ipynb', 'repo_name': 'jemayne/LinearAlgebra58051', 'size': '1897'}