Thank you for your codes and efforts!
I think "r1 = gsl_ran_gaussian (r, mu)" and "r2 = r1+ gsl_ran_gaussian (r, mu)" should be replaced with "r1 = sqrt(1/1000)*gsl_ran_gaussian (r, mu)" and "r2 = r1+ sqrt(1/1000)*gsl_ran_gaussian (r, mu)", respectively, since you divided each process into 1000 segments.
And if the there is no points falling in interval (-0.001,0.001) during the whole process, you just assign 0 to "time" right?
So here is the problem, what should we assign to "time" when there is no points falling in interval (-0.001,0.001), 0 or 1?
My opinion, intuitively, is 0 or 1 with prob. 0.5. provided "s" is in [0,1].
[ 本帖最后由 wisesummer 于 2007-12-24 01:48 AM 编辑 ]