An algorithm that is explained after decades !

What happens if you propose an algorithm that nobody understands ? Folks might say that your algorithm is silly. Don't be sad. It could be possible that folks are not capable enough to understand what you meant. Your algorithm could be explained even after your death.

Physicist J. W. Gibbs has similar story. He proposed Gibbs sampling but nobody could describe the algorithm for more than eight decades. Here is a paragraph from Wikipedia regarding Gibbs sampling:

"Gibbs sampling is an example of a Markov chain Monte Carlo algorithm. The algorithm is named after the physicist J. W. Gibbs, in reference to an analogy between thesampling algorithm and statistical physics. The algorithm was described by brothers Stuart and Donald Geman in 1984, some eight decades after the passing of Gibbs."


So conclusion here is not to be sad even though people do not understand you and your idea now. They'll understand after years and years of your death !

Monte Carlo Calculation of Pi

Note: I've not written this article. Rather I've copied here because I found this tutorial very useful. It makes me clear about the Monte Carlo method.  Readers are advised to visit the original website (here) to get the original article's taste.
----------------------------------
How can Monte Carlo be used to calculate value of Pi ?
----------------------------------
We can play Dart game to calculate value of Pi. Consider we have following board for darts:


If you are a very poor dart player, it is easy to imagine throwing darts randomly at figure, and it should be apparent that of the total number of darts that hit within the square, the number of darts that hit the shaded part (circle quadrant) is proportional to the area of that part. In other words,



If you remember your geometry, it's easy to show that 
If each dart thrown lands somewhere inside the square, the ratio of "hits" (in the shaded area) to "throws" will be one-fourth the value of pi. If you actually do this experiment, you'll soon realize that it takes a very large number of throws to get a decent value of pi...well over 1,000. To make things easy on ourselves, we can have computers generate random* numbers.

If we say our circle's radius is 1.0, for each throw we can generate two random numbers, an x and a y coordinate, which we can then use to calculate the distance from the origin (0,0) using the Pythagorean theorem. If the distance from the origin is less than or equal to 1.0, it is within the shaded area and counts as a hit. Do this thousands (or millions) of times, and you will wind up with an estimate of the value of pi. How good it is depends on how many iterations (throws) are done, and to a lesser extent on the quality of the random number generator. Simple computer code for a single iteration, or throw, might be:

x=(random#)
 y=(random#)
 dist=sqrt(x^2 + y^2)
 if dist.from.origin (less.than.or.equal.to) 1.0 
  let hits=hits+1.0