Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Monte-Carlo-methods/Logo/monte-carlo-methods.logo
Normal file
16
Task/Monte-Carlo-methods/Logo/monte-carlo-methods.logo
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
to square :n
|
||||
output :n * :n
|
||||
end
|
||||
to trial :r
|
||||
output less? sum square random :r square random :r square :r
|
||||
end
|
||||
to sim :n :r
|
||||
make "hits 0
|
||||
repeat :n [if trial :r [make "hits :hits + 1]]
|
||||
output 4 * :hits / :n
|
||||
end
|
||||
|
||||
show sim 1000 10000 ; 3.18
|
||||
show sim 10000 10000 ; 3.1612
|
||||
show sim 100000 10000 ; 3.145
|
||||
show sim 1000000 10000 ; 3.140828
|
||||
Loading…
Add table
Add a link
Reference in a new issue