Runs-to-wins code

Code for the chapter on runs-to-wins relation