The running joke is that the lottery is a tax on those who can’t do math.

But on occasion, we see the opposite — people who are very, very strong in math not only play the lottery (or as jokingly noted in this cartoon, gamble), but walk away with their pockets flush with newfound money. A recent case in Massachusetts is one of those examples.

Cash Winfall is a rather generic lottery game in the state.Pick six numbers out of 46.  Get them all correct, win the jackpot. There are prizes for getting two numbers right (a free ticket), three (\$5), four (\$150), and five (\$4,000) as well — in total, your odds of winning something are better than 1:7. There are drawings twice a week (Monday and Thursday) and tickets cost \$2 each. The jackpot begins at \$500,000, but if it is not won — and it has only been won once in the game’s seven-year history — it progressively increases until it hits \$2 million, when it is reset. The state makes over \$10 million each year on the game. And a few times each year, as reported by the Boston Globe, a bunch of players also make out like bandits.

The details are a bit hazy as those who are beating the game are loath to talk about it. But the basic story is as follows.

When the pot breaks that \$2 million ceiling but goes unclaimed, again, it gets reset to \$500,000 for the subsequent drawing. But instead of simply resetting the \$2 million jackpot to \$500,000 and keeping the \$1.5 million (or more) overage, the state rolls the excess money into the secondary prizes. During these “rolldowns,” the secondary prizes can, and have, hit ridiculous amounts, depending on the amount of excess money in the pot and the number of tickets purchased for the rolldown drawing. Take, for example, the payouts as of July 14, 2011 (screenshot via here). Because of the nearly \$1.9 million of excess money available, and because relatively few tickets were sold, all the secondary prizes were greatly increased. Instead of winning \$5 for hitting 3 of 6 numbers, you would win \$26. Instead of winning \$150 for hitting 4 of 6 numbers, you’d get \$802. Instead of winning \$4,000 for hitting 5 of 6, that feat would cash out to the tune of \$19,507. (And historically, that’s a low amount for a rolldown; once, the 5 out of 6 prize was over \$100,000.)

Say you spend \$100,000 on the tickets, each \$2. That’s 50,000 entries. The odds of getting 4 of 6 numbers correct are about 1:800, so you will roughly break even from that alone. You’ll hit 3/6 about 1,000 times — that’s \$26,000. And you may hit that 5/6 mini-jackpot once or even twice, adding another \$25,000 to \$100,000 to your saving account — and yes, that is on top of the \$100,000 you spent to get the tickets.

And this is exactly what some people are doing. A statistical rundown suggests that purchasing that same \$100,000 all but guarantees breaking even, at worst (unless someone wins the \$2 million plus grand prize, in which case there’s no rolldown from which to benefit). One couple, the Selbees — who run a gambling/investment firm out of Western Michigan — spent over \$300,000 on Cash Winfall tickets just before the July 14th drawing. It was not their first time the Selbees tried to exploit the rolldown drawing: to date, they have claimed over \$1 million in prizes.

The lottery has taken some measures — for example, limiting the number of tickets a person can purchase at one time — to prevent this loophole from being further abused. (And the press and visibility around the opportunity should take care of it, regardless.)

Bonus fact: In 1999, Jesus Leonardo was eking by doing odd-jobs, painting homes and cleaning windows. On occasion, he’d try his luck, though: not at the lottery, but on the ponies. He’d go to a New York City OTB — off-track (horse) betting establishment and place a bet or two. One night, like many before, he threw away his losing tickets. But that night, a correction came over the while a short time after, turning one of his losers into a \$900 winner. Unfortunately, the ticket was in the garbage, and without the ticket, he was unable to cash out his winnings. The OTB manager allowed him to sift through the hundreds of discarded tickets that evening, and while Leonardo did not find his ticket, he found two others worth a total of \$2,000. He spent the next ten years doing more of the same, turning ticket sifting into his full-time job. It paid him, on average, about \$40,000 to \$50,000 a year. (Leonardo has since moved on; OTB shut down at the end of 2010.)

From the Archives: The Luckiest Dessert in History: How 110 people each won a second-place Powerball prizes… because of what they ate.

Related: The Perfect Solutions Talking Lucky Lottery Number Picker. Recommended because it is ridiculous, not because it works. (Odds are, it doesn’t.)