Re: [WP-34S] RAN# Lorentz Contraction Monte Carlo Message #59 Posted by Valentin Albillo on 30 May 2012, 6:26 p.m., in response to message #58 by Chris Tvergard
Quote:
The interesting fact being that if MC takes 100,000 points and sum up the tiny dx wide rectangles in random but evenly spread order, that is somewhat identical to say an ordered Romberg or similar summation. Since the order of addends is immaterial to the summation value we are doing the exact same thing. Am I correct?
I don't think so. There are perfectly obvious mathematical reasons why this isn't the case but the mere empirical fact that you can get an approximation to the integral of a run-of-the-mill f(x) to 10 or 12 decimal places using Romberg and a few hundred to a few thousand function evaluations while on the other hand some 10,000,000,000 MC evaluations would be needed to get you about 5 correct decimal places should be more than enough to shed some serious doubt on your 'interesting fact'.
Just for instance, let's demonstrate with ol'trusty HP-71B:
(the correct integral is I = 0.8442212060827432080689466565208005086522471127730390482171256577045...)
10 SUB MCINTEG(A,B,N,F$,T) @ S=0 @ R=B-A @ RANDOMIZE 1
20 FOR I=1 TO N @ X=RND*R+A @ S=S+VAL(F$) @ NEXT I @ T=S*R/N @ END SUB
>SETTIME 0 @ I=INTEGRAL(0.5,1.7,0,SIN(IVAR^2)) @ DISP I,TIME
.844221206082 .16
>SETTIME 0 @ CALL MCINTEG(0.5,1.7,1E4,"SIN(X^2)",I) @ DISP I,TIME
.842813335819 5.68
>SETTIME 0 @ CALL MCINTEG(0.5,1.7,1E6,"SIN(X^2)",I) @ DISP I,TIME
.844172047994 568.31
Regards.
V.
|