Show HN: Blackjack Probabilities
chriszieba.comA small weekend project. I love playing blackjack and have basic strategy memorized, but I've always been curious to see what the actual probabilities were for hitting, standing and doubling down. If you'd like to see the code it's available on github: https://github.com/ChrisZieba/blackjack.
Some years ago (before I gave up gambling entirely) I noted that there was one UK online casino which not only offered a reasonable game of blackjack, but would also let you "auto play" as many hands as you wanted, using basic strategy. (i.e. to automatically play what is statistically the optimum response to any given hand.) I never saw that feature offered anywhere else, presumably because players playing imperfect games means more take for the house - but even so, a thousand perfect hands of basic stategy will almost always still leave the house having had the better side of the deal, purely due to the house edge that's built into the game.
(What caused me to give up was an extremely expensive blackjack hand that started with betting $HOUSE_MAX on a hand, and getting a pair of aces. The best move is to split aces, resulting in two hands, at double the bet. And in this case, both those hands were then facing a dealer hand where basic strategy demands that you double down - so an already significant bet ended up being doubled, then doubled again. It was absolutely the right move, statistically, but didn't go my way in the end, and although I still walked away in profit, that hand is what made me think that Blackjack was something that could one day cause me a real problem if I didn't find something better to do with my time.)
When I play blackjack it's for a basic bet of $10 or $20. That way even after a few splits and double downs I'm not "betting the house". Couldn't you find a way to still enjoy gambling w/o betting thousands of dollars on a hand?
So I guess it depends on how much $HOUSE_MAX was. Around here the Indian casinos are atwitter at $100 bets. In Vegas I could be playing with a bunch of $10 players and nobody bats an eye if someone walks by and, in the middle of a deck, bets $1000 on a single hand, and then goes on his way.
Awesome! I'm actually about to begin work on creating a machine-learning blackjack-playing agent for a CS class project.
Great documentation as well. I'll definitely be referencing this.
Why? There are very efficient machine-learning-free solutions... There are even rote solutions a human can use n his own head with a bit of practice. The game is basically solved.
Right on, thanks a lot!
Awesome work! It does the calculations based on what is currently in the shoe, correct? So it should be possible to give it a custom shoe with cards removed to find the best probability for a card counter.
Thank! Yes the calculations are based on what is currently in the shoe. Setting the shoe is an easy task.