Computer model of button and thread game
Based on the description of the game in Deep Simplicity by John Gribbin
The button and thread game is played as follows: You have a pile of N buttons and an unlimited suupply of thread. You pick 2 buttons at random and tie them together with the thread, then put them back. Next you pick another two buttons... and so on, to create clusters of buttons.
The simulation below uses 1500 buttons and keeps going until each button is joined together into a super cluster. The following graph charts these properties(in intervals of 20 threads):
- Black is the maximum size of a group of buttons tied together
- Red is the number of groups of buttons
- Green is the number of buttons not tied to anything
- Blue is the number of buttons tied to at least one other button
- Grey is the minimum size of a group
- Dark green is the number of groups of 2 buttons or more
- Yellow is the average size of a group of buttons
- Aqua is the average size of groups of 2 or more buttons
The graph is built out of a simple html list of the data (using some css styling), which can be seen if you turn off all stylesheets for this page.
The most interesting facts I think are
- that instances where the minimum group is not equal to 1 or 1500 are extremely rare. Overwhelmingly the most likely scenario is that there will be one last lone button floating around (and before that even, a few lone buttons), rather than lone clusters of 2 or 3.
- To begin with, the number of groups in the pile of buttons (counting 1 button by itself as a group) decreases almost linearly
- The number of groups of 2 buttons or more peaks roughly where the number of buttons tied to at least one other button equals the number of groups of buttons (including single buttons as a group). At this point a thread has an equal chance of connecting a button (and its group) to another button or connecting to a button already in a group of 2 or more. So up until this point it was more likely to take a single button into a group, which would decrease the number of single button groups, and either increase the 2 button or more count or keep it the same. After this point the thread is more likely to join to an already existing cluster of buttons, therefore not increasing the number of clusters.
- The max size of a group can up to double in size in one step (two big groups get connected by a thread)
- The occasional haywire (up and down) behaviour of the average of clusters of two or more indicates that even quite late on individual buttons join together to form clusters of 2 (otherwise the avg would be increasing)
- The fact that the average graphs form steps towards the end demonstrates that most new threads at that stage do not lead to the merging or or creation of new clusters.