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 tongue

Re: Probability Algorithm/Function

Do you want the relation between event 2 and 3 to remain constant?

LORD HELP OREGON

Re: Probability Algorithm/Function

Ya, the ratio of them. 

So technically the factor that effects the increased probability of Event 1, only effects that Event, and then the probability of Event 2 and 3 adjust accordingly.

Re: Probability Algorithm/Function

Option B.

~*✠ ]PW[ Forever ✠*~

Re: Probability Algorithm/Function

you could also change the random number range, so that it goes from the original 1-1000 to 1-1060. And then give event 1 the spread of 1-660 or 1-600 AND the additional 1001-1060.

LORD HELP OREGON

Re: Probability Algorithm/Function

Hehe yes, that's the exact conclusion I came to while talking to Stan yesterday.

It seems like a simple way to do it.  That way probabilty in absolutely value has stayed the same for Event 2 and 3, and their relative probability has adjusted automatically.

So something like:

Event 1 = [0 to Event 1 Modified Range]
Event 2 = [Event 1 Modified Range to (Event 1 Modified Range + Event 2 Range)]
Event 3 = [New Event 2 Range to (New Event 2 Range + Event 3 Range)]

And then random number is generated between 0 and sum of all Event maxes.

Thanks smile

7

Re: Probability Algorithm/Function

hmm not sure if i understood kompletely but here's my 2 zents:

random number from 1 to 100

result:

1to50 --> event 1
51to80 --> event 2
81to100 --> event 3

if you want to inkrease the probability of event1 then, with z=inkrement

1 to 50+z --> event 1
(51+z) to [(51+z) + (100-(50+z))*0,6] --> event 2
[(51+z) + (100-(50+z))*0,6]+1 to 100 --> event 3  (or even simplier, event3 is anyother result)


I tested it with z=10, z=15 and z=20 and it works