Bitcoin Forum

Economy => Gambling discussion => Topic started by: PimpingSincePimping on August 03, 2016, 05:30:08 PM



Title: The houses Kelly Criteria?
Post by: PimpingSincePimping on August 03, 2016, 05:30:08 PM
So I have been wondering,

In the case of being the house with a bankroll, how do you calculate what the maximum profit a user can make in a single bet via the Kelly Criteria?

Also do all casino/dice sites use this?

Please only comment if you know for sure.

Thanks



Title: Re: The houses Kelly Criteria?
Post by: RHavar on August 03, 2016, 05:56:40 PM
In the case of a two-outcome bet, it's trivial.

From the houses perspective: Get the expected value of the bet, divide by the most amount of money you can make from that bet (the lose outcome from the player perspective). Then multiply that by your bankroll, and that is the most amount of money you should risk.


It's *significantly* more complex for multi-outcome bets (e.g. slot machines, plinko etc.)


As for if most casinos do it, that's a strong no. Most bitcoin casino owners are lacking in the maths department, I'm aware of 5+ casinos misunderstanding the kelly and using it wrongly. I can only think of just-dice.com which actually does everything properly, but it's not even a bitcoin casino :(


Title: Re: The houses Kelly Criteria?
Post by: PimpingSincePimping on August 03, 2016, 06:15:29 PM
In the case of a two-outcome bet, it's trivial.

From the houses perspective: Get the expected value of the bet, divide by the most amount of money you can make from that bet (the lose outcome from the player perspective). Then multiply that by your bankroll, and that is the most amount of money you should risk.


It's *significantly* more complex for multi-outcome bets (e.g. slot machines, plinko etc.)


As for if most casinos do it, that's a strong no. Most bitcoin casino owners are lacking in the maths department, I'm aware of 5+ casinos misunderstanding the kelly and using it wrongly. I can only think of just-dice.com which actually does everything properly, but it's not even a bitcoin casino :(

Hey thanks for your quick answer :)

Can you explain this a bit more sorry but it didn't quite sink in? (newbie)

Get the expected value of the bet

Right now from what you've said my understanding is:

(??? / playerBet) * houseBR

Is the "expected value" suppose to be what the player would stand to profit?

As for if most casinos do it, that's a strong no. Most bitcoin casino owners are lacking in the maths department, I'm aware of 5+ casinos misunderstanding the kelly and using it wrongly. I can only think of just-dice.com which actually does everything properly, but it's not even a bitcoin casino :(

That's unfortunate that they don't try and understand the math before opening a gambling site, lol. Just-Dice is the golden egg when it comes to doing things right. Well done to them.


Title: Re: The houses Kelly Criteria?
Post by: DarkStar_ on August 03, 2016, 06:26:29 PM
Can you explain this a bit more sorry but it didn't quite sink in? (newbie)

Get the expected value of the bet

Right now from what you've said my understanding is:

(??? / playerBet) * houseBR

Is the "expected value" suppose to be what the player would stand to profit?
The expected value is the profit the house can expect to for each bet. A 1 BTC bet on dice with a 1% house edge has a expected value of 0.99BTC to the player, so the expected value to the house is 1.01BTC(?). I might be wrong about the EV for the house in that situation, since I haven't seen it shown anywhere. (granted, no sites really have a reason to show it)

Edit: Win chances have no affect on the EV. A house edge of 1% means an EV of 1% (of the players bet, for the casino)


Title: Re: The houses Kelly Criteria?
Post by: PimpingSincePimping on August 03, 2016, 06:47:01 PM
Can you explain this a bit more sorry but it didn't quite sink in? (newbie)

Get the expected value of the bet

Right now from what you've said my understanding is:

(??? / playerBet) * houseBR

Is the "expected value" suppose to be what the player would stand to profit?
The expected value is the profit the house can expect to for each bet. A 1 BTC bet on dice with a 1% house edge has a expected value of 0.99BTC to the player, so the expected value to the house is 1.01BTC(?). I might be wrong about the EV for the house in that situation, since I haven't seen it shown anywhere. (granted, no sites really have a reason to show it)

Shouldn't the probability of the houses win/loss be accounted for? It seems to be ignored here - for example when a user bets 2x on a 1% edge its 49.50% they win, therefore 49.50% the house loses.

From what I've understood so far based on whats been said, if there's a bank roll of 100 BTC, and a person bets 5 BTC with a house edge of 1%
Code:
EV = 5 * (0.01) = 0.05
risk = (0.05/5) * 100 = 1

therefore we would consider this an invalid bet because risk < persons bet.

but suppose they bet 1 BTC instead,
Code:
EV = 1 * (0.01) = 0.01
risk = (0.01/1) * 100 = 1

