50/50 Odds


So now we've got 3 strategies, and we've discovered their survival rates and profit potentials. Looks like the doubler is the best option, and we've discovered ~1.75 to be the optimal doubling amount. That said, 1.75 is optimal it seems in accordance to 100 wagers total, but we can also test a range of total wagers per "session" to see if we can optimize further.

That said, we're clearly heading for a strategy that plays for 'x', 100 for now, wagers before resetting and starting over for cumulative gain.

Due to this, and also to get better information, it would be wise to not only account for survival rate and profit % chance, but actually account for overall profit.

So, say we test 1,000 samples, with a losing multiple of 1.75, and a starting capital of 10,000 ea, then we really ought to tally up everyone's total funds at the very end. It would need to be greater than 10,000 multipled by 1,000, or 10,000 starting funds times the 1,000 players.

If the funds are greater, then we have located a seemingly good strategy, especially if we test it against something like 1 million, 10 million, or 100 million samples.

First things first, we need to figure out how much money we have.

I suggest you save your old copy of code, because I am going to delete everything except for our multiple bettor function, the dice function, and some of the constant vars.



import random
import matplotlib
import matplotlib.pyplot as plt
import time

#lower_bust = 19.00
#higher_profit = 69.00

# back to 1,000
sampleSize = 1000
startingFunds = 100000
wagerSize = 100
wagerCount = 100





def rollDice():
    roll = random.randint(1,100)

    if roll <= 50:
        return False
    elif roll >= 51:
        return True



def multiple_bettor2(funds,initial_wager,wager_count,multiple):#,color):
    global ROI
    global multiple_busts
    global multiple_profits
    
    value = funds
    wager = initial_wager
    wX = []
    vY = []
    currentWager = 1
    previousWager = 'win'
    previousWagerAmount = initial_wager

    while currentWager <= wager_count:
        if previousWager == 'win':
            if rollDice():
                value += wager
                wX.append(currentWager)
                vY.append(value)
            else:
                value -= wager 
                previousWager = 'loss'
                previousWagerAmount = wager
                wX.append(currentWager)
                vY.append(value)
                if value <= 0:
                    multiple_busts += 1
                    break
        elif previousWager == 'loss':
            if rollDice():
                wager = previousWagerAmount * multiple
                if (value - wager) <= 0:
                    wager = value
                    
                value += wager
                wager = initial_wager
                previousWager = 'win'
                wX.append(currentWager)
                vY.append(value)
            else:
                wager = previousWagerAmount * multiple
                if (value - wager) <= 0:
                    wager = value
                value -= wager
                previousWager = 'loss'
                previousWagerAmount = wager
                wX.append(currentWager)
                vY.append(value)

                if value <= 0:
                    multiple_busts += 1
                    break

    
        currentWager += 1
    #print 'ending Value:',value 
    ROI += value

    #plt.plot(wX,vY)

    if value > funds:
        multiple_profits+=1  


multipleSampSize = 1000000
multiple_busts = 0.0
multiple_profits = 0.0
ROI = 0

counter = 1
while counter <= multipleSampSize:
    multiple_bettor2(startingFunds,wagerSize,wagerCount,1.75)
    counter += 1

print 'Total Amount Invested:', multipleSampSize * startingFunds
print 'Total Return:',ROI
print 'Difference:',ROI-(multipleSampSize * startingFunds)
print 'Bust Rate:',(multiple_busts/multipleSampSize)*100.00
print 'Profit Rate:',(multiple_profits/multipleSampSize)*100.00
		

The next tutorial:





  • Monte Carlo Introduction
  • Monte Carlo dice Function
  • Creating a simple Bettor
  • Plotting Results with Matpltolib
  • Martingale Strategy
  • Bettor Statistics
  • More comparison
  • Graphing Monte Carlo
  • Fixing Debt Issues
  • Analyzing Monte Carlo results
  • Using Monte Carlo to find Best multiple
  • Checking betting results
  • D'Alembert Strategy
  • 50/50 Odds
  • Analysis of D'Alembert
  • Comparing Profitability
  • Finding best D'Alembert Multiple
  • Two dimensional charting monte carlo
  • Monte Carlo Simulation and Python
  • Labouchere System for Gambling Tested