 Feature Articles
 CodeSOD

Error'd
 Most Recent Articles
 Zeroics
 Not Really an Error'd Error'd
 Twicely Done
 Fresh Bugs
 Absolutely Execrable
 Boy Howdy
 NaaN
 Bon Weekend
 Forums

Other Articles
 Random Article
 Other Series
 Alex's Soapbox
 Announcements
 Best of…
 Best of Email
 Best of the Sidebar
 Bring Your Own Code
 Coded Smorgasbord
 Mandatory Fun Day
 Off Topic
 Representative Line
 News Roundup
 Editor's Soapbox
 Software on the Rocks
 Souvenir Potpourri
 Sponsor Post
 Tales from the Interview
 The Daily WTF: Live
 Virtudyne
Admin
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.
Admin
The word you are looking for is "croupier" (croupiere if it's a lady, plus or minus an accent.)
Addendum (20090820 12:02): The accent goes here: croupière
Admin
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 bugridden, 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)
Admin
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.
Admin
God everyone so negative! Of course the previous spin means nothing. Still fun to code up a little roulette program to try it though :)
Admin
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...
Admin
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.
Admin
Easiest programming challenge ever.
function the_perch(starting_bankroll, num_tables, desired_ending_bankroll) { return 0; }
Admin
Here's a common lisp version:
Example output: CLUSER> (withoutputtostring (s) (theperch 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! "
Admin
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.
Admin
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/xhtml1transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>The perch</title> </head> <body>Admin
I'll bet you're really fun at parties.
Admin
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.
Admin
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!!
Admin
Sounds like a movie I saw  didn't know it was based (even loosely) on fact....
Admin
I got bored before finishing this... I was going all out...
Admin
Law and Statistics don't mix.
Admin
Everyone knows that you should bet on 4, 8, 15, 16, 23 ...
Admin
What should happen if two (or more) tables get a 4inarow streak at the same time? Bet on all of them or bet on only one of them?
Admin
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.
Admin
Erm, why not be less provincial and use not an American but a worldwide roulette table, without the 00 ..?
Admin
The last time I saw 5 blacks in a row, they were fighting each other outside a bar. rimshot
Admin
Admin
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_tF_t1] = E[ E[B_tF_t1] * E[X_tF_t1] ] = E[ E[B_tF_t1] * 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.
Admin
Admin
Here's a version in AWK, figuring that the number of tables doesn't really make a difference:
Admin
Ummm, you realise that your "system" is in fact simply the Gambler's Fallicy written out?
http://en.wikipedia.org/wiki/Gambler's_fallacy
Admin
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
Admin
Admin
It's called, quoteunquote, banter, and you would be more succesful at reproduction if you could engage in it.
Admin
Statistically you would indeed see fewer fiveinarows than fourinarows. 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.
Admin
php not too many errors, I hope :D
Admin
So fmtaylor,
Is joshua still playing the game? How about a nice game of chess after?
Admin
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.
Admin
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.
Admin
Really? I had no idea, because absolutely no one has pointed that out already in this thread!
Admin
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 ;)
Admin
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.
Admin
echo '$0'; < Bug Fixed.
Admin
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.
Admin
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.
Admin
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 endpoint. Solve for p.
Admin
Sadly??? In your scenario you made $1083...
Admin
Admin
Admin
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.
Admin
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.
Admin
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?
Admin
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.
Admin