this is valid since risk >= persons bet?

but to me it seems like this could be generalized to risk = edge * BR since EV/playerBet = edge


Title: Re: The houses Kelly Criteria?
Post by: RHavar on August 03, 2016, 08:05:09 PM
Can you explain this a bit more sorry but it didn't quite sink in? (newbie)

Get the expected value of the bet

Right now from what you've said my understanding is:

(??? / playerBet) * houseBR

Is the "expected value" suppose to be what the player would stand to profit?
The expected value is the profit the house can expect to for each bet. A 1 BTC bet on dice with a 1% house edge has a expected value of 0.99BTC to the player, so the expected value to the house is 1.01BTC(?). I might be wrong about the EV for the house in that situation, since I haven't seen it shown anywhere. (granted, no sites really have a reason to show it)

Your explanation is right, but numbers are wrong. The EV is indeed the expected profit, but a player wouldn't have an expected profit of 0.99 BTC, but rather an expected profit of -0.01. And from the houses perspective, they have an expected profit of 0.01 btc for each one of these bets.

 The EV is simply calculated:

Code:
SUM OF (   probability * profit)  for each possible outcome

So taking a 1 BTC bet on a 1% house edge game doing 2x, from the players perspective:


49.5% (chance of winning)  * 1 (profit if win) + 50.5 (chance of losing) * -1  (profit if lose) =

0.495 - 50.5 = -0.01

In other words, the players have an expected value of -0.01  (over an infinite amount of bets, players will lose an average of 0.01 BTC per bet). Doing it from the houses perspective on the other hand will yield and EV of 0.01  (over an infinite amount of bets, their average win will be 0.01 per bet).



Title: Re: The houses Kelly Criteria?
Post by: RHavar on August 03, 2016, 08:08:34 PM
but to me it seems like this could be generalized to risk = edge * BR since EV/playerBet = edge

That's not a perfect generalization, but holds assuming:
 1) When a bet has two outcomes (win, lose)
 2) The lose outcome results in you losing your entire wager  (e.g. Dice)


My version is slightly more general, because it doesn't assume on 2)


Title: Re: The houses Kelly Criteria?
Post by: RHavar on August 03, 2016, 08:12:05 PM
Is the "expected value" suppose to be what the player would stand to profit?


It's the "average" profit over an infinite amount of bets. Full details: https://en.wikipedia.org/wiki/Expected_value

Assuming you're running a sane casino, the EV from players perspective should be <0, and the house EV is always * -1 the players EV.


