From: Jean-Julien Fleck Date: 2010-08-17T23:41:58+09:00 Subject: Re: can i do this in ruby? a simulation process 2010/8/17 Andrew Wagner : > Well, it may be interesting, but not in terms of the question originally > asked. Actually, I'm not sure what you could ask to make it interesting if > buses are going in both directions, as I would expect the average result to > be no change in the number of people currently in either city. Don't be fooled by the apparent simplicity of the question :o) Random walks have many many interesting behaviors, one of which is that they can go as far as you like from the origin in a time you can estimate (from a probabilistic viewpoint). The most simple realisation is the 1D random walk: - choose an origin - flip a coin to decide if you should go right or left - go there - flip a coin... - etc. For sure, as the problem is symetrical on right and left, the mean value of the displacement is 0. But if you rather ask yourself the question: "how far can I go from the origin" (either on the right or on the left), then you can estimate how much time you need to achieve this goal within a given probability. In the OP problem, it would read: how much time do you need to transfer 500 people either from A to B or from B to A with the given set of rules. Cheers, -- JJ Fleck PCSI1 Lycée Kléber