Readit News logoReadit News
pcthrowaway · 9 months ago
Note that you need to be able to infinitely divide your stake for this to work out for you all the time.

For example, if the deck has 26 red cards on top, you'd end up dwindling your initial $1.00 stake to 0.000000134 before riding it back up to 9.08

boothby · 9 months ago
If you start out with a $1e12 stake, you're able to avoid catastrophic rounding errors even in the worst case. There's probably a life lesson here.
cbsks · 9 months ago
My simulation shows that with a 52 card deck, if you round the bet to the nearest $.01 you will need to start with $35,522.08 to win a total of $293,601.28.

If you start with $35,522.07 or less, you will lose it all after 26 incorrect cards.

TeMPOraL · 9 months ago
When Poland first introduced the capital gains tax in 2002, banks were quick to notice the tax law still generally required tax amounts to be rounded to nearest full złoty when accrued, so they started offering financial products with daily capitalization, which were effectively exempt from the new capital gains tax, as for most customers, the daily gain would be low enough that the tax on it always rounded down to zero. This only got corrected 10 years later.

I find it fascinating that we could have a whole class of financial products hinging on something seemingly so trivial as a rounding strategy.

fragmede · 9 months ago
Is the lesson: choose to be born to wealthy parents?
lawlessone · 9 months ago
This sounds similar to the Martingale system.

https://en.wikipedia.org/wiki/Martingale_(betting_system)

Deleted Comment

jmount · 9 months ago
Very good point. I did some experiments and the system is very sensitive to any sort of quantization or rounding of bets. You get the expected value about the right place, but the variance goes up quickly. So in addition to your important case, things are a bit dicey in general.
jmount · 9 months ago
I've added a follow-up note on the case of discrete stakes here: https://win-vector.com/2024/12/21/kelly-betting-with-discret... . It is known there is a dynamic programming strategy that guarantees a return of $8.08 on a $1 bet. Simple rounding of the Kelly strategy does not achieve this.
kamaal · 9 months ago
>>Note that you need to be able to infinitely divide your stake for this to work out for you all the time.

This is what most people discover, you need to play like every toss of the coin(i.e tosses over a very long periods of time). In series, like the whole strategy for it to work as is. You can't miss a toss. If you do you basically are missing out on either series of profitable tosses, or that one toss where you make a good return. If you draw the price vs time chart, like a renko chart you pretty much see a how any chart for any instrument would look.

Here is the catch. In the real world stock/crypto/forex trading scenario that means you basically have to take nearly trade. Other wise the strategy doesn't work as good.

The deal about tossing coins to conduct this experiment is you don't change the coin during the experiment. You don't skip tosses, you don't change anything at all. While you are trading all this means- You can't change the stock that you are trading(Else you would be missing those phases where the instruments perform well, and will likely keep landing into situations with other instruments where its performing bad), you can't miss trades, and of course you have to keep at these for very long periods of time to work.

Needless to say this is not for insanely consistent. Doing this day after day can also be draining on your mental and physical health, where there is money there is stress. You can't do this for long basically.

teo_zero · 9 months ago
While I don't agree on nearly anything you stated, I enjoyed your prose: I suppose you left out words here and there as a metaphorical proof of your claim that you can't miss a single toss, didn't you?
auc · 9 months ago
If you assume coin tosses are independent, it shouldn’t matter if you miss coin tosses.
tgma · 9 months ago
Yup, the dual would be saying Martingale can't fail with infinite money.
aidenn0 · 9 months ago
It's not because there is a finite amount of money at which this can't fail, which is never the case for martingale. Martingale is actually likely to bankrupt you against a casino that is much more well staked than you even if you have a small advantage.
nyeah · 9 months ago
It's a good point. I think it affects the realism of the model. When the stake is very low, finding a penny on the street gives an astronomical improvement in the end results. At the high end, it's possible the counterparty might run out of money.
ab_goat · 9 months ago
Finally a real world use case for bitcoin!
amanda99 · 9 months ago
Bitcoin isn't infinitely divisible, you can't do smaller than one satoshi.
lordnacho · 9 months ago
Interesting side note on Kelly:

In probability theory, Proebsting's paradox is an argument that appears to show that the Kelly criterion can lead to ruin. Although it can be resolved mathematically, it raises some interesting issues about the practical application of Kelly, especially in investing. It was named and first discussed by Edward O. Thorp in 2008.[1] The paradox was named for Todd Proebsting, its creator.

https://en.wikipedia.org/wiki/Proebsting%27s_paradox

dominicrose · 9 months ago
Quoting the same page: One easy way to dismiss the paradox is to note that Kelly assumes that probabilities do not change.

That's good to know. Kelly is good if you know the probabilities AND they don't change.

If you don't know or if they can change, I expect the right approach has to be more complex than the Kelly one.