Title: Re: The houses Kelly Criteria?
Post by: PimpingSincePimping on August 03, 2016, 08:23:19 PM
Thank you very much once again for taking your time to explain this to me, so lastly, for clarification (I've probably over complicated things here but):

Code:
// note: 
// mult - is the odds the user is playing with, i.e. 2x is 1:1
// bet - is the users bet
// bankroll - self explanatory
// edge - house edge, 1.01 in this case for 1%

            var q = 1.00 / (mult * edge); // chance of house losing
            var p = 1.00 - q; // chance of house winning
            var house_bet = bet * (mult - 1);

            var ev = (p * bet) + (q * -house_bet);
            return (ev / bet) * bankroll;

What is done then with the returned value (ev / bet) * bankroll to ensure that the bet is valid and meets the kelly criteria? Is it that the server then needs to ensure (ev / bet) * bankroll > house_bet


Title: Re: The houses Kelly Criteria?
Post by: RHavar on August 03, 2016, 09:05:54 PM
Thank you very much once again for taking your time to explain this to me, so lastly, for clarification (I've probably over complicated things here but):

Yeah you are, considerably. I didn't checking your code, but "edge" is already defined as  "ev / wager" so you can just multiple that by the house bankroll to figure out the most you should be risking each bet. (assuming when a player loses, he loses his entire wager).

e.g. If you're running a game that has a 1% house edge, the kelly would say your optimal bankroll growth is achieved by risking up to 1% of your bankroll.


(Where many casinos screw up, is they don't take remove commissions from the EV. So say they charge investors 50% of the house edge each bet, risking 1% of the bankroll with a 1% house edge bet actually is more like ~2x the kelly)


Title: Re: The houses Kelly Criteria?
Post by: DarkStar_ on August 04, 2016, 01:03:27 AM
Your explanation is right, but numbers are wrong. The EV is indeed the expected profit, but a player wouldn't have an expected profit of 0.99 BTC, but rather an expected profit of -0.01. And from the houses perspective, they have an expected profit of 0.01 btc for each one of these bets.
So EV = expected profit? I mostly understand your post, except for that part, since I always thought that EV = Expected Value. I think that the player's expect value of 0.99BTC is correct though, but you used expected profit which confused me. The reason I said the EV was 0.99BTC was because of what I see on moneypot:
https://i.imgur.com/TCGPsf2.png


Title: Re: The houses Kelly Criteria?
Post by: RHavar on August 04, 2016, 01:08:22 AM
Expected Value is indeed the same as Expected Profit.



Actually, I'm the one who originally wrote that table for MoneyPot showing the "Expected Value" so I'm to blame for the misunderstanding. The page is correct, just confusing. It's showing the expected value of that *one* payout being 9.9 bits. But there's a second payout (the lose payout, with prob of 50.5) which has an EV of -10 bits.

So that's why at the bottom of your screenshot it shows: "Total Expected value: -0.1 bits"


 ;D


Title: Re: The houses Kelly Criteria?
Post by: ndnh on August 04, 2016, 02:20:33 PM
Your explanation is right, but numbers are wrong. The EV is indeed the expected profit, but a player wouldn't have an expected profit of 0.99 BTC, but rather an expected profit of -0.01. And from the houses perspective, they have an expected profit of 0.01 btc for each one of these bets.
So EV = expected profit? I mostly understand your post, except for that part, since I always thought that EV = Expected Value. I think that the player's expect value of 0.99BTC is correct though, but you used expected profit which confused me. The reason I said the EV was 0.99BTC was because of what I see on moneypot:
https://i.imgur.com/TCGPsf2.png


I understand why there is that confusion. (I am sure you understand the logic. Just the terms are confusing.)

You are betting 1BTC, and your expected return for the bet after making the bet is 0.99BTC. The expected value of making the bet is -0.01BTC.
The bet is worth -0.01BTC to you and 0.01BTC to the house.

So for every 1BTC bet you make, the player loses 0.01 and the house wins 0.01. Theoretically.

While calculating the Expected value of the bet, we cannot ignore the risked amount.


Title: Re: The houses Kelly Criteria?
Post by: ndnh on August 04, 2016, 02:41:49 PM
From the houses perspective: Get the expected value of the bet, divide by the most amount of money you can make from that bet (the lose outcome from the player perspective). Then multiply that by your bankroll, and that is the most amount of money you should risk.

(??? / playerBet) * houseBR

Okay, so it comes to

EV / Max bet * Your bankroll = Max amount you should risk


Can someone provide an example?


Title: Re: The houses Kelly Criteria?
Post by: RHavar on August 04, 2016, 05:15:31 PM
From the houses perspective: Get the expected value of the bet, divide by the most amount of money you can make from that bet (the lose outcome from the player perspective). Then multiply that by your bankroll, and that is the most amount of money you should risk.

(??? / playerBet) * houseBR

Okay, so it comes to

EV / Max bet * Your bankroll = Max amount you should risk


Can someone provide an example?

Max bet doesn't directly fit in. The kelly will tell you the most you should risk per bet. E.g. Imagine I run a normal (1% HE) dice site, with a 1k bitcoin bankroll. The kelly says risking 1% per roll leads to optimal bankroll growth, which is 10 BTC. So that is the same as 1 BTC @ 11x  ... or   100 @ 1.1 x.  So a casino with a fixed house edge, should put limits on the max profit, not max bet.

(Sites like bustabit have a dynamic house edge, so it's not so simple. It has a limit both on max bet (1 BTC) as well as max profit)


Title: Re: The houses Kelly Criteria?
Post by: ndnh on August 05, 2016, 06:14:30 AM
From the houses perspective: Get the expected value of the bet, divide by the most amount of money you can make from that bet (the lose outcome from the player perspective). Then multiply that by your bankroll, and that is the most amount of money you should risk.

(??? / playerBet) * houseBR

Okay, so it comes to

EV / Max bet * Your bankroll = Max amount you should risk


Can someone provide an example?

Max bet doesn't directly fit in. The kelly will tell you the most you should risk per bet. E.g. Imagine I run a normal (1% HE) dice site, with a 1k bitcoin bankroll. The kelly says risking 1% per roll leads to optimal bankroll growth, which is 10 BTC. So that is the same as 1 BTC @ 11x  ... or   100 @ 1.1 x.  So a casino with a fixed house edge, should put limits on the max profit, not max bet.

(Sites like bustabit have a dynamic house edge, so it's not so simple. It has a limit both on max bet (1 BTC) as well as max profit)


I took max win first, and with SafeDice values I got average kelly to be 2.
0.1/9.8*200 = ~2

But then I read again
Quote
the most amount of money you can make from that bet (the lose outcome from the player perspective).
and replaced max win with max bet (certainly above 10000) to get numbers that didn't make sense. ;D