function [vR,wR,theflops,thesqrts] = hw3prob1(n,v,w)

   theflops = 0;
   vR(1,1) = sqrt(v(1,1));
   thesqrts = 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));
      thesqrts = thesqrts+1;
      theflops = theflops+3;
   end

end
