Wikipedia:Reference desk/Archives/Mathematics/2010 October 25

= October 25 =

Roulette
Forgive my weakness in math. If I had $100 and I played roulette with the intent of walking away with as much money as possible, would I be better off placing all $100 on red/black and having it out in one spin, or incrementally wagering on red/black, say $5 at a time 20 times (so that the total wager is the same)? With a 1-to-1 payout, the possible results for my first option are $200 or $0. For the second, it'd be $105/$95, then $110/$100/$100/$90, and continue branching for 18 more levels. My gut says the most likely outcome would be something like $45 at the end, but I'm not sure how to do the calculations save for the brute force approach. The Masked Booby (talk) 02:12, 25 October 2010 (UTC)
 * You have to specify your goals more carefully. What do you mean by "as much money as possible"?  Literally speaking, you could be saying that you want the maximum probability of breaking the house, even though that chance is going to be vanishingly small.  Is that what you mean?  That's probably not too hard to figure out, once we know how much money the house has, and which kind of roulette we're talking about (is there 0 and 00, or just 0)?. --Trovatore (talk) 02:55, 25 October 2010 (UTC)
 * Ah, never mind; I didn't read carefully enough. I didn't realize you were asking only about two discrete alternatives. --Trovatore (talk) 06:43, 25 October 2010 (UTC)
 * The House has some (small) advantage, since not every number is red or black. The expected value on a $1 bet is a $0.053 loss, in American roulette. Either strategy has an expected loss of 100*$0.053 = $5.30. The variance of the first strategy is much higher than the second strategy--you either win big or lose big, instead of winning small and losing small. The second strategy basically follows the multinomial distribution with p1=16/38, p2=16/38, p3=2/38. 67.158.43.41 (talk) 03:21, 25 October 2010 (UTC)
 * Make that the binomial distribution with p=16/38. The above is also correct, though if you bet "black" all the time, for winning total purposes, "red" and "neither black nor red" are the same outcome, so p2 and p3 can be combined into the implicit loss fraction of the binomial distribution. 67.158.43.41 (talk) 04:20, 25 October 2010 (UTC)
 * If there's no house advantage, then the distribution of the number of wins with 20 plays is distributed binomially with $$n=20,\ p=0.5$$, which can be seen here. With house advantage it's $$p=8/19$$ which can be seen here.
 * Of course, since the house does have an advantage, if you want to maximize your expected money, the correct answer is not to play. -- Meni Rosenfeld (talk) 07:33, 25 October 2010 (UTC)


 * To answer your question specifically, I think on average you'd be better off making one big bet, since making many smaller bets would give a higher expectation of losing to the house edge when the ball falls into the zero pocket(s).


 * The start of the articles Martingale (betting system) and Martingale (probability theory), describe a system where you bet on black or red only, and double your bet if you lose the previous bet. This system trades making a small profit with a small probability of losing all your money. The golden rule would seem to be: walk away when you are winning. If you enjoy gambling, then making a series of small bets will entertain you for longer.


 * I believe it is impossible to have any simple chance gambling system which makes any profit in the long run and on average, as the house always has an edge. This does not apply to poker, which involves skill, not just chance. You may also be interested in the Kelly criterion which is used more in racehorse betting etc. 92.24.186.217 (talk) 17:10, 26 October 2010 (UTC)


 * For every bet of $n on red/black, you expect to lose $0.053*n as above. If you spread these bets out over time into $n/3, $n/3, and $n/3, you still expect to lose 3*$0.053*(n/3) = $0.053*n. There is no difference in the expectation value of the different strategies. Put another way, if you implemented both strategies a million times, the average loss for both over all trials would be (virtually) the same. In a game with such well-defined odds, barring cheating or otherwise breaking the rules, we can confidently say there is no gambling system which makes a long-term profit, betting a fixed total, period. Every single one has the same expected loss, $0.053*n, where n is the total amount you decide beforehand to bet. Other games are more complicated to analyze, like Poker, depending on your rules. They might actually give a chance of winning long-term, but of course casinos try to avoid such a situation.


 * The betting system you mention is really quite interesting, but it just yields a massive variance in your profit (or loss). That is, you either win huge or you lose huge using that strategy. The expected value is the same as any other strategy--for every $1 you end up betting, you'll lose $0.053, on average.


 * Overall, the point is (a) if you just want to make money, the only sane thing to do is not to play; (b) if you enjoy gambling, but don't want to lose much money, make lots and lots of very small bets so your eventual loss takes forever; (c) if you enjoy gambling for the risk, find some help (my own opinion) or another hobby unless you're rich, 'cause you'll want to bet large and you'll just lose big. 67.158.43.41 (talk) 22:17, 27 October 2010 (UTC)
 * My thinking was that if you are churning the same money on small bets over and over again, then you are being repeatedly "taxed" by the house edge. Whereas if you only make one bet, then you are only "taxed" once. There are other more complicated betting systems that may have the behaviour I described. 92.15.25.142 (talk) 18:33, 28 October 2010 (UTC)
 * Certainly if you "recycle" your winnings you'll keep losing more and more. That is, you'd expect to get back $100-$5.3 = $94.7 back with either strategy. If you then go back and bet the $94.7, you'll expect to lose another $0.053 per dollar. But the same problem pervades both strategies if you recycle your winnings in this way. With more smaller bets, you'll just take longer to lose the same amount (on average, of course). 67.158.43.41 (talk) 23:24, 28 October 2010 (UTC)
 * If you make one big bet then you probably won't lose any money to the house, although you have a small chance of losing everything. If you make lots of little bets you will certainly lose a proportion of your money to the house, but have almost no chance of losing everything. The expected value is the same, but your betting system allows you to change the risk profile. 92.24.186.230 (talk) 21:24, 31 October 2010 (UTC)
 * While there's no way to win on roulette, sometimes it can make sense to ask how to lose the least, for example when you get gift tokens for roulette that you can't directly cash, but you can cash the other sort of tokens you get as winnings. &#x2013; b_jonas 13:18, 29 October 2010 (UTC)
 * I have an old "casino suite" game for PC, and have a strategy for roulette that doesn't build up winnings all that quickly, but is pretty safe. Instead of choosing a single number or any of the 2-to-1 ("black or red," "odd or even," or "1-18 or 19-36") or 3-to-1 (1-12, 13-24, 25-36) payouts, I usually put a chip on 35 different numbers.  That way, I spend 35 chips on the bet, but I win 36 back.  (The stinker is when the roll hits "0" or "00" and I completely lose.)  I'm not sure if the person running the roulette table in a real-life casino would actually allow someone to bet that way, though.  (I suspect not...)  Kingsfold   (Quack quack!)  15:30, 29 October 2010 (UTC)
 * Really, why shouldn't they? You aren't improving your expectations by means of that strategy; and the casino still has the edge, at each one of your bets. The only reason for not liking it would be if they thought you were cluttering the table in that manner, disencouraging others from betting.
 * Since the available capital for the casino is considerably larger than the amount that any single player may bet at once, there is no problem for the casino to consider the bets as independent. If you put 35 units on one number, or 35 units on 35 numbers, you have exactly the same expected loss and the bank thus the same expected gain in either case. "Expected" may be interpreted as "almost sure in the long run" - and the casino can afford the long perspective.
 * The elegant way to see this is not to calculate the two separate situations; but let's do it, if that may convince you. If you put 35 on one number, you have the probability 1/38 of winning (if your wheel contains the numbers 1-36 and 0 and 00, and there is no cheating or mechanical failure involved; else modify according to the wheel involved), and you end up with 36x35 = 1260 units if you win. The expected value of your 'revenue', if you use this strategy, thus is
 * $$(1/38) \cdot 1260 = \frac{35 \cdot 36}{38} = \frac{630}{19} = 33 + \frac 3{19} \approx 33.15789 \,,$$
 * an expected (i. e., average) loss of 35/19 units.
 * If instead you bet one unit each on the numbers 1 to 35, then you have the probability 35/38 of ending up with 36 units, and 3/38 of loosing all (since not only 0 or 00, but also that number on which you didn't bet, say 36, is a looser). Your expected 'revenue' with the second strategy thus is
 * $$(35/38) \cdot 36 = \frac{35 \cdot 36}{38} = \frac{630}{19} = 33 + \frac 3{19} \approx 33.15789 \,,$$
 * with an expected loss of 35/19 units, on the average and in the long run.
 * There is no difference whatsoever between the expected average outcomes.
 * The casino does take the long run view. For them, it does not matter if you want to balance a small chance of winning much against a large chance of loosing little, or the other way around; as long as you play at their odds, they should be happy.
 * There is one and just one way to win in the long run in casino gambling: Be the casino owner!. JoergenB (talk) 19:34, 29 October 2010 (UTC)

Mentally generating random numbers
Suppose I am playing a game like poker, and my strategy includes bluffing with a certain (fixed) probability each hand. Of course, humans are notoriously bad at generating "random" numbers themselves. The bluff (poker) article mentions using the colors of my hidden cards or the second hand on my watch as randomizing devices, but suppose I want to use some kind of pseudorandom number generator. Nearly all of the results about PRNGs are for computers that can easily remember and manipulate large numbers, which humans cannot do. Are there results for "human-implementable" PRNGs that use numbers with no more than, say, four decimal digits and computations that can easily be performed mentally? —Bkell (talk) 14:14, 25 October 2010 (UTC)
 * My initial thought was to do something like this:
 * Choose prime numbers p, q.
 * Choose m and n, small generators of the multiplicative groups modulo p and q, respectively (this will be easier if m and n are equal, more so if they are equal to 2)
 * Choose thresholds $$1\le t< p,\ 1\le u< q$$ so that $$\frac{tu}{(p-1)(q-1)}$$ is equal to the probability of bluffing.
 * Choose seeds $$1\le a_0< p,\ 1\le b_0< q$$.
 * At each iteration, take $$a_{i+1} \equiv ma_i \pmod p,\,b_{i+1} \equiv nb_i \pmod q$$. Bluff if $$a_i \le t, b_i \le u$$.
 * However, testing this gave a sequence with longer runs than random. Maybe some modification of this can give better results.
 * Another approach is to generate a sequence in advance and memorize it using some mnemonic. -- Meni Rosenfeld (talk) 15:19, 25 October 2010 (UTC)


 * I would just remember a long string of numbers. Or you could use some other more easily remembered pattern. E.g. if you've foolishly remembered π to 50 decimal places, or know the phone numbers of all your friends. You can extend the use of these by looking at them more than one way. For example you could alternate between bluffing if a digit is odd and bluffing when a digit is 5 or more. It even need not be numbers. A text, which might be easier to remember, could do the same job, though you need to be smarter at generating random numbers from it as the frequency and distribution of letters in most texts is far from random (or if it is random the text isn't easy to remember).-- JohnBlackburne wordsdeeds 15:29, 25 October 2010 (UTC)

