Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Simulating a probability, use a random number?

  1. Mar 4, 2013 #1

    I looking for some advice for a simulation. I know that when an electric car arrives at a destination there is a 70% chance that a charging point will be available. I'm building a model that models electric car journeys. When a car arrives at a destination would I simulate a random number between 0 and 1 and if it is less than 0.7 then a charging post is available or if it is greater than 0.7 then a charging post is not available. Would that make sense? I would appreciate any suggestions or comments.

    Thank you
  2. jcsd
  3. Mar 4, 2013 #2


    User Avatar
    Science Advisor

    Your description is exactly correct for the simulation.
  4. Mar 8, 2013 #3
    Hello MAthman,

    Could you perhaps explain the statistical logic/theory for simulating an event like this?

    In an other example, I know the probability that somebody will recharge an electric car is 60%. So if I generate a random number and it is less than 0.6 then the person plugs in and consumes electricity. I'm interested to know the statistical logic behind the method.

    Thanks for your time

  5. Mar 8, 2013 #4
    60% of the time somebody charges an electric car.

    60% of the time a (pseudo)-random number between 0 and 1 is less than 0.6.

    So the latter is a good simulation of the former.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook