PeachParts Mercedes-Benz Forum

PeachParts Mercedes-Benz Forum (http://www.peachparts.com/shopforum/index.php)
-   Off-Topic Discussion (http://www.peachparts.com/shopforum/forumdisplay.php?f=16)
-   -   happy Pi day everyone (http://www.peachparts.com/shopforum/showthread.php?t=216502)

TheDon 03-14-2008 03:14 PM

happy Pi day everyone
 
and Einstein's Birthday as well


3.1415926 (thats as much as I can remember)

Jordan G 03-14-2008 03:19 PM

5359....that's all the further I can go.

I memorized it off my ol' TI-85 graphing calculator.

SwampYankee 03-14-2008 03:29 PM

Cool! I'm going to celebrate by figuring out the circumference of the top of some beer cans as their volumes decrease.

Pete Geither 03-14-2008 03:37 PM

My granddaughter knows it 200 digits out. BTW,,, pie aren't square,,, pie are round. Cake are square.:D

Crazy_Nate 03-14-2008 05:25 PM

Try this on for size...

You might even notice that I'm sitting in an airport and very bored...

Code:

count = 0
max = 1e5
for i = 0:max
    x = rand;
    y = rand;
    if x^2+y^2 > 1
          %do nothing
    else
          count = count+1;
    end
end
pi = 4*count/max;
disp(pi)

\end{nerdy grad student randomness}

miljohnj5 03-14-2008 06:05 PM

My life as a wannabe math geek
 
I'm not very good in math, in fact I'm a complete idiot when it comes to numbers. I do however, like the idea that math is a language, especially with the concept of Phi and the golden ratio. Check out this site, it's actually pretty cool;
http://goldennumber.net/
Sorry pi, it may be your birthday (you little transcendental number) but you're not consistently apparent in natures design, loser... Hail Phi!!! x 1.618 ;) :D

Hogweed 03-14-2008 06:08 PM

Quote:

Originally Posted by Crazy_Nate (Post 1793026)
Try this on for size...

You might even notice that I'm sitting in an airport and very bored...

Code:

count = 0
max = 1e5
for i = 0:max
    x = rand;
    y = rand;
    if x^2+y^2 > 1
          %do nothing
    else
          count = count+1;
    end
end
pi = 4*count/max;
disp(pi)

\end{nerdy grad student randomness}

ouch. anybody got some 'cyber' aspirin?

Matt L 03-14-2008 08:54 PM

Aye, the "Monte Carlo" method for computing pi. Works fairly well. However, I recall reading about a closed-form solution a year or two ago. It only worked in binary (or another power of two, like hex) but that's good enough.

The point of the "Monte Carlo" algorithm is to throw dart at a 2x2 square, and of those darts that hit the square, count the number that are within a circle of radius 1. The area of the circle is pi, the area of the square is 4.

We must assume that "rand" returns a value between -1 and 1. Between 0 and 1 works too (I leave that as an exercise for the reader).

SwampYankee 03-15-2008 08:23 AM

Quote:

Originally Posted by Matt L (Post 1793190)
Aye, the "Monte Carlo" method for computing pi. Works fairly well. However, I recall reading about a closed-form solution a year or two ago. It only worked in binary (or another power of two, like hex) but that's good enough.

The point of the "Monte Carlo" algorithm is to throw dart at a 2x2 square, and of those darts that hit the square, count the number that are within a circle of radius 1. The area of the circle is pi, the area of the square is 4.

We must assume that "rand" returns a value between -1 and 1. Between 0 and 1 works too (I leave that as an exercise for the reader).

Yeah, that! :D


All times are GMT -4. The time now is 03:08 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2024 Pelican Parts, LLC - Posts may be archived for display on the Peach Parts or Pelican Parts Website