This was copied from my lecture slides. May be a bit out of context and some of the latex formulae may not be correctly parsed (JLe / 20151120).