function [flops] = hw3afn(n,v,w)

   flops = 0;
   vR(1,1) = sqrt(v(1,1));

   for i = 2:n
      wR(i-1,1) = w(i-1,1)/vR(i-1,1);
      vR(i,1) = sqrt(v(i,1)-wR(i-1,1)*wR(i-1,1));
      flops = flops+3;
   end

end
