Category Archives: math

Gambling on the Martingale Strategy

Suppose for a minute that you just wagered 25 cents on the outcome of a coin flip with a friend. The coin flip happens, you call "heads" while it's in the air, but after it falls, it comes up "tails". You've lost.

Your friend offers you the chance to go again. You take it, but you double the size of your bet to 50 cents. The coin is flipped and you call "tails", but it comes up "heads" and you lose again. Now, you're down 75 cents. Your friend offers you another chance to play.

Once again, you take it. But once again, you double the size of your bet, raising it to one dollar (or 100 cents, if you prefer). This time, the outcome of the coin toss matches your call, and you win. You've gone from 75 cents in hole to a net gain of 25 cents compared to when you started playing.

You may not realize it, but you've been using the martingale system (or strategy) in choosing the size of your bets. The strategy was first put forward by French mathematician Paul Lévy, who realized that one winning bet was all that was needed to turn around and fully reverse the outcome of a series of losing bets. Of course, the catch is that you have to have sufficient resources to weather the losses while you're racking up losing bets and realistic odds of eventually winning your wager to make it work for you, but if you want to learn more about the mathematical insight behind it, check out the following 19 minute Numberphile video featuring Tom Crawford.

If you're ready to head to the casino after seeing the video, you can rest assured you will not see any games where you have a 50% chance of winning or losing. There are some games that come close to those odds, but the potential rewards will be less.

With some modifications, you could apply the system to investing, but you'll find that approach has many of the same limitations:

Drawbacks of the Martingale Strategy

  • The amount spent on trading can reach huge proportions after just a few transactions.
  • If the trader runs out of funds and exits the trade while using the strategy, the losses faced can be disastrous.
  • There is a chance that the stocks stop trading at some point in time.
  • The risk-to-reward ratio of the Martingale Strategy is not reasonable. While using the strategy, higher amounts are spent with every loss until a win, and the final profit is only equal to the initial bet size.
  • The strategy ignores transaction costs associated with every trade.
  • There are limits placed by exchanges on trade size. Therefore, a trader does not receive an infinite number of chances to double a bet.

Don't forget that time is one of the transaction costs you pay. So are opportunity costs, because you may have other, better things to do with your stake that you are passing up by trying to come out just slightly ahead in continuing to play the same game you started losing.

The Logistic Map and the Emergence of Complexity

What's the connection between a dripping faucet, the Mandelbrot Set, a population of rabbits, thermal convection in a fluid, and the firing of neurons in your brain?

That's the lead question asked in the following under-19 minute video by Veritasium exploring the logistic map, in which very complex and chaotic outcomes follow from very seemingly simple math relationships.

If you'd like to play around with the logistic map for modeling the population of rabbits over time, using the equation:

Xn+1 = rXn(1 - Xn)

We've built a simple tool to make it easier to cycle through the outputs for whatever parameter values you choose to enter. If you're reading this article on a site that republishes our RSS news feed, please click here to access a working version of this tool our site.

Logistic Map Parameter Values
Input DataValues
Percentage of Maximum Population (Xn)
Growth Rate (r)

For added fun, we'll note that bifurcated behavior has also been observed in stock prices. A 2014 paper by David Nawrocki and Tonis Vaga describes that scenario:

We propose a bifurcation model of market returns to describe transitions between an 'over-reaction' mean regressive state and 'under-reaction' trend persistent states. Since July 1929, the Dow Jones Industrial Average has exhibited non-stationary state transition behavior, including: (1) mean regressive behavior during crisis situations during the Great Depression of the 1930s and again in the crisis of 2008 when the availability of credit was interrupted; (2) strongly bifurcated, or trend persistent behavior from the 1940s through 1975; and (3) more efficient behavior since 1975. The bifurcation dynamic evident in the pre-1975 era is somewhat enhanced by conditional volume and moderate volatility. The bifurcation model is used to develop a quantitative measure of the degree of market efficiency, which indicates that the market has become more efficient, i.e. less trend persistent, since 1975 with the advent of negotiated commissions and computerized trading techniques. Similar findings are presented for the S&P 500 index and the CRSP Value Weighted Index, which represent large capitalization markets.

There's also a 2016 paper by Marzena Kozlowska et al. that points to the "flickering" behavior in stock prices as an early warning signal when the market nears a "bifurcated catastrophic transition", or "tipping point".

We came across both these papers while investigating potential explanations for why long winning streaks and especially why long losing streaks have become less frequent over time. One thing led to another and suddenly we were immersed in the math of rabbit population growth and Mandelbrot sets, which is pretty interesting in and of itself.

Welcome to the world of complexity!...

Say, What’s this Bitcoin Thing We Keep Hearing About in the News?

Bitcoin made big news within the last several weeks, as El Salvador became the first nation to pass a law allowing the electronic currency to be accepted as legal tender within that country.

It became bigger news a little over a week later, when the World Bank declined to support El Salvador's use of the cryptocurrency.

All these actions raise some basic questions. Namely, what is Bitcoin and how exactly does it work? For the answer to those questions, we turned to Grant Sanderson's 26 minute 3Blue1Brown video to find out:

Meanwhile, if you want a real flash from the past, here's the first analysis we saw from an economist on the topic of bitcoin. Here's an excerpt from their recent e-mail on the topic of Bitcoin's adoption by El Salvador.

Bonus Update: What's the future for blockchain ledger transactions? It could be cryptographic proofs, which would be an interesting way to 'compress' Bitcoin ledger transactions into a more resource efficient process (HT: Tyler Cowen).

Counting in Cuneiform

Cuneiform is the world's oldest known writing system. It's also one of the most successful, because its use spans two-thirds of recorded human history. In the following 11 minute Numberphile video, Alex Bellos explains how to write numbers the way the Sumerians, Akkadians, Babylonians, Elamites, Hittites, Assyrians, and Hurrians did!

Be sure to check out The Biggest Math Story of 2020, in which we featured Matt Parker's video describing the world's first known math mistake, which also involves techniques for recording numbers that pre-date cuneiform writing. Just scroll down to the section on "A Year Defined by Mistakes".