Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
Goal => 5500
1 2 3 4 5 6 7 8 9 10
1 1000 250.00 437.50 765.63 1339.84 2344.73 586.18 1025.82 256.45 64.11
2 1000 250.00 437.50 109.38 191.41 334.96 586.18 1025.82 1795.18 448.80
3 1000 250.00 62.50 109.38 27.34 6.84 6.84 6.84 6.84 6.84
4 1000 250.00 437.50 109.38 27.34 47.85 83.74 20.94 36.64 9.16
5 1000 250.00 62.50 15.63 3.91 3.91 3.91 3.91 3.91 3.91
6 1000 250.00 62.50 15.63 27.34 47.85 83.74 146.55 36.64 9.16
7 1000 1750.00 3062.50 5359.38 1339.84 334.96 586.18 1025.82 1795.18 448.80
8 1000 1750.00 3062.50 765.63 191.41 334.96 586.18 1025.82 1795.18 3141.57
9 1000 250.00 437.50 109.38 191.41 47.85 83.74 20.94 36.64 64.11
10 1000 1750.00 437.50 765.63 1339.84 2344.73 586.18 1025.82 256.45 64.11
CREATE OR REPLACE PACKAGE roulette
IS
--https://www.experts-exchange.com/questions/27386172/Roulette-strategy-probability-question.html
FUNCTION play_it_out(
p_bankroll IN NUMBER,
p_goal IN NUMBER,
p_wager_ratio IN NUMBER,
p_min_bet IN NUMBER
)
RETURN VARCHAR2;
FUNCTION run_scenario(
p_bankroll IN NUMBER DEFAULT 1000,
p_goal IN NUMBER DEFAULT 5500,
p_wager_ratio IN NUMBER DEFAULT 0.75,
p_min_bet IN NUMBER DEFAULT 10,
p_iterations IN INTEGER DEFAULT 100
)
RETURN NUMBER;
END;
CREATE OR REPLACE PACKAGE BODY roulette
IS
--https://www.experts-exchange.com/questions/27386172/Roulette-strategy-probability-question.html
FUNCTION play_it_out(
p_bankroll IN NUMBER,
p_goal IN NUMBER,
p_wager_ratio IN NUMBER,
p_min_bet IN NUMBER
)
RETURN VARCHAR2
IS
v_money NUMBER := p_bankroll;
BEGIN
WHILE v_money >= p_min_bet AND v_money < p_goal
LOOP
v_money :=
v_money
+ CASE
WHEN DBMS_RANDOM.VALUE <= 18 / 38 THEN v_money * p_wager_ratio
ELSE v_money * -p_wager_ratio
END;
END LOOP;
RETURN CASE WHEN v_money >= p_goal THEN 'Win!' ELSE 'Lose!' END;
END;
FUNCTION run_scenario(
p_bankroll IN NUMBER DEFAULT 1000,
p_goal IN NUMBER DEFAULT 5500,
p_wager_ratio IN NUMBER DEFAULT 0.75,
p_min_bet IN NUMBER DEFAULT 10,
p_iterations IN INTEGER DEFAULT 100
)
RETURN NUMBER
IS
v_win_count INTEGER := 0;
BEGIN
FOR i IN 1 .. p_iterations
LOOP
IF play_it_out(
p_bankroll,
p_goal,
p_wager_ratio,
p_min_bet
) = 'Win!'
THEN
v_win_count := v_win_count + 1;
END IF;
END LOOP;
RETURN v_win_count / p_iterations;
END;
END;
And what are the red/black/green odds?
And how do you want to deal with minimum bets and rounding?
Roulette is a pretty fair game. You can come up with a reasonable answer.