function Mar26()
format short
clc
m = 4;
n = 8;
A = randn(m,n);
b = randn(m,1);
[Q,R,P] = qr(A)
% Since AP = QR we have Q'*AP = R = [R11 R12] where 
R11 = R(1:m,1:m);
% is upper triangular. Thus Ax = b transform to (Q'*A*P)*(P'*x) = Q'*b,
% i.e., [R11 R12][y;z] =  R11*y + R12* z = btilde where
btilde = Q'*b;
% and x = P*[y;z]. Set 
z = zeros(n-m,1);
y = R11\btilde;
x = P*[y;z]
Resid = A*x - b
