Percolation, Predestination, and Freewill

Yeah, I just finished week 1 assignment of Algorithms, Part I about percolation, but why the hack this post trying to talk about Predestination and Freewill, a religious topic that would be super boring? OK. Calm down, calm down and watch this video first, my friend. It’s a silent film lasts only 20 seconds.

In the Christmas retreat held on last Saturday, Pastor Peter Tzeng from SF Gratia Presbyterian Church preached a sermon about “Predestination and Election”, which suddenly reminded me of the programming assignment I just finished. My heart was filled with peace, gratitude, and grace at that time. It’s really grateful to be part of a church, as you will never walk alone.

Let’s go back to the test case which I wrote a special test program ShuffledPercolationVisualizer to simulate the process. The video you have just watched was also recorded at that time.

This test case, with a matrix of 60 * 60, initialized 3600 sites blocked(marked black), then you can choose to select some of them and marked white, which was called “to open a site”. Meanwhile, if there is a connection between opened sites to any open site in the top row, all the sites involved in the connection will be marked blue.

There are 2408 opened sites, and when all of them are selected, the matrix will appear like Robert Sedgewick, Professor at Princeton University, instructor of the course.

You can shuffle the steps of opening these 2408 sites, but the result will always be the same. The connection will draw a picture for certain, it will never change its destination actually.

Then how many possible sequences there can be to open these 2408 sites? It’s very clear that the result will be factorial of 2408, but do you have any idea how big it would be?

I got into some trouble in calculating factorial of 2408 using Java, and I found using Python is much easier this time.

1
2
import math
print(math.factorial(2408))

And the result is…ready? Go!

21758594999952225256227255509958770525534993761170297492657718767486088244539036311974548105366978730304890874687998931843982776471695309982496716091929477596457019761300893173741534377145055742888600264305972407789653360420715650908019804809003333937353797238853879239069468095253478585900901569877665080446005525224089508413768914166828202348453714981888582265659866672234817320549835393263269600678943173083208786150887241218830951534151023198217804926543144488519879222117164281533725136849972519542757913468975304278272202313390978737108647430080250688571420352473288158962330968717973026215547164574655829522597595920308076300262533612505452491729694802704235061137562520593939941611211676246573285129213297740475072197491178881479094324050477716711007186760890805885289600818395369120904089858881365253682904986765051411600279317114544670877598660608068387251089672699624432818691431753629834595266369774230206535021500947768350641436338008224871891096941989810564059835480734023608516986342940799282601509909755914345702002398979527341635335589932079921844550299296765788764614115047189880053781089359124607076307477102000781076272097686933038955068463564138165407556497891242723903418121248640843251301848661406267955775206671116633131848330041457815589303985731973513659761266361451987631846567722247462019715782565495726789718590430300132709702923444485339649818738367459553944758665000677121577239898195392489190372781469616510565567235662058347447041036082279555002359384777241046356630140481788406662330268331157432591691983712930387182787427331315236514697941067977155337915150525669700467459039497125260067081460975724610012796075453577512129524610598629405415947882287562646596847798500277989940349764441278748496344810587661925483816853247911767802264941093438557143107557343354223365275158586265975784232244388778490424915335014856632359110022021568854780677765623358588472815628236138731069723731918036279618308587391396893812365810934868790695982445677773511512096164778247854799696415801777047426769474512776572807515499163928478050635767617241814153161069023349807872926989276321585129832669703196308315638887095150725873327382978368414291853714206642479565340623081645635259899325152723077182087825883320502448759987706414708555797695156437711005255453773088388421692048712808757032199780471397499344526710742025027366241277709542406769259163050319711009907937797988005289487586289285239191709874783876026264546187631023984005517156464453378524257632954079904118202556259631871941494206554425675391040068137333289842961763952315169361943659557098887908148472454753534441180805876726890829406428410293912061447395930885462039983639454999156893078306721906157525678665587288311022535413165018866038774554519237458631172359295574521080147470001807646132611548173799809180872176554883132407975754633781395902726073263358391864654226838611241280382791810347791313261228186922648281944512665244213221470708304181265827395530294959267833181512516106016708886865802585082368266589308282277973310417979771362961573289306518544172875848050627600215462334565453317064959637152271137508553349749864076477375290799340126691892626805021243113341240094988118302395281987744694938839705675124899805205311840735482867308921928032903126837676596703677074546354070316422400659168832877910530102049188638921987560519794911408413376690139023750683170764269423245188478974782685833231647755282809023275600579562068022306125965603894714096709169014359173885725022410482307983582848544029430308504710050913607427947146960265782278182851895691019554244771829604138266880136613179627902032928187316074972413984172931815414459532911017932363121474024120207932042589633624980202492915808108472682957610862771268658194135467582024669148130274010639626573267227084500963051586412573311529688779546274807578980079589236574590032283708780576841735220257056089488889054503441347829340342987839998850315817941430464119539322030100036391585484429073544194437248620041004947094494306813124947233221809464184492977405338266088004753342006034454256802717860213487102304602111082069729179183912892310926940010895293383091638154273639132326948510614314636246553636478230586408593481841258855076019524321468305027698853616858544467250133242472615996699171731672015980715690856827203376654427469688828493437318017191647963907353096155949414777105832802809111797630502385412343654294767130489796867215540128434416046595314739194824591845330992960181683418445356776559743473171773332982169278213091022970109475662032901706168542366477219418250959082099419221794734241867163997537294903638475623203613762563916868986220108618349798999297270144629976714666404789938566426084294730264011993843464803887031369997182138090586858439263165728582852107148235168845179981951308720985000631523794448909717418597240983588271119017952446552908771616828729694498105134321362587752084498298540631630047275976674069416103878183339417398381640250832037298996904027435379281480080779997366294091624818615213365710341769880327641623742788293755856604362177161860165904684510408376136291933499279091071147396522966312847540590794851028270031075275070110877864018101022208278340073515317163453715671305253878011789709400417146562136811038036869947227020189400688889289145368187906102145887240147199649624741501825733634493584569288672808008071700916133597015265730531592515259177198882367872332958036736813927476039975698636525851141792384458124270507717681351913851341602999123763657321159787790779636932576524606488017978717474806161069078372492020161577278433064090872570321300847401308302034646131087623196009250892633693952221225135875156933075853403175847677904474782437577896496547224344704997964123613109921984911971617174297374719817432121315231348044318866252156117239158307344697451683424693705097269162351898260575905280042177114272875010079571280939316425425734562133587147771503016863766670267188101589212539344187429237337097886813790907620488059495062409895961794810564953442060219347321914248124224100979617970052618332117897515242897039379709127894075251637810159733054718222062365062421320028544993426422351376478518352472783084637480300654371523661962663091208492103830074944716764484446634939320765685200444210417771706531035127562476041407515658152099601907167854337328045882514475289024549979687331418902963389094528577036145080901894491929405642630745909979143286735986058234759547883452690878465663700666796458122673957366323079880085451052670365099161588137223768621426118555148885228241036087524278431003970843443200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

