Was a bit hard to see graph with such big circles
Rubber ducking solved the problem

I talked my wife through the problem and she thought that it was strange that people had to go to the restroom 3 times every 10 minutes. That sounded like and awfully short time. So it got me thinking that going that often means the restroom becomes completely saturated and we end up with a linear relationship.

So I reread the chapter quickly and realised that I must have pulled my 10 minutes out of thin air because it did not say 10 minutes anywhere. More naturally you spend about 540 minutes in the office a day and go roughly 3 times to the bathroom in that time. So by plugging 540 in we got a relationship similar to the one described in the book.

However my alternative test code example does not work, but the julia code adapted from the ruby code does work.

What did I learn from all this?

1. Go through the algorithm on paper before coding it up so you know what is going on.

2. Write test code for individual functions so you know they are working. With randomness you can check the mean value and see if it is what you expect.

3. Write small functions. I found that testing and debugging was hard using the original code layout because too much was going on in the simulation code that I could not test separately.

4. You can actually waste time writing lots of tests and fiddling with your code when what you really should be doing is take a step back and figure out on paper or explain to someone what you are supposed to do and what the assumptions are.

I was doing a lot of effort to uncover issues in the logic of my code when in fact I had set one of my parameters to the wrong value, and thinking carefully about what I was simulation and how, would have uncovered the problem.