View Single Post
  #7  
Old 09-06-2014, 06:52 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXLII
Default Re: Yet another free university....

The first programming exercise is fun. Imagine an N x N grid of squares with some squares filled in (blocked) and some not:

* * * * 
* * * * 
** * *
* **  
* *
* * *
*** *
** * *

Then you try to find a route from the top to the bottom - imagine that the grid represents a partially porous material and you want to find if water could percolate through from the top to the bottom.

If the grid starts out completely blocked (full of asterisks in my example) and then you randomly clear squares in the grid till it percolates, what percentage of squares would you need to clear before there is a 50% chance of percolation?

According to the course, mathematicians have not yet been able to solve this problem, but computer simulations have shown that the percentage is approximately 59.3%

The course uses the percolation problem as an example of applying the 'Union Find' algorithm and pretty much walks you through the simple code necessary to implement it before asking you to go ahead and run a model. Of course, they supply most of the code for you - but it's much more interesting than the usual 'hello world' type of exercise that such courses often begin with.
__________________

Last edited by ceptimus; 09-06-2014 at 10:01 PM. Reason: Changed a full stop to a comma.
Reply With Quote
Thanks, from:
Ari (09-23-2014), Crumb (09-06-2014), Dragar (09-10-2014), Ensign Steve (09-06-2014), JoeP (09-06-2014), Kael (09-06-2014), SR71 (09-10-2014)
 
Page generated in 0.11760 seconds with 11 queries