On Sunday, David Chang became the first celebrity contestant to win *Who Wants to Be a Millionaire*, landing a $1 million donation to the Southern Smoke Foundation.

Chang’s final guess was a made-for-TV moment. Stumped by the question “Who was the first president to have electricity in the White House,” he phoned a friend (ESPN’s Mina Kimes) and successfully bet it all on her unconvincing suggestion: “Probably Harrison.”

The chef may have beaten the game — but it wasn’t the mathematically sensible choice. If Chang guessed wrong, his winnings would go down to only $32,000. If he declined to guess, he’d still land $500,000. Which is why, if you ever find yourself in the same position, the best bet is *usually* to take the walk-away money.

Matt Zaremsky, Assistant Professor of Mathematics at the State University of New York at Albany, explains why.

To start, the problem at hand is knowing whether a 1-in-4 chance at $1,000,000 is worth more than taking the 500 grand. That might seem easy to answer at a glance, but the math is a bit more complicated.

In order to find the overall value or “expected value” of guessing, we need to find the “weighted sum” of the dollar amounts by adding up the total probabilities. This is basically finding the average of four numbers by adding up the numbers and dividing by four — but in this case, since the probability of winning $1,000,000 is different from the probability of $32,000, we can’t use an average. “Since they’re not equally likely, you do a weighted average using whatever probabilities you have,” Zaremsky says.

Given that Chang is basically guessing at his answer, we can say he has a 1-in-4 chance of getting it right. Answering wrong nets him $32,000. Since three of the four answers are wrong, he has a 3-in-4 chance of getting $32,000.

Adding our 1-in-4 chance at $1,000,000 to the other 3-in-4 chances at $32,000 comes out to a total value of $274,000. To put this another way: If Chang played this situation an infinite amount of times, the average winnings would be a measly $274,000.

“This is obviously worse than just walking away with the $500,000,” Zaremsky points out. What would increase those odds? “If there’s one answer you can definitively rule out, you have a 1-in-3 chance of winning and a 2-in-3 chance of losing.” (In their call, Kimes did rule out one option, Ulysses S. Grant, who ended his term 14 years before the White House went electric.)

With a 1-in-3 chance at $1,000,000 and 2-in-3 chance at $32,000, that gives us an expected value of $354,667. Better than a blind guess at one of four answers, but still not as good as walking away with $500,000.

Okay, so what if you can rule out two answers? In that case, take the bet, says the professor: “If you can definitively eliminate two options, now you have a 1-in-2 chance of winning and a 1-in-2 chance of losing, which gives you an expected value of $516,000. Better than $500,000!”

And if you know the answer, by all means, go for it and win that million. “The way I see it, if walking away gets you $500,000, a wrong answer gets you $32,000 and the right answer gets you $1,000,000, then it’s only worth answering if either you know the answer (duh) or you can for sure narrow it down to two,” Zaremsky concludes.

Of course, it’s great that Chang got lucky and won a big fat mill for the Southern Smoke Foundation, which provides emergency financial aid to hospitality workers, among other things. But to any future contestants blindly guessing at one of four potential answers, just walk. It’s not the sexiest choice, but — with apologies to Zaremsky — math hardly ever is.