 By the Cauchy–Schwarz inequality,

which, after rearranging, implies that

This inequality is sharp; equality is achieved if Z almost surely equals a positive constant.In turn, this implies another convenient form (known as Cantelli's inequality) which is
where formula_10 and formula_11.This follows from the substitution formula_12 valid when formula_13.