complete the sequence
5+3+2 = 151012 9+2+4 = 183662 8+6+3 = 482466 5+4+5 = 202504 Then 7+2+5 = ? —Preceding unsigned comment added by 119.154.134.131 (talk) 17:42, 25 October 2010 (UTC) sorry, i have just solved it answer is 143542 —Preceding unsigned comment added by 119.154.134.131 (talk) 17:56, 25 October 2010 (UTC)


 * For anyone looking at this, the solution is, given a+b+c, a*b concatenated with a*c concatenated with b(a+c) reversed. So, 7*2=14, 7*5=35, and 2(7+5)=24, reversed is 42.  Concatenated, it is 143542. --  k a i n a w &trade; 12:56, 27 October 2010 (UTC)

Ergodicity
I'm teaching myself a little ergodic theory. Looking at the article ergodicity, I have a couple of questions. First, in the second item in the formal definition, that A should be an E, yes?

Also, am I mistaken in thinking that the third item in the formal definition implies the other three?--130.195.2.100 (talk) 21:53, 25 October 2010 (UTC)
 * Nevermind on the second. I just looked closer and noticed that the article mentions they're equivalent definitions.--130.195.2.100 (talk) 21:55, 25 October 2010 (UTC)
 * You can read the source of the definitions you indicate at Google Books. Maybe a book would be better anyway. Thm. 1.5 says that, yup, you're right, A should be E. Apparently it was badly copied. I've updated the page. 67.158.43.41 (talk) 09:06, 26 October 2010 (UTC)