Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Monte-Carlo-methods/Stata/monte-carlo-methods.stata
Normal file
17
Task/Monte-Carlo-methods/Stata/monte-carlo-methods.stata
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
program define mcdisk
|
||||
clear all
|
||||
quietly set obs `1'
|
||||
gen x=2*runiform()
|
||||
gen y=2*runiform()
|
||||
quietly count if (x-1)^2+(y-1)^2<1
|
||||
display 4*r(N)/_N
|
||||
end
|
||||
|
||||
. mcdisk 10000
|
||||
3.1424
|
||||
|
||||
. mcdisk 1000000
|
||||
3.141904
|
||||
|
||||
. mcdisk 100000000
|
||||
3.1416253
|
||||
Loading…
Add table
Add a link
Reference in a new issue