1. Devise an algorithm to generate uniformly distributed points on the surface of a sphere (i.e., so that no area has a higher expected concentration than any other of the same size). Positions can be referenced by latitude and longitude.
2. Say an event happens at 60 times per hour in a Poisson distribution (say customer arrivals in a store), so averaging also once per minute. Devise an algorithm to generate realistic arrival times for a one-hour period.
Note: Assume what's available is a uniformly distributed random real number generator on the interval (0,1).
The parameter lambda of the Poisson distribution gives a probability distribution for the number of occurrences per unit time.
Use a cumulative distribution to map an interval x=(0,1) to the number of occurrences n.
Once you know how many occurrences there are, you can just randomly distribute each to the overall time interval. Arrival time a(i)=(0,60) for each i from 1 to n.
https://towardsdatascience.com/the-poisson-distribution-and-poisson-process-explained-4e2cb17d459
You can use a uniform distribution to map to simulate any probability distribution.
|
Posted by Jer
on 2021-06-21 09:37:03 |