That is to say, suppose we start with a grid of N x N sites, all insulating initially, and then metallize them at random one be one. The fraction of sites that are metallic when the grid starts conducting/percolating top to bottom is the estimate of the percolation threshold. It’s about 59%. In the above gif with 12 x 12 sites this happens at frame 79 which gives an estimate 78/144 = 0.54. Phase transition gets sharp with large dimension N obviously.
This mathematical model is surprisingly without exact analytical solution as of today and the only answer can be obtained via such simulation which in turn can be successfully run for large N only with a well-designed algorithm.
This is also the first programming assignment in an on-line course Algorithms 1 I’m currently attending. Check it out, it’s a lot of fun.
I studied physics, you see, and while I learnt how to code to some extend, I stayed at that novice level really. Computer science has always fascinated me, so here I am, brushing up on my Java and learning this things I wish I had known all along.