gumi_kr

8 Reputation

2 Badges

17 years, 35 days

MaplePrimes Activity


These are Posts that have been published by gumi_kr

Hi everyone, i've got a strange question: I wanted to use monte carlo method to count the volume of the ball i 've choosen a [-1,-1], [1,1] square and ball of radius 1 to do it. i wrote something like this: with(Randomtools): k:=1000 Generate(list(rational(range=-1..1)+I*rational(range(-1..1),k)): map(abs,%): select(verify,%,1,'truefalse'('less_than')): evalf(nops(%)*4/k) the result is ok (3.14 in the first try ;) ), but I wanted to do a little "upgrade" and have written a little shorter formula: (now doing "abs" is not necessary) with(Randomtools): k:=1000
Page 1 of 1