cubefox · 9 months ago
In particular, then the right approach has to be more risk averse than Kelly would recommend. In reality, most probabilities can only be estimated, while the objective probabilities (e.g. the actual long run success rate) may well be different and lead to ruin. That's also what makes the title "Kelly can't fail" more wrong than right in my opinion.
csours · 9 months ago
Unfortunately, in the real world, playing the game changes the game.

For instance, casinos have different payout schedules for Blackjack based on minimum bet size and number of decks in the shoe. Payouts for single deck Blackjack are very small in comparison to multi-deck games, as well as requiring larger minimums (and they shuffle the deck after only a few hands).

ilya_m · 9 months ago
Beautiful, thanks for sharing it!

I think the portfolio argument is an unnecessary detour though. There's a two-line proof by induction.

1. The payoff in the base case of (0,1) or (1,0) is 2.

2. If we are at (r,b), r >=b , have $X, and stake (r-b)/(r+b) on red, the payoff if we draw red and win is X * (1+(r-b)/(r+b)) * 2^(r+b-1) / (r+b-1 choose r-1) = X * 2^(r+b) * r / ((r+b) * (r+b-1 choose r-1)) = X * 2^(r+b) / (r+b choose r).

Similarly, if we draw black and lose, the payoff is X * (1-(r-b)/(r+b)) * 2^(r+b-1) / (r+b-1 choose r) = X * 2^(r+b) * b / ((r+b) * (r+b-1 choose r)) = X * 2^(r+b) / (r+b choose r). QED

