Hello,

You can have a look here : http://www.medicine.mcgill.ca/epidem...n-elevator.pdf

and here for a "similar" problem : http://www.mathhelpforum.com/math-he...blem-50-a.html (I think that the relevant messages are from post #15)

For b, it's the problem of least squares. You can google for "least squares"