If there was a surprise result in Tuesday’s election returns — aside from David Grosso’s not-particularly-shocking dispatch of incumbent at-large D.C. Council member Michael A. Brown — it was that Council Chairman Phil Mendelson (D) won his race to keep his post by only 45 percentage points, or 92,000 votes.

Sound like a landslide? Well, yeah, it was. But consider that other incumbent Democrats did a lot better than Mendo’s 149,804 votes. President Barack Obama (222,332), Del. Eleanor Holmes Norton (206,664), Shadow Sen. Michael D. Brown (172,614) and Shadow Rep. Nate Bennett-Fleming all did better than Mendelson, who has been near bulletproof in Democratic primaries since 1998.

Adding to the mystery: Opponent Calvin H. Gurley is not a particularly well-known candidate. Frankly, he’s known hardly at all. In 2010, Gurley was tossed from the mayoral Democratic primary ballot and proceeded to run as a write-in. (There were 248 write-in votes among 133,854 cast.) This spring, he won 268 votes in a unsuccessful Ward 4 Democratic primary run. Aside from gathering petitions and a scattering of street signs, he had virtually no campaign presence and has raised virtually no money.

And yet, this time, 57,119 votes — 27.2 percent! He didn’t win any precincts, but he came startlingly close in a few. What gives?

Alas, in my Tuesday tour of polling places, I neglected to ask voters about the chairman race, given that the outcome was a foregone conclusion. Gurley has not yet returned a phone call seeking his explanation. Mendelson offers this: “There’s a phenomenon around voting for people who don’t run campaigns. I can’t explain it.”

Mendelson noted that in 2010, he received a brief scare from Michael D. Brown, who ran against him mainly relying on the fact he shared a first and last name, if not a middle initial, with a sitting at-large council member. Those concerns turned out to be overblown, and Mendelson won with 62.5 percent. Gurley, of course, doesn’t even have a whiff of name recognition.

So that, in my mind, leaves three explanations, and reality probably involves the latter two. That 27.2 percent represents either (a) people who know Gurley and like him, (b) people who know Mendelson and don’t like him, and (c) who don’t know either Mendelson or Gurley and picked randomly — or, perhaps, by affinity. Hold that thought.

Explanation (a), we can agree, doesn’t explain much, given Gurley’s previously hyperlimited appeal. Mendelson disputes explanation (b), citing his anecdotal popularity and Washington Post polling numbers — which gave him relatively high 50 percent name recognition among the city electorate. “My negatives are among the lowest,” he said.

Then there’s explanation (c) — the random vote. If half of voters know Mendelson and generally have a positive impression of him, plus half of voters don’t know who Mendelson is and choose randomly between him and Gurley, Mendelson could then expect to get 75 percent of the vote. Voila — pretty close to the 71.5 percent he actually got!

But that distribution assumes the half that don’t know Mendelson have no other clues as to whether they have an affinity with him or not. In other downballot races — like the shadow seats — party makes a difference, because most voters are Democrats and there is only one Democrat running in each race. Because the chairman’s race is technically a special election, there are no primaries, and both candidates ended up being Democrats, meaning low-information voters have no partisan clue on who to vote for.

So then there’s the more subjective matter of demographics. Let’s assume for the sake of argument, lacking any other information, voters will divine their race/class/income affinity with a candidate based solely on his or her name. In other words, if a candidate has a name that sounds white or black or upper-class or working-class, a voter might be more inclined to vote for them if they shared that background. Is there support for that in the election results?

Yes and no. Looking at the map above, Gurley’s performance correlates pretty strongly to the location of African American voters — i.e., he did better in black precincts than white precincts — suggesting perhaps that low-information black voters chose the guy with the black name over the guy with the white name and vice versa. (Yes, Gurley is black, and Mendelson is white.) But you also have to weigh this: Polling suggests Mendelson’s name recognition and favorability is higher in areas heavy on white voters than in areas heavy on black voters, meaning more black voters will be picking randomly than white voters. What’s the net effect? Hard to say without doing more work than I’m willing to do for this blog post.

Long story short: Polling, mathematics and random chance explains Gurley’s surprising showing, or at least the bulk of it.