Sup Veeky Forums

Sup Veeky Forums,
I usually hang out on /g/ but this one fits this board better.

I'm working on a gambling type website and I need some help with calculating win probabilities fluidly.

I want to average 10% hold.

Given a random number between let's say 0 and 100, I want the equation to return me a win value with the constraint being: the sum of all winnings times their probability must be 0.9 as to give me 10% hold.

So, winning nothing, or less than 1 would have to be more likely than winning 100.

I imagine the curve must look something like pic related, but I wonder about how to math this.

Thank you

correction.

What I need looks more like this

With

f(0)=-1

and [ sum n=0; 100 | f(n) ] = 0.9

I want a share of your revenues from that website.

You sure?

Your OP makes it sound like you want something like this.

I'm not sure..

I want the function to return the number I have to multiply the bet with.

User bets 10
Function says 0.5
User gets 5

with the AVERAGE value being 0.9 over the defined area of random inputs

stop helping for free you fucking faggot.
why do you think stemfags never make money? Because they're so retarded they give their help for free to people who actually can make money.
They studied what they liked, and they use you to do what they don't know how to do.

Is "value" the number the user gets or what the function says?

Sorry.
The average value returned by the function should be 0.9 (In the space between x=0 and a defined upper border).
This way there's a 10% hold.

user_bet * winfunction ( rnd_value ) would be the calculation for the winnings. In this case, the average should be user_bet * 0.9.

My second picture is crap.

Stop wasting your time and go make money if that's what you care about. It's not like I was going to spend millions in the stem field if no one helped me here.

OK and presumably there should be some circumstances that users get a net positive return? Otherwise no one would take the bet.

i.e. some values of the function should be more than 1

Exactly.
Big chance to get a bit less than your money (1)