Skip to content

Modeling a PaperClip experiment to demonstrates Zipf's law, as suggested by Michal Stevens from VSause.

Notifications You must be signed in to change notification settings

nitasn/PaperClips-VSauce-Experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

PaperClips vs Zipf

Modeling a PaperClip experiment to demonstrate Zipf's Law.

The idea was presented by Michael Stevens on VSauce and was beautifully explained and performed by hand.

The procedure goes as follows:

0. Start with a pile of unconnected paper clips.

1. Pick any two paper clips at random.

2. Link them together and throw them back in the pile. 

   If any of them is already part of a chain - lengthen the chain by connecting to its end.

3. Repeat.

The final chains' lengths should have a pretty Zipf'ian distribution, i.e. if laid down side by side, longest to shortest, they should like the graph of the function f(x) = 1/x.

Example Output: Example Output

The code uses the Disjoint-Set data structure (a.k.a Union-Find),
hence each pick-and-join operation takes O(1) amortized time (wiki).

About

Modeling a PaperClip experiment to demonstrates Zipf's law, as suggested by Michal Stevens from VSause.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages