Though most mathematicians would agree that playing the lottery is not a good investment strategy, a husband-and-wife team found it to be hugely profitable by hauling in almost $27 million. How? They discovered a math error in Cash WinFall, a lottery game run in their home state of Michigan and in Massachusetts.

With odds of just one in 9.6 million, the jackpot in WinFall is almost never won. When the jackpot rose above $2 million, the game would “roll down” smaller prizes to keep the jackpot from swelling. By buying a large enough number of tickets during “roll down” weeks, the couple discovered they were essentially guaranteed to turn a profit and typically won back 15-20% more than what they gambled. Other players, including a group of students from MIT, eventually figured out the odds and began participating in organized lottery games, ultimately making millions of dollars.

Check out the full story.