#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 24 14:41:12 2024

@author: sam
"""

import numpy as np
from scipy import linalg as la

A = np.random.rand(4,4) # creates a 4x4 matrix A of random numbers



'''a)'''

print(A.T) # transposes A



'''b)'''

b = np.array([[1],[3],[-1],[2]]) # creates 4x1 vector b

print(A @ b) # prints the matrix product of A and b



'''c)'''

print(A @ la.inv(A)) # prints the matrix product of A and A^-1, which is the 4x4 identity matrix

print(la.norm(A @ la.inv(A),2)) # prints the euclidean norm of AA^-1

print(np.eye(4)) # prints the 4x4 identity matrix