Topic: Probability Algorithm/Function
So ....need some help with a thing at work.
What I'm trying to do, is have a specific event or variable, affect the probability of a result set. Anyone know a good way to do this?
So, e.g:
Probability of Event 1 = 50%
Probability of Event 2 = 30%
Probability of Event 3 = 20%
Now in practical terms, what I do currently is generate a random number from 1 (min) to 1000 (max). So I define the range of:
Event 1 = 1 - 500
Event 2 = 501 - 800
Event 3 = 801 - 1000
(obviously based on the percentages above).
That's all the easy part above (or am i doing it a complicated way?) to just generate the random event.
Now, what I want to do, is have a factor, that says, increase the probability of Event 1 happening (say to 60%). So now my result array, if i previously define to be
[1,500,800,1000] i want to be something like
[1,600,x,1000]
Question is, how shall I effect what x changes to accordingly? Or rephrase to be simpler, How do I make the probability of Event 2 and Event 3 to adjust?
I haven't quite figured out how to change the probability of Event 1 either (e.g. is it just a straight up 10%, or will it be a percentage of 50% or what exactly)....
I'm probably over complicating this ...but yea, feel free to help out ![]()