http://www.ece.mcmaster.ca/faculty/reilly/ee3tr4/prob_sol.html