一 最近开发的go程序,用于计算21点游戏,庄家和闲家的胜率统计
- 运行环境:vscode/ubuntu,32G内存
- 运行条件:Blackjack基础策略[6副牌,庄家17点stand,闲家可以double,可以surrender,split之后,可以继续hit],参看文档末尾的策略图
- 开启10个goroutine,每个goroutine循环10000次,也就是一共运行50万次
- 每循环1次就是,牌靴中有6副牌的游戏流程[去掉大小鬼,每副牌52张],剩余20张的时候,一靴牌结束
- 最小下注10,最大下注1000,原始筹码10000
- 投注策略为固定筹码
- 运行时间:2023-07-18 20:59:21
- 运行时长:9:37(9分37秒)
- 运行结果:
sum_deal_times:27501899 运行总发牌次数
sum_hands:28193145 运行总手数
sum_bets:315190090 闲家总下注
sum_profit:-6306785.00 闲家盈利
hands_per_shoe:56.39 每靴牌包含的手数
profit_per_shoe:-12.6136 每靴牌闲家盈利
profit_per_hand:-0.2237 闲家每手盈利
sum_profit/sum_bet:-0.020009 每下注1个筹码的盈利
sum_player_lose_hands:14311078 闲家输的手数
sum_player_push_hands:2224817 闲家和的手数
sum_player_win_hands:11657250 闲家赢的手数
player_lose_hands_ratio:0.5076 闲家输的概率【庄家赢的概率,胜率】
player_push_hands_ratio:0.0789 闲家和的概率【庄家和的概率】
player_win_hands_ratio:0.4135 闲家赢的概率【庄家输的概率】
二 运行结果解释
一共运行了2819.3145万手牌
庄家的胜率是50.76%,和的概率为7.89%,闲家胜率为41.35%
方便记忆的话,可以简单记忆为庄家51%,闲家41%,和8%
三 网络上也有相关的数据可以比对,比如下面的链接
https://www.onlinegambling.com/blackjack/odds/
Odds of Winning Blackjack
The odds of winning at blackjack can be as high as 42.22%. However, this does not mean the house wins 57.78% of the time. That’s because there is a third possible result - a push. An average of 8.48% of blackjack games end in a push, leaving the probability of a loss at 49.10%.
四 golong程序使用svg输出的基本策略图
--the end