More pizza squabbles
Saturday, May 2nd, 2009
The other day I ruminated on whether going for the smallest slice of pizza initially will result in your getting more in the long run than going for the biggest first, and concluded that I should try and write a computer model of it, which I have now done (bear in mind the page is a bit slow to load), to a degree.
The graphs below, plotting number of pizza slices vertically (increasing as you go down) and number of people horizontally (increasing to the right), and average over 100 trials per slices/people combination, show that there is a small area, when the number of people is roughly equal to half the number of pizza slices, and the number of people is not too big, where taking the smallest available slice on the first go pays off. But an even better strategy under these circumstances is to take the smallest of the N largest slices, where N is the number of people.
There are lots of alterations I’d like to make to the model, as it’s not quite a true reflection of reality.
- Add the ability to have people eating at different rates.
- At present the sizes of the slices are chosen randomly (and then normalised to make sure the total size is equal to the number of slices). However, the distribution in real life pizza slice sizes is far from random; they will probably have roughly a normal distribution, with very few extra big slices and very few extra small ones. Because the size of one slice is not independent of the sizes of other slices, they are likely to follow a more complex distribution, but it’s probably beyond me to work out what it is.
- The colours are nowhere near contrasting enough. I’ve done a bit of a fiddle on the greens to bring them out a bit more, but it’s a bit of a cheat that probably won’t always work. There are regions in the graph where one strategy is consistently slightly better than the other, but it doesn’t show. A high contrast version (below) does show this info (and in fact also showing that most of the time you’re better off wtha smaller slice first strategy if more than two slices per person), but I think it’s important to show the subtleties too.

- The slow loading is an issue.
For the record, now that I know how OOP works in PHP I used my new skills to write the model, and it was most useful. Much easier to keep track of what values you’ve written to where.

