JavaDuke
JavaDuke
  • Threads: 1
  • Posts: 3
Joined: Aug 28, 2014
August 28th, 2014 at 10:33:29 AM permalink
I have a question about how to calculate House Edge in a blackjack game. I wrote a Java program to simulate playing X number of hands based on various Blackjack rules and I am trying to confirm that the House Edge outputted by my software matches what I am seeing online for those rules.

If I run, say, a million simulations, and I am keeping track of the total amount bet and total amount won, would the house edge be:
1 - (TotalWon / TotalBet)

Example:
Total Bet: $14,665,297.50 - Total Won: $16,464,007.50
Would the House Edge be "1 - (16464007.50 / 14665297.50)" = -12.26508% (which would be a player edge, since the amount is less than 0)

Or is that totally wrong? I have also heard that you should not include splits, double downs, or insurance in the Total Bet but should include winnings from those moves in the Total Won. Why is that? Wouldn't that make the calculated edge better than it is in real life?

Any thoughts would be greatly appreciated. Thanks for your help!
AxiomOfChoice
AxiomOfChoice
  • Threads: 32
  • Posts: 5761
Joined: Sep 12, 2012
August 28th, 2014 at 10:52:50 AM permalink
Quote: JavaDuke

I have a question about how to calculate House Edge in a blackjack game. I wrote a Java program to simulate playing X number of hands based on various Blackjack rules and I am trying to confirm that the House Edge outputted by my software matches what I am seeing online for those rules.

If I run, say, a million simulations, and I am keeping track of the total amount bet and total amount won, would the house edge be:
1 - (TotalWon / TotalBet)

Example:
Total Bet: $14,665,297.50 - Total Won: $16,464,007.50
Would the House Edge be "1 - (16464007.50 / 14665297.50)" = -12.26508% (which would be a player edge, since the amount is less than 0)

Or is that totally wrong? I have also heard that you should not include splits, double downs, or insurance in the Total Bet but should include winnings from those moves in the Total Won. Why is that? Wouldn't that make the calculated edge better than it is in real life?

Any thoughts would be greatly appreciated. Thanks for your help!



"House edge" is defined as the amount won or lost per initial bet.

This definition is useful for many things. For example, it allows you to determine how much you can expect to win or lose per hand, by just multiplying by your initial bet. The fact that you sometimes risk more by splitting or doubling doesn't enter into the calculation.
JavaDuke
JavaDuke
  • Threads: 1
  • Posts: 3
Joined: Aug 28, 2014
August 28th, 2014 at 1:18:00 PM permalink
Thanks, that explanation is helpful and I was able to get my stats in-line with what I am seeing online within 0.15%, which is good enough for now. As far as the equation, is this OK for House edge? Thanks.

1 - (TotalWon / TotalBet)

TotalWon includes all winnings but TotalBet only includes a summation of the initial bets (double down, splits, and insurance are not included).
AxiomOfChoice
AxiomOfChoice
  • Threads: 32
  • Posts: 5761
Joined: Sep 12, 2012
August 28th, 2014 at 1:48:48 PM permalink
Quote: JavaDuke

Thanks, that explanation is helpful and I was able to get my stats in-line with what I am seeing online within 0.15%, which is good enough for now. As far as the equation, is this OK for House edge? Thanks.

1 - (TotalWon / TotalBet)

TotalWon includes all winnings but TotalBet only includes a summation of the initial bets (double down, splits, and insurance are not included).



Edit: no, that's wrong.

Why are you subtracting from 1?

If you lose $10 over $1000 of action, that is a house edge of 1% (10 / 1000), not 99% (1 - 10/1000)
JavaDuke
JavaDuke
  • Threads: 1
  • Posts: 3
Joined: Aug 28, 2014
August 28th, 2014 at 2:09:53 PM permalink
Oh, OK. So I think you are saying house edge is really:

TotalLost / TotalBet

I was subtracting from 1 because I was using TotalWon instead of TotalLost. That makes sense. Thanks.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
August 28th, 2014 at 2:14:05 PM permalink
The house edge would be TotalLost / TotalInitialBet.
The element of risk would be TotalLost / TotalBet.

This is because the house edge is typically defined as the loss relative to the initial wager, not the total wager which would include splits and doubles.
AxiomOfChoice
AxiomOfChoice
  • Threads: 32
  • Posts: 5761
Joined: Sep 12, 2012
August 28th, 2014 at 2:28:43 PM permalink
Quote: JavaDuke

I was subtracting from 1 because I was using TotalWon instead of TotalLost. That makes sense. Thanks.



I think that's still wrong. If you use total winnings, and lose $10 on $1000 of action, then you get -10 / 1000 = -1%. 1 - (-1%) = 101%, which is wrong. You just want to negate the number (multiply by -1) to go from winnings to losses.
  • Jump to: