Changes between Version 16 and Version 17 of BuffonsNeedle

Show
Ignore:
Timestamp:
10/23/09 13:35:13 (5 weeks ago)
Author:
gls
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuffonsNeedle

    v16 v17  
    99We can take advantage of this to write a simulation to estimate π. 
    1010{{{ 
    11 #!fsx 
     11#!fss 
    1212   probability = hits/n 
    1313   pi_est = 2.0/probability 
     
    2424juxtaposition (of non-functions) indicates multiplication. 
    2525{{{ 
    26 #!fsx 
     26#!fss 
    2727needleLength = 20 
    2828numRows = 10 
     
    4545transformed into a reduction, but we're not there yet. 
    4646{{{ 
    47 #!fsx 
     47#!fss 
    4848   for i <- 1#3000 do 
    4949      delta_X = random(2.0) - 1