
How to gamble if you must – the mathematics of optimal stopping - gwern
http://www.americanscientist.org/issues/id.5783,y.2009,no.2,content.true,page.1,css.print/issue.aspx
======
jimminy
Prior discussion on optimal stopping from last week, with a different less
technical source.
[https://news.ycombinator.com/item?id=7888215](https://news.ycombinator.com/item?id=7888215)

------
chacham15
I take issue with the method posed in the article when they discuss the method
using a gaussian distribution to sometimes guess a number between the higher
and the lower. The reason I take issue is because the ability to generate a
useful distribution requires knowledge of what numbers I pick. A gaussian
distribution is generated via a mean and standard deviation. To defeat this
system, all a knowledgeable person would need to do is randomly select a mean
and a small standard deviation and choose his two numbers from there. Then the
probability that the guesser will choose his number R to be within the mean
and standard deviation of the one you picked will be essentially zero.

To illustrate in a slightly simpler way, in order to choose your two numbers
choose a random integer and the same random integer + 2 (2 to at least give
the guy a chance). I could choose 1 billion and 1 billion + 2, or one and
three. The chance that you would choose R to be 1 billion +1 or two,
respectively, is nearly zero.

In order to get above 50% you need some sort of extra knowledge. In this case
that knowledge comes from the gaussian distribution. Knowledge often affects
probabilities even though they dont seem like they should. Another example of
this is the Tuesday Birthday Problem [1].

[1] [http://scienceblogs.com/evolutionblog/2011/11/08/the-
tuesday...](http://scienceblogs.com/evolutionblog/2011/11/08/the-tuesday-
birthday-problem/)

~~~
logicallee
Have you reviewed Svedlin's link in this thread to a related puzzle? (I think
actually the exact same puzzle.)

[http://plus.maths.org/content/mathematical-mysteries-
getting...](http://plus.maths.org/content/mathematical-mysteries-getting-most-
out-life-part-1)

It's rigorous and from a slightly different approach - what do you think? Also
it says that even knowledge of the guesser's exact strategy cannot defeat the
solution mentioned there, even if the offering party knows the strategy
exactly and is actively trying to break it.

~~~
chacham15
The author of that article makes the same assumption / error that I discussed
previously. The trick lies in the statement "Since n>m, f(m) - f(n) is
positive and this probability is greater than a half." While this is true,
f(m) - f(n) will almost always be very close to zero without additional
knowledge. A key statement that illuminates the assumption in his argument is
"The bigger the cheque, the more times you toss the coin and the more likely
it is that it will come up tails at least once - in which case you keep the
cheque rather than swapping." Built into that statement is the assumption that
larger numbers are less likely than smaller ones.

~~~
logicallee
I don't really understand. The argument is just that you can do something to
increase the probability of guessing the bigger number from being anything
other than exactly, precisely 1/2.

For example the author suggests that you first randomize which envelope you
choose first.

Then you open that envelope. You then flip a coin a number of times that
matches the integer in the envelope, and if comes up all heads, then you
choose the other one; otherwise you stop on the first one.

Obviously if the numbers are anything other than tiny integers, e.g. if
they're more htan 20 or so, then for all practical purposes it is impossible
that it will come up all heads, e.g. 7,342 times in a row.

But in a rigorous, exact way, that probability is not exactly 0. The
probability of that many heads is lower for 7,342,352,454,356,234,753,343 than
it is for 454,356,234,753,343 (where I truncated a bunch of digits) or even
for 7,342,352,454,356,234,753,342 (where I changed the trailing 3 to a 2).
Therefore, you are more likely to stay on 7,342,352,454,356,234,753,343 than
either of those other numbers.

This is purely academic. Clearly, the chances of flipping heads
7,342,352,454,356,234,753,343 times in a row is so, unbelievably 0 it isn't
even funny. But it's not actually zero, mathematically speaking.

So essentially, you have a greater chance of swapping if the number is
smaller, because there is a greater chance that you will flip all heads - even
if "greater chance" just means 1 in 2^7,342,352,454,356,234,753,343 instead of
1 in 2^7,342,352,454,356,234,753,344 chance.

Do you not agree with this?

Or would you still say that it's 50:50 that you will stay on
7,342,352,454,356,234,753,343 or stay on 7,342,352,454,356,234,753,344 (I
changed just the trailing 3 to a 4) even if when you draw
7,342,352,454,356,234,753,343 you change your mind 1 out of
2^7,342,352,454,356,234,753,343 times and if you draw a
7,342,352,454,356,234,753,344 you change your mind 1 out of
2^7,342,352,454,356,234,753,344 times?

Would you consider the probability "the same" of holding on each one?

Or would you agree that in this particular example it is no longer 50:50
exactly, precisely. If you agree with me that it's not technically
(pedantically) the same exact probability, then I am not understanding your
argument exactly.

If you just meant that "for all practical purposes" the probability is the
same - then of course I agree with you whole heartedly. Do explain which one
you meant!

