用python模拟轮盘赌策略

In this article, we’re going to be looking at the popular casino game of roulette and debunking various betting strategies designed to increase your odds of walking away a profitable gambler. We will go over how to simulate each of these methods in Python, while also pointing out the key differences between their effects on your bankroll over time.

在本文中,我们将着眼于流行的轮盘赌赌场游戏,并对各种下注策略进行揭穿,这些策略旨在增加您离开获利赌徒的几率。 我们将介绍如何在Python中模拟每种方法,同时指出随着时间的推移,它们对资金的影响之间的主要区别。

So let’s dive in! In American Roulette, there are 18 red pockets, 18 black pockets, and 2 green pockets that the ball can fall into after spinning around the wheel.

因此,让我们开始吧! 在《美国轮盘》中,有18个红色口袋,18个黑色口袋和2个绿色口袋,球绕着轮子旋转后可以掉进去。

Image for post

If you win on a red or black bet, you get paid 1:1 odds, which means you win $1 for every $1 that you bet. However, if you bet on a single number, the payout improves to 35:1, so you will profit $35 for every $1 bet since there is a much lower chance of winning in this case. In this project, we are going to learn how to simulate random processes such as roulette spins and view the results of simple betting strategies on our bankroll.

如果您以红色或黑色下注,您将获得1:1赔率,这意味着您每下注$ 1可赢取$ 1。 但是,如果您下注一个数字,则赔付率将提高至35:1,因此每下注$ 1,您将获利$ 35,因为在这种情况下,获胜的机会要低得多。 在这个项目中,我们将学习如何模拟随机过程,例如轮盘旋转,以及如何在资金上查看简单的下注策略的结果。

策略1:始终为红色 (Strategy #1: Always Red)

Let’s keep this first strategy simple and say that we are going to bet $1 on red every time. Because 18 out of the 38 pockets are red, we have a 18/38 chance of winning $1, and a 20/38 chance that we lose our $1 bet.

让我们保持第一个策略简单,并说我们每次都将$ 1押在红色上。 因为38个口袋中的18个是红色的,所以我们有18/38的机会赢得$ 1,而我们有20/38的机会失去$ 1下注。

Let’s look at how we can simulate this strategy in Python:

让我们看一下如何在Python中模拟这种策略:

We are going to set our bankroll at $100, and then create a list of possible outcomes by making a list with 18 reds, 18 blacks, and 2 greens. Next we are going to use the random library to pick a random item from this list simulating a roulette spin, and if

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值