function Mar24()

n = 5;
f = randn(n,1);
g = randn(n,1);
% Compute the QR factorization of [f g]. (This could be done using
% Givens rotations, but we will let qr() do the work.
[Q,R] = qr([f g]);
% Notice that 
%             Q'*f = [R(1,1);zeros(n-1,1)] 
%             Q'*g = [R(1,2);R(2,2);zeros(n-2,1)]
% Thus, B = Q'(f*g')*Q is zero everywhere except 
%             B(1,1:2) = [R(1,1)*R(1,2) R(1,1)*R(2,2)]
format short
clc
B = Q'*(f*g')*Q
B11B12 = [R(1,1)*R(1,2)  R(1,1)*R(2,2)]