And we would easily find that two facts exist without any conflict:

  • You can select and open 2408 sites freely in nearly infinite possible ways
  • The destination pciture will never change when all the open sites connected

Every day you make decisions that will have an impact on your life, sometimes you make them according to your own will, sometimes you just have to and have no choice. When Christians are taught that God has a plan for their life and predestined a good ending - we don’t discuss what kind of good it would be here, it seems very confusing and contrary to our daily life, and very difficult to believe that.

How can this be? How can a man act according to his free will if there is predestination from God already?

It would be very easy to approach and answer this question, or very difficult and impossible to answer this question.

The easy approach is to question the question itself, as it is based on a false assumption. Why can’t God’s predestination and men’s free will co-exist? Why do we think that it’s so obvious that you can only have one of them, either predestination or free will?

Based on this false assumption, and the preciousness of freewill, Christian faith about Predestination became chains of the souls who are struggling with how to make decisions - though it doesn’t need to be like this.

We simply overrated our ability while underrated God’s providence.

If those selected and opened sites are steps of my life, then I know that no matter how I walked through these steps, my destination won’t change, I would draw a picture of myself rebuilt by God’s grace. Many times I cannot understand why certain steps are connected in a confusing way, but immediately I can testify that in the right time God led me to the right place, to do the right things - usually I don’t know what the right things really are.😅

If those selected and opened sites are brothers and sisters in the church, called by God to build His Kingdom, then I know that no matter how and when they are elected, the destination won’t change, we will draw a picture of Kingdom of God that God will surely restore.

To appreciate and recognize God’s works in brothers and sisters is a joyful work that I’d like to practice always, you will never know how God will use a man and when God will use a man, but the result will always help you to know more about God, know more about you.

In the beginning, God created the heavens and the earth. And in the end, “a new heaven and a new earth”. As a result, the bottom row will for sure connect to the top row, percolates would always return true. If this is the test case you can skip the complex implementation and simply return true.

Percolation, predestination, and freewill. Complicated, simple, and mysterious.

Hard to believe, right? Maybe the life and works of Martin Luther, John Calvin will give you some insight on this never ending discussion.