Random - Probability

Hi, I am think about the probability of a number in a restricted area.
psydo-code:

float result //in a certain range (maybe between 10 and 300 (doesn't matter)) the number that I want to produce
float value // between 0 1: It says, if the result is rather big oder little

//at the moment I using:
int x = rand.nextInt(maxX - minX + 1) + minX; //but that's completely random (yes I know that randoms aren't really random but we won't care about that)

I thought about multiplying it with another random but I don’t know how I put the “value” in it, because I would like to have a linear change of the highest probability.
thx for help,

Let me try to explain it with an example: result should be between 10 and 100 if value is 0.01; the result probably is rather 10, 11, 12 (little results) if value is 0.25; the result probably is rather 25, 26, 27 (bigger little results) if value is 0.5; the result probably is rather 49, 50, 51 (medium results) if value is 0.75; the result probably is rather 74, 75, 76 (bigger medium results) if value is 0.99; the result probably is rather 98, 99, 100 (big results)

I would like to set the expectancy of the result with “value”

best regards

Are you thinking of the [.code][./code] tags? (Without the dots ;D) Like so:


float result //in a certain range (maybe between 10 and 300 (doesn't matter)) the number that I want to produce
float value // between 0 1: It says, if the result is rather big oder little

//at the moment I using:
int x = rand.nextInt(maxX - minX + 1) + minX; //but that's completely random (yes I know that randoms aren't really random but we won't care about that)

Wait, I don’t actually understand your question. I know you are going for probability (there is actually an equation for it), but what exactly are you trying to find out?

@Master thx, it was to late, my brain was already in bed ;D
@ctomni231
Let me try to explain it with an example:
result should be between 10 and 100
if value is 0.01; the result probably is rather 10, 11, 12 (little results)
if value is 0.25; the result probably is rather 25, 26, 27 (bigger little results)
if value is 0.5; the result probably is rather 49, 50, 51 (medium results)
if value is 0.75; the result probably is rather 74, 75, 76 (bigger medium results)
if value is 0.99; the result probably is rather 98, 99, 100 (big results)

I would like to set the expectancy of the result with “value”

Hope it’s now intelligible
best regards