Bruce Wayner wrote: > OR like this one >> Example: > > Vehicle A took 30 seconds to transfer 1 passenger to the second city > Vehicle B took 25 seconds to transfer 2 passenger to the second city > Vehicle C took 45 seconds to transfer 3 passenger to the second city > Vehicle D took 24 seconds to transfer 4 passenger to the second city > Vehicle E took 43 seconds to transfer 40 passenger to the second city That's a good start, although the question says a vehicle takes between 50 and 70 seconds to get from A to B, and those values are less than 50. You need to work out a departure time for each vehicle - which will be related to the departure time of the previous vehicle - and the arrival time, which is the start time plus the transit time. You also need to pick the number of passengers for each vehicle at random, since that's what the question asks for (the way I read it anyway). For example, you can pick a random number between 0 and 9. If it's 0 or 1 then the vehicle has 1 passenger; if it's 2 or 3 or 4 then it has 2 passengers; and so on. That gives you them in the right proportions. > Vehicle A took 20 seconds to travel back to the first city > Vehicle B took 35 seconds to travel back to the first city > Vehicle C took 50 seconds to travel back to the first city > Vehicle D took 34 seconds to travel back to the first city > Vehicle E took 45 seconds to travel back to the first city The way I read the question, I saw nothing about travelling back to the first city. It asks for "A simulation process of the movement of vehicles from one point to another" Of course you're free to try variants or different interpretations of the question, or you may have additional information which clarifies the problem. -- Posted via http://www.ruby-forum.com/.