# mixedmath

Explorations in math and programming
David Lowry-Duda

So I'm in Zagreb now, and naturally this means that I've not updated this blog in a while. But this is not to say that I haven't been doing math! In fact, I've been doing lots, even little things to impress the girl. 'Math to impress the girl?' you might say, a little insalubriously. Yes! Math to impress the girl!

She is working on finishing her last undergrad thesis right now, which is what brings us to Croatia (she works, I play – the basis for a strong relationship, I think... but I'm on my way to becoming a mathematician, which isn't really so different to play). After a few 'average' days of thesis writing, she has one above and beyond successful day. This is good, because she is very happy on successful days and gets dissatisfied if she has a bad writing day. So what does a knowledgeable and thoughtful mathematician do? It's time for a mathematical interlude -

#### Gambling and Regression to the Mean

There is a very well-known fallacy known as the Gambler's Fallacy, which is best explained through examples. This is the part of our intuition that sees a Roulette table spin red 10 times in a row and thinks, 'I bet it will spin black now, to 'catch up.' ' Or someone tosses heads 10 times in a row, and we might start to bet that it's more likely than before to toss tails now. Of course, this is fallacious thinking – neither roulette nor coins has any memory. They don't 'remember' that they're on some sort of streak, and they have the same odds from one toss to another (which we assume to be even – conceivably the coin is double-sided, or the Roulette wheel is flat and needs air, or something).

The facts that flipping a coin always has about even odds and that the odds of Roulette being equally against the gambler are what allow casinos to expect to make money. It also distinguishes them from games with 'memory,' such as blackjack (I happen to think that Bringing Down the House is a fun read). But that's another story.

But the related concept of 'Regression to the Mean' holds more truth – this says that the means of various sets of outcomes should eventually approximate the expected mean (perhaps called the 'actual mean' – flipping a coin should have about half heads and half tails, for instance). So if someone flips a coin 20 times and gets heads all 20 times, we would expect them to get fewer than 20 heads in the next 20 throws, Note, I didn't say that tails are more likely than heads!

#### Back to the Girl

So how does this relate? I anticipated that the next day of writing would not be as good as the previous, and that she might accordingly be a bit disappointed with herself for it. And, the next day – she was! But alas, I came prepared with sour cherry juice (if you've never had it, you're missing out), and we picked up some strawberries. Every day is better if it includes sour cherry juice and strawberries.

bold, italics, and plain text are allowed in comments. A reasonable subset of markdown is supported, including lists, links, and fenced code blocks. In addition, math can be formatted using $(inline math)$ or $$(your display equation)$$.