pi from area

Install Java to view this project right on your browser!

user_icon kevin_karplus shared it 4 years, 2 months ago
468 views, 2 taggers, 6 people love it, 1 remix by 1 person, 53 downloads, in 7 galleries
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

 
Oldschooler2 Oldschooler2 2 years, 11 months ago

I used a very similar approach to this in my C++ class at school to approximate the area of pi, only you could pick how many random points.

hmnwilson hmnwilson 3 years, 4 months ago

Where did you go?

skryed skryed 3 years, 7 months ago

you live un santa cruz? lol me too

Techie31415 Techie31415 3 years, 8 months ago

I managed to speed it up a bit and let it run for 100,000 samples, but it came consistently to about -0.015 of pi. Since it never (at the end) went above the true value of pi in the 3 tests that I did, seemingly, the random number generator in Scratch is probably only pseudo-random, or I did not do enough tests. Is there any part of statistics that might predict the value of pi that I got with 100,000 tests to be within this range, however?

bubble-07 bubble-07 3 years, 9 months ago

To make it a little more efficien, you could make it so it goes line by line, with the script copied within the forever loop. That i good for optomization.

DrSuper DrSuper 3 years, 10 months ago

This is cool and a great idea. If you could show the math a bit and advise the looker to be patient they will get it. Not many people have dowloaded it so i fear not many lookers got it. Look at my game Susa you will like it!

Ivaash Ivaash 4 years, 1 month ago

Can you help me you're a forum moderator (link to forums)

kevin_karplus kevin_karplus 4 years, 2 months ago

From statistics, we can work out that both the mean and the variance of the number of points in the circle is n*pi/4. That means that the standard deviation of the estimate of pi will be about pi/sqrt(n). After 10000 samples, you expect to be within about +- 0.03 of pi.

bigB bigB 4 years, 2 months ago

its a good priject but i am actually suprised at how ineffiecient it is.

maki maki 4 years, 2 months ago

this is similar to my project

planetX planetX 4 years, 2 months ago

cool

Please Wait...