Weirdly, I hadn&#x27;t tripped over &#x27;loop invariant&#x27; in years, then I scribbled my own ode to them[1] and now this.<p>Loop invariants get important in the section on Bentley-McIlroy three section partioning.<p>[1] <a href="http:&#x2F;&#x2F;maniagnosis.crsr.net&#x2F;2016&#x2F;02&#x2F;quicksort.html" rel="nofollow">http:&#x2F;&#x2F;maniagnosis.crsr.net&#x2F;2016&#x2F;02&#x2F;quicksort.html</a>