Really great. My only comment would be instead of the terse mathematical notation (as you can do so in this case), a simple example with code would add to clarity, especially for those of us who lack a proper maths education.
Why not instead of terse mathematical notation use a simple visual representation using balls and teddies for clarity, especially for those who lack mathematical and coding education?
Anyone who wants to read articles that contain math should learn notation.