STANDARD DISCLAIMER

Everything in this blog is my opinion and does not in any way, shape, or form represent the opinion or officially stated position of Microsoft, Google , or Kim Jong Il
this is fairly obvious when one considers I have no official capacity in any of these organizations.

Thursday, May 30, 2013

There is no way this happened randomly

One of the things I hear often re the universe , creation et al is the standard “There is no way this happened randomly just look around you man LOOK I SAY ! fractal clouds and cauliflower florets”

Which is all well and good and I am not going to debate the god superstition here however sometimes  its nice to look at the power of random( warning some minimal math and coding involved but you should be able to skip and skill get the flavour of what I am saying ) Editors Note Yeah Maybe

So let us start with a triangle . You know the things that aren’t squares rectangles or circles or anything other than triangles. So we have something like this

                            A

Bimage C

 

Cool Eh !

Now assume there is a point far far way somewhere in the universe . Now roll a perfectly fair die. Here is what we are going to do .

If the die shows up a 1 or a 2 we are going to pick a point halfway between the original point and A and color the midway point blue

if the dice is 3 or 4 then pick halfway between the current point and B and color it red

if the dice is 5 or 6 then pick halfway between the current point and C and color it green

Please note that the numbers on the dice are not relevant All we are doing is randomly picking one number from 3 where all 3 numbers are equally probable to occur in our random picking.

With me So far?

So lets say we rolled a 1 a 3 and a 6. After 3 attempts our triangle with dots ( in  G minor :-) ) now looks something like

image

AS the avid and observant readers will have figured out by now : you keep rolling the dice and the colours just randomly start filling up the triangle . On obvious point to note is that once a dot lands inside the triangle all further dots will lie inside the triangle too.There is nothing clever about this , since we are always computing half way point to each edge point we stay within the boundary of the triangle

 

So at his point we have this really clever way of randomly dumping dots on a triangle and really you can get any kid with a crayon and paper ( or wall ) to do this

 

But lets say we run this process a million times ( computers are pretty good at that source code later ). SO a million dots of the primary colours randomly placed over the screen. What do we expect the resultant picture to look like? Anyone?

Well my guess was this amorphous blob of black or gray or maybe even some weird mixing of colours or whatever but definitely almost no structure . And if we ran the program again well this time would get totally different dots of course so like some other random scribbling

 

 

I’ll spare you the suspense . HERE IS WHAT YOU GET EVERY SINGLE TIME NO MATTER THE ORDER OF THE DOTS

 

PRETTY EFFING COOL EH!

Pseudo code in the link…

 

Finally if you have more than a passing knowledge of the math needed to understand Fractals or affine transforms or IFS etc and you know who Michael Barnsley is please spare me everything that is wrong with my simplified explanation :-)

IT still always gets me all excited when a random dice roll can get us this . Maybe this is what the rest of the world is talking about when they talk about a “spiritual experience “

1 comment:

Anonymous said...

Nice post.
Obviously you are omitting a key fact that God made the dice land the way it did, and picked that cool image because it was close to what his intelligent design looked like. Your move