View Single Post
  #5  
Old 03-14-2008, 05:25 PM
Crazy_Nate's Avatar
Crazy_Nate Crazy_Nate is offline
Registered User
 
Join Date: Jan 2008
Location: Hampton Roads
Posts: 567
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}
__________________
1982 240D, sold 9/17/2008
1987 300D Turbo
W124.133 - 603.960, 722.317 - Smoke Silver Metallic / Medium Red (702/177), acquired 8/15/2009
262,715 and counting
Reply With Quote