#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 24 15:08:25 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

Q,R = la.qr(A) # QR decomposition of A



'''a)'''

print(R) # prints R matrix



'''b)'''

print(Q.T - la.inv(Q)) # checks that Q is orthogonal