lupire · 9 months ago
Why isn't your inductive proof an unnecessary detour?
fancy_pantser · 9 months ago
A very similar card game played by deciding when to stop flipping cards from a deck where red is $1 and black is −$1 as described in Timothy Falcon’s quantitative-finance interview book (problem #14). Gwern describes it and also writes code to prove out an optimal stopping strategy: https://gwern.net/problem-14
snthpy · 9 months ago
Nice!

Only quibble i have is that black should be +$1 and red -$1 to follow standard finance conventions, i.e. be in the "black" or "red".

jmount · 9 months ago
That is a nice game and writeup.
PaulHoule · 9 months ago
When I was a teen I discovered that I could always guess more than half the cards right using card counting to determine what color is more common in the deck. I programmed my

https://en.wikipedia.org/wiki/TRS-80_Model_100

to simulate it and it never failed. Recently I thought about it again and wrote a Python script that tried it 30 million times and... it never failed.

I've been thinking about what to do with it and came up with the options of (i) a prop bet and (ii) a magic trick, neither of which seemed that promising.

As a prop bet I can offer $1000 to somebody's $10 which is not the route to great prop bet profits, also I worry that if I make a mistake or get cheated somehow I could be out a lot of money. (Now that I think of it maybe it is better if I re-organize it as a parlay bet)

As a magic trick it is just too slow paced. I developed a patter to the effect that "Parapsychologists were never able to reliably demonstrate precognition with their fancy Zener cards, but I just developed a protocol where you can prove it every time!" but came to the conclusion that it was not entertaining enough. It takes a while to go through a deck which doesn't seem like a miracle, you will have to do it 7 times in a row to exclude the null hypothesis at p=0.01. Maybe somebody with more showmanship could do it but I gave up.

jdhwosnhw · 9 months ago
That reminds me of my favorite algorithm, which can find the majority element in a list with any number of distinct entries while using O(N) time and O(1) space (provided a majority element exists). I sometimes pose deriving this algorithm as a puzzle for people, no one has ever solved it (nor could I).

https://en.m.wikipedia.org/wiki/Boyer%E2%80%93Moore_majority...

lupire · 9 months ago
What's great about that is that the assumption (or O(n) check) that the majority exists is incredibly powerful, enabling the algorithm, which is nearly the dumbest possible algorithm, to work.

The one flaw in the magic is that "2nd pass to verify" is a significant cost, transforming the algorithm from online streaming O(1) space to O(n) collection-storage space.

barapa · 9 months ago
That is really cool
thaumasiotes · 9 months ago
> Recently I thought about it again and wrote a Python script that tried it 30 million times and... it never failed.

There are enough possible card sequences that you might be concerned about your source of pseudorandomness failing to exhaust the space. Simulations can give you very misleading results when that happens.

Even if you do have enough entropy, 30 million trials is definitely not enough.

JohnMakin · 9 months ago
Kelly criterion is one of my favorite game theory concepts that is used heavily in bankroll management of professional gamblers, particularly poker players. It is a good way to help someone understand how you can manage your finances and stakes in a way that allows you to climb steadily forward without risking too much or any ruin, but is frequently misapplied in that space. The problem is kelly deals with binary results, and often situations in which this is applied where the results are not binary (a criteria for applying this) you can see skewed results that look almost right but not quite so, depending on how you view the math
amluto · 9 months ago
> particularly poker players

The Kelly criterion seems excellent for many forms of gambling, but poker seems like it could be an exception: in poker, you’re playing against other players, so the utility of a given distribution of chips seems like it ought to be more complicated than just the number of chips you have.

(I’m not a poker player.)

tempestn · 9 months ago
It's used for bankroll management (basically deciding what stakes to play) rather than for sizing bets within a particular game.
fernandopj · 9 months ago
Chris "Jesus" Ferguson "proved" an application of this theory back in ~2009 [1]. He was a the time promoting Full Tilt and commited to turn $1 dollar bankroll to $10000 by applying a basic strategy of never using more than a low % of his bankroll into one tournament or cash game session.

So, if one's skill would turn your session probability to +EV, by limiting your losses and using the fact that in poker the strongest hands or better tourney positions would give you a huge ROI, it would be just a matter of time and discipline to get to a good bankroll.

Just remember that for the better part of this challenge he was averaging US$ 0.14/hour, and it took more than 9 months.

[1] https://www.thehendonmob.com/poker_tips/starting_from_zero_b...

Deleted Comment

kqr · 9 months ago
> The problem is kelly deals with binary results,

Incorrect. https://entropicthoughts.com/the-misunderstood-kelly-criteri...

The Kelly criterion generalises just fine to continuous, simultaneous, complicated allocations.

All it takes is a list of actions which we are choosing from (and these can be compound actions with continuous outcomes) and the joint probability distribution of wealth outcomes after each action.

bloodyplonker22 · 9 months ago
You are right that Kelly criterion deals with binary results. This won't work for poker. In poker, we use expected value because wins and losses are not binary because of the amount you win or lose. Once you figure out your approximate EV, you use a variance calculator in addition to that (example: https://www.primedope.com/poker-variance-calculator/) to see how likely and how much it is you will be winning over a certain number of hands in the long run.
peter_retief · 9 months ago
Could this work with roulette betting on color? Seems like you could spend a lot of time not winning or losing
plorkyeran · 9 months ago
Roulette results are uncorrelated and you have the exact same chance of winning each time, so the Kelly criterion isn’t applicable. Betting on a color has a negative edge and you don’t have the option of taking the house’s side, so it just tells you the obvious thing that you should bet zero.
barbegal · 9 months ago
It would have been a better demo if reduced to more manageable numbers e.g. a deck of 2 black and 2 red cards.

Turn 1 r = b so no bet

Turn 2 bet 1/3 on whichever card wasn't revealed in turn 1.

Turn 3 either you were wrong on turn 2 and you now have 2/3 of your stake but you know the colour of the next two cards so you can double your stake each time to end up with 4/3 after turn 3 or you were right and you have 4/3 of your stake but have one of each red or black left so you don't bet this turn.

Turn 4 you know the colour of the final card so you double your money to 8/3 of your original stake.

And then the exercise to the reader is to prove optimality (which is fairly straightforward but I don't believe there is a short proof)

libraryofbabel · 9 months ago
Yes. Although four cards has only one nontrivial branch, on turn 3. So, start out with the four cards example, and then show tree diagrams for the 5 and 6 cards cases (still manageable numbers) to build intuition for induction to the general case.
stevage · 9 months ago
Agreed, I could follow the general argument but not enough to be convinced about why the result is exactly the same regardless of the order of cards.

Deleted Comment

andrewprock · 9 months ago
In practice, there are a number of factors which make using Kelly more difficult than in toy examples.

What is your bankroll? Cash on hand? Total net worth? Liquid net work? Future earned income?

Depending on the size of your bankroll, a number of factors come in to play. For example, if your bankroll is $100 and you lose it all it's typically not a big deal. If you have a $1 million bankroll, then you are likely more adverse to risking it.

What is the expected value? Is it known? Is it stationary? Is the game honest?

Depending on the statistical profile of your expected value, you are going to have to make significant adjustments to how you approach bet sizing. In domains where you can only estimate your EV, and which are rife with cheats (e.g. poker), you need to size your wagers under significant uncertainty.

What bet sizes are available?

In practice, you won't have a continuous range of bet sizes you can make. You will typically have discrete bet sizes within a fixed range, say $5-$500 in increments of $5 or $25. If your bankroll falls to low you will be shut out of the game. If your bankroll gets too high, you will no longer be able to maximize your returns.

At the end of the day, professional gamblers are often wagering at half-kelly, or even at quarter-kelly, due in large part to all these complexities and others.

zahlman · 9 months ago
> In practice, you won't have a continuous range of bet sizes you can make.

You may also be required to pay for the privilege of placing a bet (spread and commissions in trading; the rake at a casino table).