• rrauenza (unregistered) in reply to H2
    H2:
    I wrote a brute-force-solution in perl, just for testing randomness. After 1million runs with each starting with 10$, trying to get 400$ at 5 tables, I got: »Chance in this case is: 0.203800000000001%« I should mention, that I allowed to play at multiple tables at the same time.

    Regards, H2

    I got similar results. I "played" my perl simulation until I had 10 wins ($10 bet every time, 5 table (though that doesn't matter) and allowed bets for sequences greater than ).

    $ sort < log.txt | uniq -c 5168 %%%%% 0 10 %%%%% 400

    5168 losses to 10 wins, or 0.19%

    I just realized my code stops when the bankroll is $400 even when there might be bets on the table, so I'll make a modification and try again.

  • (cs) in reply to EngleBart
    EngleBart:
    The roulettier (I am not sure what you call them)

    The word you are looking for is "croupier" (croupiere if it's a lady, plus or minus an accent.)

    Addendum (2009-08-20 12:02): The accent goes here: croupière

  • Thinker (unregistered) in reply to civild
    civild:
    Here's my enterprise-y, bug-ridden PHP code.

    http://pastie.org/588581

    It seems to lose more often than win, so I won't be trying it at the casino any time soon... (either that or php's rand() isn't the greatest)

    It's odd that you admit your code is buggy, yet think that either the system doesn;t work or PHP's rand is bodgey. If you think your code is bug-ridden, wouldn't that be the first place to look when there is unexpected behaviour?

    (For the record, I think losing more often than winning is indeed the expected behaviour, but nonetheless I thought your comments a little odd)

  • Laie Techie (unregistered)

    My mom has her own system for betting. She views it much like any other form of entertainment. She budgets x dollars for it and leaves the rest in her room's safe. She makes the smallest bet allowed and immediately pockets any winnings (doesn't "reinvest" them). When the money's gone, it's gone; she's had her fun.

  • White Foxx (unregistered)

    God everyone so negative! Of course the previous spin means nothing. Still fun to code up a little roulette program to try it though :)

  • Michael (unregistered)

    Also remember that double zero wheels are for Americans and stupid people, as it reduces your chances of winning by several degrees.

    Also, this is a fairly tame 'system' for winning at roulette. Hang around casinos long enough and you'll meet some strange people with even stranger ideas...

  • Gumpy Guss (unregistered)

    There is no need to write a program. This was figured out mathematically around 1440. You can't beat a roulette wheel with any kind of strategy. The ball has no idea what spot it landed in the last time, so previous landings have no influence on the next one.

    You would not lose or gain anything at roulette in the long run if there were no 0 and 00. Those two colorless spots are the house's edge.

  • Jarett (unregistered)

    Easiest programming challenge ever.

    function the_perch(starting_bankroll, num_tables, desired_ending_bankroll) { return 0; }

  • MHOOO (unregistered)

    Here's a common lisp version:

    (defun the-perch (starting-bankroll table-count ending-bankroll &optional (stream nil) &key (min-bet 10))
      "Simulates the perch system."
      (let ((money starting-bankroll))
               (labels ((green (x) (member x '(0 38)))
                        (black (x) (and (oddp x) (not (green x))))
                        (red (x) (and (evenp x) (not (green x))))
                        (to-color (x) (cond ((black x) 'black)
                                            ((red x) 'red)
                                            (t 'green)))
                        (gen-color () (to-color (random 39)))
                        (gambler-status () (format nil "Now I've got ~d bucks!" money))
                        (gambler-good (&optional (stream t))
                          (cond ((<= money 0)
                                 (format stream "Gambler: No more money!~%")
                                 nil)
                                ((>= money ending-bankroll)
                                 (format stream "Gambler: Reached ending bankroll of ~d bucks!~%" ending-bankroll)
                                 nil)
                                ((< money min-bet)
                                 (format stream "Gambler: Not enough money for the minimum bet of ~d bucks!~%" min-bet)
                                 nil)
                                (t t))))
                 (let ((tables (loop for i from 1 to table-count
                                  collect (let ((last nil)
                                                (count 1)
                                                (id i))
                                            (lambda(&optional (reset nil))
                                              (let ((color (gen-color)))
                                                (if (eql color last)
                                                    (incf count)
                                                    (setf count 1))
                                                (when reset
                                                  (setf count 1))
                                                (format stream "Table ~d: ~A (~d).~%" id color count)
                                                (setf last color)
                                                (list color count)))))))
                   (loop
                      (loop for table in tables
                         do (destructuring-bind (color count) (funcall table)
                              (if (= count 4)
                                  (let ((bet-on-color color)
                                        (bet-amount min-bet))
                                    (format stream "Gambler: Bet on Last Table... ~%")
                                    (when (not (gambler-good nil))
                                      (return))
                                    (if (eql bet-on-color (first (funcall table t)))
                                        (progn
                                          (setf money (+ money bet-amount))
                                          (format stream " I won! ~A~%" (gambler-status)))
                                        (progn
                                          (setf money (- money bet-amount))
                                          (format stream " I lost! ~A~%" (gambler-status))
                                          ;; we lost? Try again - if possible!
                                          (when (not (gambler-good nil))
                                            (return))
                                          (format stream "Gambler: Trying again with 150% of last bet! ~%")
                                          (when (< money (* bet-amount 1.5))
                                            (format stream " Oh Crap! Ain't got that much!~%")
                                            (return))
                                          (if (eql bet-on-color (first (funcall table t)))
                                              (progn
                                                (setf money (+ money (* bet-amount 1.5)))
                                                (format stream " I won! ~A~%" (gambler-status)))
                                              (progn
                                                (setf money (- money (* bet-amount 1.5)))
                                                (format stream " I lost! ~A~%" (gambler-status))))))))))
                      (when (not (gambler-good stream))
                        (return money)))))))
    

    Example output: CL-USER> (with-output-to-string (s) (the-perch 10 4 50 s)) "Table 1: RED (1). Table 2: RED (1). Table 3: RED (1). Table 4: BLACK (1). Table 1: BLACK (1). Table 2: RED (2). Table 3: RED (2). Table 4: RED (1). Table 1: BLACK (2). Table 2: BLACK (1). Table 3: BLACK (1). Table 4: RED (2). Table 1: RED (1). Table 2: BLACK (2). Table 3: BLACK (2). Table 4: RED (3). Table 1: BLACK (1). Table 2: RED (1). Table 3: BLACK (3). Table 4: RED (4). Gambler: Bet on Last Table... Table 4: RED (1). I won! Now I've got 20 bucks! Table 1: BLACK (2). Table 2: GREEN (1). Table 3: BLACK (4). Gambler: Bet on Last Table... Table 3: BLACK (1). I won! Now I've got 30 bucks! Table 4: BLACK (1). Table 1: BLACK (3). Table 2: BLACK (1). Table 3: RED (1). Table 4: BLACK (2). Table 1: BLACK (4). Gambler: Bet on Last Table... Table 1: RED (1). I lost! Now I've got 20 bucks! Gambler: Trying again with 150% of last bet! Table 1: RED (1). I lost! Now I've got 5.0 bucks! Table 2: BLACK (2). Table 3: BLACK (1). Table 4: BLACK (3). Gambler: Not enough money for the minimum bet of 10 bucks! "

  • rupee (unregistered)

    A friend of mine works in casinos. He says that an experienced roulette spinner can land the ball on any number that he wants and the whole game is a scam. They do it as a party trick after all of the punters get kicked out.

    So the best case is that the outcome is completely random and bad odds clean you out; and the worse case is that they play you until all of your money is gone.

  • Roman (unregistered)

    html + js with graphic. tested in IE only:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>The perch</title> </head> <body>
    Tables amount: <input type="text" id="tables_amount" value="10"/>
    Bank: <input type="text" id="start_bank" value="10"/>
    Desired bank: <input type="text" id="desired_bank" value="400"/>
    <input type="button" id="start" onclick="DrawBoards()" value="Start!"/>
    <script> var board_size = 200; var el_size = 10; var a_boards = new Array(); var amount; var s_bank; var d_bank; function getColor(el_pos) { if (el_pos == 0 || el_pos == 19) { return 0; } else { if (el_pos % 2 == 1) { return 1; } else { return -1; } } } function OperateBoard(pos) { if (s_bank == 0 || s_bank >= d_bank) { clearInterval(a_boards[pos].timeID); return; } a_boards[pos].bet = 0; if (Math.abs(a_boards[pos].lastColor) > 4) { if (a_boards[pos].lastColor > 0) a_boards[pos].bet = -1; else a_boards[pos].bet = 1; a_boards[pos].betAmount *= 1.5; a_boards[pos].betAmount = Math.floor(a_boards[pos].betAmount); if (a_boards[pos].betAmount < 10) { a_boards[pos].betAmount = 10; } s_bank -= a_boards[pos].betAmount; } var num = Math.floor(Math.random() * 34); for (var i = 0; i < 38; i++) { var el = document.getElementById("board_" + pos + "_cell_" + i); if (i == num) { el.style.borderStyle = "Solid"; } else { el.style.borderStyle = "None"; } } var color = getColor(num); var info_current = document.getElementById("info_current_" + pos); var info_bet = document.getElementById("info_bet_" + pos); if (color == 0) { a_boards[pos].lastColor = 0; } else { if (a_boards[pos].lastColor * color < 0) //diff signs { a_boards[pos].lastColor = 0; } else { a_boards[pos].lastColor += color; } } if (a_boards[pos].bet != 0) { if (color == a_boards[pos].bet) { s_bank += a_boards[pos].betAmount * 2; } else { a_boards[pos].lastColor = 0; a_boards[pos].betAmount = 10; } } info_bet.innerText = a_boards[pos].bet + " (" + a_boards[pos].betAmount + ")"; info_current.innerText = a_boards[pos].lastColor; start_bank.value = s_bank; } function AddCell(pos, el_pos) { var cell = document.createElement("
    "); cell.id = "board_" + pos + "_cell_" + el_pos; cell.style.position = "absolute"; cell.style.width = el_size + "px"; cell.style.height = el_size + "px"; cell.style.borderWidth = "2px"; cell.style.borderColor = "Blue"; cell.style.borderStyle = "None"; var angle = el_pos * 2 * Math.PI / 38; cell.style.left = board_size / 2 + Math.sin(angle) * board_size / 2 + "px"; cell.style.top = 100 + pos * board_size + (pos + 1) * 2 * el_size + board_size / 2 - 2 * el_size - Math.cos(angle) * board_size / 2 + "px"; if (el_pos == 0 || el_pos == 19) { cell.style.backgroundColor = "Green"; } else { if (el_pos % 2 == 1) { cell.style.backgroundColor = "Black"; } else { cell.style.backgroundColor = "Red"; } } return cell; } function InfoTable(pos) { var info = document.createElement("
    "); info.style.position = "absolute"; info.style.left = board_size / 2 - 40; info.style.top = 100 + pos * board_size + (pos + 1) * 2 * el_size + board_size / 2 - 40; info.innerHTML = "
    Current:0
    Bet:0
    "; return info; } function CreateBoard(pos) { var board = new Array(); board.element = document.createElement("
    "); board.element.id = "board_" + pos; board.element.style.position = "absolute"; board.element.style.left = "0px"; board.element.appendChild(InfoTable(pos)); for (var i = 0; i < 38; i++) { board.element.appendChild(AddCell(pos, i)); } return board; } function DrawBoards() { for (var i = 0; i < amount; i++) { if (boards.hasChildNodes()) { boards.removeChild(a_boards[i].element); } } amount = tables_amount.value; s_bank = start_bank.value; d_bank = desired_bank.value; for (var i = 0; i < amount; i++) { a_boards[i] = CreateBoard(i); a_boards[i].lastColor = 0; a_boards[i].bet = 0; a_boards[i].betAmount = 0; boards.appendChild(a_boards[i].element); a_boards[i].timeID = setInterval("OperateBoard(" + i + ")", 1000); } } </script>
    </body> </html>
  • anonymous (unregistered) in reply to There is so much WTF in this I don't know where to start
    The roulette table has NO MEMORY of the previous sequence of events (black or red). Read this several times till you understand this concept.

    I'll bet you're really fun at parties.

  • Meee (unregistered)

    Wow what a discovery :S

    Dude, for this you could be lucky to walk out alive. It is "ILLEGAL" to perform this trick as you are defeating the odds of gambling [unless u hit green :) ], well moving the odds in your favour kinda.

    So program or not, I want to hear stories of those who applied it and walked out with couple of grand, not a couple of hundred.

  • Mathemagician (unregistered) in reply to Sequence, it's all about the probability of the sequence....
    Sequence:
    There is so much WTF in this I don't know where to start:
    The roulette table has NO MEMORY of the previous sequence of events (black or red). Read this several times till you understand this concept.

    Randomness is not the roulette table keeping a tally of all the reds and blacks in sequence and making sure there are the same number of each (ignoring the greens which I'll get to in a minute) or a fair-looking alternation of red and black sequences.

    The sequence of random black and red is truly random - 100 black followed by 100 red is JUST AS LIKELY as RED-BLACK-RED-BLACK (repeated forever) or RRRR-BBBB-RRRR-BBBB...or any other combination.

    Each subsequent outcome is completely unaffected by the previous colour.

    Is that so? Just as likely to get 100 red in a row than RBRBRB? Ok, if you know so much about probability, then let's go to a casino. I'll bet you $1000 that you won't see 100 red in a row....

    Sure a table has no "memory" of the previous rolls, but that doesn't mean the probability of a given sequence is the same. The point is the probability of a sequence of 5 reds is more unlikely than a sequence of 4 reds. It's the sequence probability that you're working with here, not the probability of a single given roll.

    The probability of 5 reds in a row is more unlikely than 4 because you have one extra spin The probability of 5 reds in a row is identical to the probability of 4 reds and 1 black in a row.

    Different length sequences will (of course) have different probabilities of occurring.

    The point is not the likelihood of 5 in a row, it is the likelihood of 5 in a row given that we already have four of them .
    Even if we before any spins, the probability of RRRRR is the same as RRRRB - therefore betting on the last colour still has the odds only of that last colour. History is irrelevant, but by all means if you believe that it makes a difference, please, please come to my casino and always bet against the streak!!

  • George (unregistered) in reply to Anonymous Coward
    Anonymous Coward:
    People are saying that roulette can't be beaten, that the House always wins. This is not true. There is at least one way to beat the House that doesn't involving rigging the wheel or punching the croupier when you lose or the like. And that is to abuse physics. In a casino, there is a physical wheel, after all, and you can certainly predict where the ball will land. This only applies if the casino lets people continue to place bets after the wheel is already spinning, of course, since the starting location and how hard the croupier pulls the wheel varies each game.

    Some enterprising grad students actually pulled this off; I recommend "The Eudaimonic Pie" for more on this. It's an amusing book. This was back in ~1981, too, before computer miniaturization had really taken off... they had computers stowed in their phones, Maxwell Smart style, and the associate used radio signals to shock the better's hand in a specific spot to tell him where to bet. Pretty neat stuff.

    The method was something like this: Divide the wheel into octants. Measure the speed of one revolution of the wheel - as in, click a button when 00 is at the bottom of the wheel, then click again when it has returned. Calculate which octant the wheel will stop at based on its speed (and a bunch of tests with a similar wheel and an estimate of the degree of tilt on the wheel). They never made tons of money off it due to having to research too many wheels, but at their best they were getting the octant right 1/3 of the time on a bet that's supposed to only pay off 1/8 of the time.

    Sounds like a movie I saw - didn't know it was based (even loosely) on fact....

  • Bored (unregistered)

    I got bored before finishing this... I was going all out...

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading;
    
    namespace Perch
    {
       class Program
       {
          static void Main(string[] args)
          {
          }
       }
    
       class Player
       {
          public int Cash
          { get; private set; }
    
          public Casino Casino
          {
             get;
             set;
          }
    
          private PlayerState m_state;
    
          private enum PlayerState
          {
             DrinkingInRoom,
             Perched,
             Playing,
             CelebratingVictory,
             MourningLosses
          }
    
          public Player(int startingCash, Casino casino)
          {
             Cash = startingCash;
             // Players start out drinking in their room, before they get the
             // "brilliant" Perch idea
             m_state = PlayerState.DrinkingInRoom;
    
             Casino = casino;
          }
    
          public void Play(int desiredEnd)
          {
             // Wait for one of the tables to have 4 hits in a row
             m_state = PlayerState.Perched;
    
             foreach (RouletteTable t in Casino.RouletteTables)
             {
                
             }
          }
       }
    
       class Casino
       {
          public RouletteTable[] RouletteTables
          {
             get;
             private set;
          }
    
          public Casino(int numRouletteTables)
          {
             RouletteTable[] tables = new RouletteTable[numRouletteTables];
             for (int i = 0; i < numRouletteTables; i++)
             {
                //hardcoded $10, could make tables of different values
                tables[i] = RouletteTable.CreateTable(10);
             }
             RouletteTables = tables;
          }
    
          public void Run()
          {
             foreach (RouletteTable table in RouletteTables)
             {
                Thread thread = new Thread(new ThreadStart(table.Run));
                thread.Start();
             }
          }
       }
    
    
       class RouletteTable
       {
          public Sign Screen
          {
             get; private set;
          }
    
          public RouletteWheel Wheel
          {
             get; private set;
          }
    
          public int MinimumBet
          {
             get;
             private set;
          }
    
          public TableStatus Status
          {
             get;
             private set;
          }
    
          public enum TableStatus
          {
             BetsOpen,
             Spinning,
             Payment
          }
    
          public enum Colors
          {
             Red,
             Black,
             Green
          }
    
          private RouletteTable()
          { }
    
          public static RouletteTable CreateTable(int minBet)
          {
             RouletteTable table = new RouletteTable();
    
             table.Screen = new Sign(8);
             table.Wheel = new RouletteWheel();
             table.MinimumBet = minBet;
             table.Status = TableStatus.BetsOpen;
    
             return table;
          }
    
          public int PlaceBet(int dollars, int number)
          {
             throw new NotImplementedException();
          }
    
          public int PlaceBet(int dollars, Colors color)
          {
             if (TableStatus.BetsOpen != Status)
             {
    
             }
    
             return 2 * dollars;
          }
    
          public void Run()
          {
             
             Thread.Sleep(500);
             Status = TableStatus.Spinning;
             Screen.AddSpin(Wheel.Spin());
             Thread.Sleep(500);
    
          }
    
          class Sign
          {
             private int[] m_lastSpins;
             private int m_ndxLastSpin;
    
             public Sign(int numSlots)
             {
                m_lastSpins = new int[numSlots];
                m_ndxLastSpin = 0;
             }
    
             public void AddSpin(int num)
             {
                m_lastSpins[m_ndxLastSpin++] = num;
    
                if (m_ndxLastSpin >= m_lastSpins.Length)
                {
                   m_ndxLastSpin = 0;
                }
             }
    
          }
    
          class RouletteWheel
          {
             private static Colors[] WheelColors;
    
             private Random m_rand; 
    
             public RouletteWheel()
             {
                m_rand = new Random();
    
                if (WheelColors == null)
                {
                   WheelColors = new Colors[38];
                   WheelColors[0] = Colors.Green;
                   WheelColors[1] = Colors.Green;
                   for (int i = 2; i < 38; i++)
                   {
                      // evens black, odds red from 1-10, 19-28
                      // Add 2 to each of these, to account for 0 and 00
                      if ((i <= 12) || (i >= 21 && i <= 30))
                      {
                         WheelColors[i] = (i % 2 == 0) ? Colors.Black : Colors.Red;
                      }
                      else 
                      {
                         WheelColors[i] = (i % 2 == 0) ? Colors.Red : Colors.Black;
                      }
                   }
                }
             }
    
             public int Spin()
             {
                return  m_rand.Next(37);
             }
          }
       }
    }
    
  • Thomas Magle Brodersen (unregistered)

    Law and Statistics don't mix.

  • Lom (unregistered)

    Everyone knows that you should bet on 4, 8, 15, 16, 23 ...

  • Falc (unregistered)

    What should happen if two (or more) tables get a 4-in-a-row streak at the same time? Bet on all of them or bet on only one of them?

  • Flo (unregistered) in reply to Dazed

    If you really wrote a book about that, then you should know that it is not equally effektive as flushing it down means 100% loss, and even if a strategy does not work, if you are very lucky you might win money. Even if there is only a 1% chance of that to happen, this is way more effective than loosing in 100% of the time.

  • Jay (unregistered)

    Erm, why not be less provincial and use not an American but a worldwide roulette table, without the 00 ..?

  • (cs)

    The last time I saw 5 blacks in a row, they were fighting each other outside a bar. rimshot

  • teh jav (unregistered) in reply to mb
    mb:
    A drunk man normally has an even chance to take a 1 foot step to the left or a step to the right (no, he's not doing the Timewarp). Because we are sadists, we place a drunkard 1 foot to the right of a cliff. Also, the ground is slightly tilted, which means this poor besotted fellow is slightly (3%) more likely to take a step to the right. However, if he manages to wander 400 feet uphill, there is a kindly social worker who will take him away to rehab.

    What are the chances that our drunk ends up dead at the bottom of a cliff?

    100% I'm going to nick his wallet and push him over the edge.

  • Ralph (unregistered) in reply to Kanazuchi

    I was hoping someone'd mention wizardofodds - the website makes for some really interesting reading.

    As a fellow actuary, his lack of rigour really bothers me though. 2^inf/2^inf = 1?? really? I know what he means, but that's rookie math.

    Especially when betting strategies (as a whole) can be nuked with just a few lines of math.

    E stands for expectation, B_t is the bet decision for the game at time t (can be random and/or based on previous rounds), X_t is the outcome (per dollar bet) of the game and F_t is the filtration generated by all games and bets <= t

    E[B_t X_t] = EE[B_t X_t|F_t-1] = E[ E[B_t|F_t-1] * E[X_t|F_t-1] ] = E[ E[B_t|F_t-1] * 0 ] = 0

    ie the expected return, regardless of strategy is zero. and that's for a fair game. The only way to expect to win in that case is if you allow B_t to be negative (betting on the side of the house)

    playing strategies (counting cards) can in some cases be effective, however.

    Casinos work on a basic understanding: Punters are happy because they might win in the short run, and casinos are happy because they know they will win in the long run.

    This Perch scenario is interesting, but the actual question asked is vague and uninteresting. (Sorry!)

    Strategies in relation to stopping times (eg quit when I double my $10000 or lose it all) might have been better.

  • teh jav (unregistered) in reply to TehShrike
    TehShrike:
    Some entertaining comments today! :-D

    I particularly enjoyed the Java implementation (implementing different strategies as different objects tickled me).

    Thanks. But (as always) I can't take credit. :shakefist: @ GoF http://en.wikipedia.org/wiki/Strategy_pattern
  • iWerner (unregistered)

    Here's a version in AWK, figuring that the number of tables doesn't really make a difference:

    BEGIN{
    	srand();
    
    	money = 25;
    	min_bet = 10;
    	MAX = 400
    
    	while(money < MAX && money >= min_bet)
    	{		
    		if(reds == 4)
    		{
    			bet = 1;
    			bet_amt = min_bet;
    		}
    		else if(reds == 5 && money >= min_bet * 1.5)
    		{
    			bet = 1;
    			bet_amt = min_bet * 1.5;
    		}
    		else if(blacks == 4)
    		{
    			bet = 2;	
    			bet_amt = min_bet;
    		}
    		else if(blacks == 5 && money >= min_bet * 1.5)
    		{
    			bet = 2;	
    			bet_amt = min_bet * 1.5;
    		}
    		else
    			bet = 0;
    
    		x = int(rand()*39);
    		if(x == 38)
    			x = 0;
    
    		if(x == 0)
    		{
    			reds = 0;
    			blacks = 0;
    			printf("%c[32m", 0x1B);
    		}
    		else if(x % 2) # RED
    		{
    			printf("%c[31m", 0x1B);
    			reds++;
    			blacks=0;
    			if(bet == 2)
    				money += bet_amt;
    			else if(bet != 0)
    				money -= bet_amt;
    		}
    		else # BLACK
    		{				
    			reds=0;
    			blacks++;
    			if(bet == 1)
    				money += bet_amt;
    			else if(bet != 0)
    				money -= bet_amt;
    		}
    
    		printf("%d\t%c[0m%d\n", x, 0x1B, money);
    	}
    }
    
  • Paul (unregistered)

    Ummm, you realise that your "system" is in fact simply the Gambler's Fallicy written out?

    http://en.wikipedia.org/wiki/Gambler's_fallacy

  • anElephant (unregistered)

    So I coded the routine, and ofcourse I wasn't surprised to find that it didn't differ from just rolling them at random.

    But what I am amazed about is that I tried this at least a 20 times, and the record is so far 175$ of winnings. However you guys managed 400$, so maybe there is a factor unaccounted for, because you can be damn sure it has nothing to do with "oh, there has been so many black, surely a red must be on the way," because no matter how many black have been rolled, you can be damn sure the chance of red is still 50/50 of another one. Unless it isn't random, and thats why I suspect a hidden factor. Maybe in the throw of the dealer (or whatever they call it in black jack) or that the casino is "making it more fun!".

    Or just maybe you where really lucky ! =D

  • kero (unregistered) in reply to Michael A
    Michael A:
    "I’ve seen a heckuva lot more 4-in-a-rows than I have 5-in-a-rows."

    No, you've seen slightly less than 1/2 the number of 5-in-a-rows as 4-in-a-rows (would be exactly 1/2 except for greens.

    It also depends on how long you're watching the table. If you're always leaving after 4 rounds, the ratio will be quite different :-)
  • Hans (unregistered) in reply to thnurg
    thnurg:
    What the hell does quote-unquote The Law of Large Numbers mean?

    Surely that should be quote The Law of Large Numbers unquote.

    quote-unquote bothers the crap out of me. The whole point of it is to quote a phrase, but if you simply say quote-unquote before the phrase how do we know when the phrase is finished?

    This isn't grammer Nazism, it's logic Nazism.

    It's called, quote-unquote, banter, and you would be more succesful at reproduction if you could engage in it.

  • Deanius (unregistered)

    Statistically you would indeed see fewer five-in-a-rows than four-in-a-rows. Slightly less than half as many: the exact same odds you have of hitting black on a fresh table. Switching tables makes no difference to the algorithm, since every spin of the wheel is memoryless. The reason the method yielded massive theoretical winnings was due to there being no bankroll limit. As soon as ANY such limit is applied, you have slightly more chance of losing your bankroll than you do doubling it.

  • k1 (unregistered)

    php not too many errors, I hope :D

    <?php
    
    define ("THEPERCH", 0);
    
    define ("RED", 1);
    define ("BLACK", 2);
    define ("ZEROES", 0);
    
    define ("MINIMUN_BET", 10);
    
    class Roulette {
      protected $consecutives = 0;
      protected $consecutivesColor = ZEROES;
      
      function get_consecutives () {
       return $this->consecutives;
      }
      function get_consecutivesColor () {
       return $this->consecutivesColor;
      }
      function spin () {
       $landing = rand(0, 38);
       
       $result = BLACK;
       if (($landing % 2) == 0 )
        $result = RED;
       
       if ($this->get_consecutivesColor() == $result)
        $this->consecutives++;
       else {
        $this->consecutivesColor = $result;
        $this->consecutives = 1;
       }
       
       if (($landing == 0) OR ($landing == 38)) {
        $this->consecutivesColor = ZEROES;
        $this->consecutives = 0;
       }
    
      }
    }
    
    function ThePerch ($startingBankroll, $nTables, $endingBankroll) {
      $Cash = $startingBankroll;
      for ($i=1; $i<=$nTables; $i++)
       $Roulette[$i] = new Roulette;
      // start from the perch
      $Position = THEPERCH;
      
      // let's play
      // main loop
      while ($Cash < $endingBankroll AND $Cash >= MINIMUN_BET) {
      
       // find a table with 4 or more consecutives
       for ($i=1; $i<=$nTables; $i++)
        if ($Roulette[$i]->get_consecutives() > 3) {
         $Position = $i;
         break;
        }
    
       if ($Position == THEPERCH) {
        // no tables with 4 or more consecutives, let's spin the wheels
        for ($i=1; $i<=$nTables; $i++)
         $Roulette[$i]->spin();
       } else {
        // we have a table, bet half of our cash or the minimun bet
        $Bet = max (round ($Cash / 2), MINMUN_BET);
        $Cash -= $Bet;
        // bet on the other color
        $colorToBet = BLACK;
        if( $Roulette[$Position]->get_consecutivesColor () == BLACK)
         $colorToBet = RED;
        
        // spin the wheels, cross our fingers
        for ($i=1; $i<=$nTables; $i++)
         $Roulette[$i]->spin();
        // exited our color ?
        if ($Roulette[$Position]->get_consecutivesColor() == $colorToBet) {
         // Yeah! get the win and return to the perch
         $Cash += $Bet * 2;
         $Position = THEPERCH;
        } else {
         // oh, no! another time the same color!
         // have we enough cash?
         if ($Cash >= MINIMUN_BET) {
          // ok, let's try another round, this time we bet one and a half the previous amount, or the minumun allowed, or the whole cash
          $Bet = max (min(round ($Bet * 1.5), $Cash), MINIMUN_BET);
          $Cash -= $Bet;
         
          // spin the wheels, cross our fingers
          for ($i=1; $i<=$nTables; $i++)
           $Roulette[$i]->spin();
          // exited our color ?
          if ($Roulette[$Position]->get_consecutivesColor() == $colorToBet) 
           $Cash += $Bet * 2;
         }
         // anyway, return to the perch
         $Position = THEPERCH;
    
        }
       }
       
      } // main loop
      
      // leave the casino
      return $Cash;
    }
    
    echo "begin - ";
    for ($j=0; $j<1000; $j++)
     if ((ThePerch (10, 3, 400)) > MINIMUN_BET)
      echo " $j win - ";
    echo "end\n";
    
    ?>
    
  • 10th (unregistered) in reply to fmtaylor

    So fmtaylor,

    Is joshua still playing the game? How about a nice game of chess after?

  • (cs) in reply to There is so much WTF in this I don't know where to start

    I had an argument with my probability professor on the same line. I do not think a knowledge of past events helps in determining future events if the said event are truly unbiased. These events do not know/record their history, so for each future event has a clean (probability ) slate. Somehow i would like to know in technical terms (proof) this idea or theory.

  • (cs) in reply to There is so much WTF in this I don't know where to start

    hi 'There is so much WTF in this I don't know where to start'

    "The roulette table has NO MEMORY of the previous sequence of events (black or red)."

    I had an argument with my probability professor on the same line. I do not think a knowledge of past events helps in determining future events if the said event are truly unbiased. These events do not know/record their history, so for each future event has a clean (probability ) slate. Somehow i would like to know in technical terms (proof) this idea or theory.

  • (cs) in reply to Paul
    Paul:
    Ummm, you realise that your "system" is in fact simply the Gambler's Fallicy written out?

    http://en.wikipedia.org/wiki/Gambler's_fallacy

    Really? I had no idea, because absolutely no one has pointed that out already in this thread!

  • DesGrieux (unregistered)

    For one round, the chance is 1:1 to get red. For two rounds, chances are higher. There are four possible ordered results for two rounds: {Red, Red}, {Red, Black}, {Black, Red}, {Black, Black}. So the chances to get at least one red in two rounds is already 3:1 For three rounds: 8 (2^3) possible results, but only one is all blacks, so changes are 7:1 to get a red.

    So: Changes to get a red in x rounds = (2^x) - 1

    So: 4 in a row have a chance of 1:(2^4) - 1, which is 1:15. 5 in a row have a change of 1:(2^5) - 1, which is 1:31. 1:15 are 6,66% 1:31 are 3,22%

    To get the amount which end after a streak of 4: 6,66% - 3,22% = 3,44%

    So the chances to get the other color after you had a streak of 4 should be 3,44:3,22, so just slightly above 1:1.

    It's been a while since i did math in school, so please correct me if necessary ;-)

  • mb (unregistered)

    It really is a more interesting question and math problem than most people are giving it credit for - chalk another win up for reading comprehension.

    Of course if you keep playing forever you end up with zero. The house wins eventually, you can't beat them, blah blah blah "return 0; // lulz" and all that.

    The question is "what is the probability in a game of chance that your winnings will at some point in time exceed $x" which is the point that someone has decided to stop playing. Now, obviously its a incorrect claim to state that this probability can ever be larger than 50% in our Roulette example; but it is most certainly larger than 0% for finite values of $x.

  • highphilosopher (unregistered) in reply to Jim

    echo '$0'; <------ Bug Fixed.

  • Graham Stewart (unregistered) in reply to webhamster
    webhamster:
    Otto:
    Boy Girl Paradox You ask a woman how many children she has and she says two. Then for some strange reason you ask her, "Is at least one a girl?", to which she replies, "Yes".

    So what are the odds that she has a girl and a boy?

    (to avoid some argument: assume this is a perfect world where the odds of boy or girl conception are 50/50 and that there are no genetic "third sex" possibilities)

    Err.. That seems obvious. The odds that she has a boy and girl at the end of the statement is 2/3rds.

    Except GB and BG are the same thing... So #1 is already eliminated therefore it's 1/2.

    Lulz.

    Otto is of course correct. It is 2/3 that she has a boy and a girl. (IF you disagree then think some more).

    But it is surprising how many people fixate on it being two independent 50/50 events without considering the whole picture. Or, as webhamster has done, consider BG to be the same as GB and discard it.

    Stats are not always obvious.

  • (cs) in reply to Meee
    Meee:
    So program or not, I want to hear stories of those who applied it and walked out with couple of grand, not a couple of hundred.
    Here's a sample run of my program using $100 starting bankroll, five tables, and target bankroll of $2000.

    Bankroll = 100 Betting 15 on black: win Bankroll = 115 Betting 44 on black: win Bankroll = 159 Betting 49 on black: win Bankroll = 208 Betting 163 on black: win Bankroll = 371 Betting 349 on black: win Bankroll = 720 Betting 664 on black: win Bankroll = 1384 Betting 94 on black: win Bankroll = 1478 Betting 1105 on black: win Final bankroll = 2583

    Sadly, it took 15 losing tries to get there.

  • Josephine (unregistered)

    If anyone (who doesn't already know) is interested in calculating these probabilities exactly, check out Martingales and the Optional Stopping Theorem.

    http://en.wikipedia.org/wiki/Optional_stopping_theorem

    Construct an appropriate martingale, and stop it when he hits either end-point. Solve for p.

  • Sal (unregistered) in reply to Code Dependent
    Code Dependent:
    Meee:
    So program or not, I want to hear stories of those who applied it and walked out with couple of grand, not a couple of hundred.
    Here's a sample run of my program using $100 starting bankroll, five tables, and target bankroll of $2000.

    Bankroll = 100 Betting 15 on black: win Bankroll = 115 Betting 44 on black: win Bankroll = 159 Betting 49 on black: win Bankroll = 208 Betting 163 on black: win Bankroll = 371 Betting 349 on black: win Bankroll = 720 Betting 664 on black: win Bankroll = 1384 Betting 94 on black: win Bankroll = 1478 Betting 1105 on black: win Final bankroll = 2583

    Sadly, it took 15 losing tries to get there.

    Sadly??? In your scenario you made $1083...

  • (cs) in reply to Sal
    Sal:
    Code Dependent:
    Sadly, it took 15 losing tries to get there.
    Sadly??? In your scenario you made $1083...
    Yeah, but in the real world, the bankroll doesn't reset to $100 again after it hits zero. :(
  • justpassing (unregistered) in reply to shadowman
    shadowman:
    Check your aspie's at the door next time before you go off on a rant.
    Didn't take long for that to turn into a playground insult...
  • Try this spin on (unregistered) in reply to rupee

    I would suggest your friend is full of it. Specifically because of the design of the wheels and because places like Nevada very closely monitor the gambling in the houses and if they think the house is scamming will do something about it.

    Besides, there's no need to do so. The game is rigged by design to give the house the winning odds.

    And generally the best case is where the odds are just slightly better than 50/50 because it lulls people into playing longer. No one in their right mind is going to play a game that has 80:20 odds in favor of the house. But 50.1%/49.9%, oh you'll keep them hooked forever.

    Captcha: consequat almost sounds like the consequences of you losing.

  • Jay (unregistered)
    mb:
    A drunk man normally has an even chance to take a 1 foot step to the left or a step to the right (no, he's not doing the Timewarp). Because we are sadists, we place a drunkard 1 foot to the right of a cliff. Also, the ground is slightly tilted, which means this poor besotted fellow is slightly (3%) more likely to take a step to the right. However, if he manages to wander 400 feet uphill, there is a kindly social worker who will take him away to rehab.

    What are the chances that our drunk ends up dead at the bottom of a cliff?

    The writer seems to be trying to make an ethical point with this analogy. In fairness to the gambling world, I should point out that the ethics of this example are totally different from the ethics of gambling.

    The most common type of gambling in America today is the lottery. In a lottery, the house does not have the paltry 3% take that a casino does with roulette, but typically more like 50%. BUT ... the money goes to the government. And of course taking money from citizens and giving it to the government is always good, because the government spends money so much more effectively than private citizens do. I've often thought to myself, If only I had a dollar for every time I've heard a small business owner say, "I just wish I could figure out how to run my business as efficiently as the government is run."

    So gambling is fundamentally good.

    Of course if there was a way for the government to collect money from the drunk when he hits the ground at the bottom of the cliff, especially if the money was earmarked for some worthy social goal like education or health care, I'm sure there'd be plenty of people explaining why pushing drunks off cliffs was a fundamentally good thing, too.

  • Lafcadio (unregistered)

    I just want the bonus points. You have a 50% chance of making $400 on your initial $10 bet using this strategy. Because either you will, or you won't. That's how statistics works, right? Right? Do I win?

  • Hatterson (unregistered) in reply to tedr2

    In probability theory 'memory' or 'knowledge of past events' is technically referred to as dependent events.

    Things that have 'no memory' or 'no knowledge' are independent events.

    This is completely unrelated to bias in a flip. A coin can be very biased (99% chance to land on tails) but is still an entirely independent event.

    Coin flips, roulette wheels, etc are independent events meaning 1 flip/spin has no bearing on the next flip/spin.

  • JL (unregistered) in reply to MHOOO
    MHOOO:
    Here's a common lisp version:
    (defun the-perch (starting-bankroll table-count ending-bankroll &optional (stream nil) &key (min-bet 10))
      "Simulates the perch system."
      (let ((money starting-bankroll))
               (labels ((green (x) (member x '(0 38)))
                        (black (x) (and (oddp x) (not (green x))))
                        (red (x) (and (evenp x) (not (green x))))
                        (to-color (x) (cond ((black x) 'black)
                                            ((red x) 'red)
                                            (t 'green)))
                        (gen-color () (to-color (random 39)))

    ...

    It looks like you have 39 slots total? (two green, 19 red, 18 black)

Leave a comment on “Knocking Me Off The Perch”

Log In or post as a guest

Replying to comment #:

« Return to Article