~~~
chacham15
I am coming from an information theoretic standpoint. Let me start over:
imagine the number writer chooses ANY two numbers completely at random.
Knowing what one number is gives NO information about the second number since
they were both chosen completely randomly. Therefore, the chance that the
second number is larger is equivalent to the number of larger numbers divided
by the total (i.e. 50% because a constant number is infinitesimally small
compared to the infinity that lies on both sides). Therefore, to suggest that
the probability can be swayed one way or another has to violate an assumption
that I made in this argument. The assumption that the article makes which
violates my argument is the assumption that larger numbers are less likely to
be chosen by the number writer than small numbers. It is that crucial piece of
knowledge that allows the probability to sway from 50%. That is the whole
purpose of the coin flip or the gaussian equation: to reflect that piece of
knowledge in your guesses. To take the idea to the extreme, if I know that
there are only two numbers then I can win 100% of the time.

In conclusion, the point is that this method doesnt work in all, or even most
cases; only in cases in which you KNOW that larger numbers are less likely to
be chosen than small numbers. Furthermore, how much better than 50% you can do
depends completely on how well your approximation function (the gaussian
function or flipping coins) accurately reflects the smaller probability of
larger numbers. Now if you want to deal with people, the number of ways in
which people generate random numbers is so large that I am hard pressed to
believe that you can find an accurate enough approximation function that will
work across the population. For example, try playing this game with your 12
year old nephew who just learned about million, billion, and googleplex and
you are likely to do no better than 50%.

~~~
logicallee
[http://pastebin.com/akQRtDH3](http://pastebin.com/akQRtDH3)

~~~
chacham15
Your "base case" is correct, no argument there and so is your secondary
example. The error comes in by looking at specifics instead of the whole. The
probability of success using a strategy is the sum of (the probability of
success in a case multiplied by the probability of that case) for every case.
Now, since the set of integers is infinite, the sum probability of having the
first number you see be less than one googleplex if the number is chosen
completely at random is 0 (not just "really small" like 1/2^googleplex, so
small that it is zero in the sense that lim(x->inf)1googleplex/x IS zero).
Therefore the chance that you will get numbers which will lead you to have a
probability over 50% is 0.

------
Jabbles
That assertion that you can win more than half the time at "guess the higher
number" sounded weird, but testable.

[http://play.golang.org/p/E1L9spOjBk](http://play.golang.org/p/E1L9spOjBk)

Cool.

~~~
svedlin
A nice related puzzle involving a choice between only 2 numbers:
[http://plus.maths.org/content/mathematical-mysteries-
getting...](http://plus.maths.org/content/mathematical-mysteries-getting-most-
out-life-part-1)

------
another-one-off
For me, the fun part of articles like this is convincing myself it could never
work, then re-reading the article a few times and discovering that it does.

That being said, when they talk about the marriage problem I wish they
wouldn't talk about it in terms of "at most 100 candidate spouses". Not even
mathematicians start life saying "I will have 100 potential partners in life".

The "marriage" problem is a strategy for selecting the best item amongst k
items. The strategy for finding the best item full stop hinges on how the k
items are selected. Both in marriage and hiring (the two obvious places to
apply this sort of thing), where the pool is drawn from has a much bigger
impact than getting the best person in the pool.

Take hiring as a better example than marriage (because with jobs it often the
case that there are a known, finite number of applicants). Most of them will
be people who are difficult to employ, floating around in the job market. If
you wanted the real 'best', you need an aggressive poaching strategy rather
than a best-in-the-pool strategy.

~~~
lovemenot
Different scientists approach the marriage problem in different ways:

[http://www.theatlantic.com/health/archive/2012/08/better-
tha...](http://www.theatlantic.com/health/archive/2012/08/better-than-a-dog-
anyhow-tireless-romantic-charles-darwin-on-the-pros-and-cons-of-
marriage/261197/)

------
capkutay
Has anyone tried gambler's ruin in real life? Theoretically, you have the best
odds of doubling your money if you put all your money down on one hand.

Given most casino games, your odds of winning a single game is less than 50%.
So lets say you encounter the best case; your odds of winning are 49%. Even
then, for every game you play, you are more likely to lose money.

Probability of winning = .49

N = number of times you play

.49^N will become a smaller number as N gets bigger.

[http://en.wikipedia.org/wiki/Gambler's_ruin](http://en.wikipedia.org/wiki/Gambler's_ruin)

~~~
DanBC
This is described in "the Newtonion Casino" (an amazing book about a bunch of
people who build 8080 computers into their shoes to beat roulette wheels).

Roulette is rigged in such a way that the best strategy is to not play. But,
after that, you take all the money you would ever play on roulette and put it
on a single number.

They talk about some of the other systems. They also talk about the skill of
the croupiers to throw the ball such tha they can predict roughly (enough to
beat the odds) where it'll land.

------
evanwolf
Would the "place all your money on the first hand" apply to venture investing?
;-)

