From: Jean-Julien Fleck Date: 2010-08-19T00:02:13+09:00 Subject: Re: can i do this in ruby? a simulation process 2010/8/17 Jean-Julien Fleck : > 2010/8/17 Andrew Wagner : >> Ah, I see your point. Very interesting indeed. Is it reasonable to guess >> that it would take a very, very long time in this case? > > Sure. I have no time left to play with it today, but I will try it tomorrow. > If I recall right, the mean distance from the origin of a 1D random > walk behaves like a diffusive process: it's growing like the square > root of time (with a constant factor before it). Here, there are some > complications, but I would expect it to behave quite the same: if you > know the average time to get a 50 people difference between the two > cities, it will take 10**2 = 100 times more time to get a 500 people > difference in mean. Well, in the end, it did not take too long: less than 3 hours in mean for all simulations (all done launching 5000 vehicules from each city) to reach an increase of 500 people in one of the two cities. ----- In mean, it took 8785.5 seconds to get a 500 difference. from 1000 simulations over 1000 that have been ran Median time being 6490.5 Max time: 57162.5 Min time: 746.1 Dispersion: 7413.6 ----- If you look at the distribution of the times (rw_time.pdf) you see that there are only a few (around 10%) that take a very long time (>20000s) to get to this 500 increase. I also included a typical run (rw_typical_run.pdf) of evolution of the two populations along time. Cheers, JJ PS: Thanks Bruce for this interesting problem: I'm sure my students will appreciate it in the coming year :o)