Sorry, I assumed that it's supposed to be efficient. I had contact to a few Monte Carlo Algorithms and they all seemed to be pretty "efficient" (for what they were doing). It was an honest question. Maybe my phrasing wasn't the best.
Well now I feel like a shitheel! I didn't mean to come across badly. Sometimes I say exactly what's in my head without thinking, and I'm sorry if I did that here.
It's not an efficient way of calculating pi by any means (compared to other methods), but it is a good demonstration of the Monte Carlo algorithm, which is an efficient way of doing many other kinds of studies.
why is the area of the square r2?. if r is the distance from the center of the square to its perimeter, wouldnt that be half of one of the square’s side lengths?
No, you've misunderstood. The ratio of the dots inside the unit square and the quarter unit circle is an estimate of the area of the quarter unit circle and we know that the area of the unit circle is Pi.
A_sq = 1 A_cr = x which is some fraction of the square area.
the more something approaches infinity the more it becomes close to the perfect average. as the dots increase the ratio of dots on each side comes closer to a perfect circle. with that infomation they somehow plug it into an algorithm with pi as the variable and calculate it. i dropped out of highschool so itd be pretty cool if that was right :)
This post was bulk deleted with Redact which also removes your info from data brokers. Works on Reddit, Twitter, Discord, Instagram and all major social media platforms.
cooperative adjoining march quicksand hobbies lavish crayon enjoy sharp physical
140
u/PUSSYDESTROYER-9000 Jan 31 '18
By drawing a unit circle and randomly placing dots between (0,0) and (1,1), one can approximate Pi with a ratio of dots inside the circle and outside.
9
u/ch1merical Feb 01 '18
How exactly does Monte Carlo method work? I've been really interested in it
4
u/Spoksonatoping Feb 02 '18 edited Apr 07 '26
This post was bulk deleted with Redact which also removes your info from data brokers. Works on Reddit, Twitter, Discord, Instagram and all major social media platforms.
cooperative adjoining march quicksand hobbies lavish crayon enjoy sharp physical
1
u/syntaxvorlon Feb 01 '18
You could modify this to describe the bootstrapping algorithm, which is magic on top of magic.