Say I’m pseudo-randomly picking a number from 1 to 50 every second for 100 seconds, and as time goes on the number picked is more likely to be greater. How could I structure such an algorithm?
For example: after 99 seconds the probability of choosing a number closer to 50 is much more likely than choosing a number closer to 1.
Or: the number picked after 10 seconds is more likely to be greater than the number picked after 9 seconds
I have a simple solution for you. Instead of
rand(1, 50)(say this function generates uniformly random numbers 1..50) use this expression:this will still give you all the numbers 1..50. For
exp = 1, the distribution will be uniform. As you slightly increase exp (e.g. like 1.1 or so), the probability of getting larger numbers will increase. The higher the exp, the more it will increase towards 50.So you can do e.g.: