Electoral Graphic of the Day, Part 2

The state-by-state data table is populated over at Wikipedia, but the format has changed enough from previous years that it is tripping up my web-scraping code. Until I get around to improving my code, here’s another great election graphic, from the creative minds at XKCD:


Electoral College State of Play this Morning (in a Fair and Efficient Tallying Universe)

I pulled the current numbers as of 7:52 AM off of the New York Times U.S. Presidential Election Tracker, and plugged them into a spreadsheet.

LocaleEC votesJB CountDT CountEst. yet to
JB assured ElectorsDT assured ElectorsIn Play
All done467719649626836262002672580

As you can see, when you allocate electors proportional to each state’s popular vote, minimizing “wasted votes” (see my prior posts on this subject), you have the advantage of some knowledge of the final elector count even before all the counts are in. Even so, it is still a nail biter at this point in that alternate universe.

One final note: The electors assigned on the first row were assigned based on overall popular vote, rather than state by state. Given the “Electoral College Gerrymander” bias toward low-population rural states, which trend Republican, it is likely that the actual “Fair and Efficient” allocation would favor Donald Trump more. I won’t be calculating that result until the full results by state table goes live in Wikipedia.

How I Caused My Own iPhone Messages and Battery Woes

I bought my first iPhone, an iPhone 8 Plus (64 GB storage, 3 GB RAM), about a month after Apple released that model. I keep it up to date with the latest iOS releases. I also keep only a limited number of apps on it, preferring to use the web when possible.

Recently, after it had been running the latest version (13.3) flawlessly for about 3 weeks, the phone started acting up. The first thing I noticed was that the iOS Messages app was hanging and crashing a lot. Then, after about 2 weeks of this, the Messages problems were getting more frequent, and my battery started draining really fast. I was seeing 10-20% drops in battery charge after only half an hour when my phone was sitting and doing nothing. Charging to full capacity could only be accomplished with Battery Saver mode turned on. The phone was always hot. This was quite psychologically unnerving, because my experience in my first 2 years of iPhone ownership had mostly delighted me with excellent phone performance.

Even after following a lot of the standard advice to reduce battery drain in iOS, I wasn’t seeing any improvement. Settings|Battery showed no unusual battery usage by apps, and Settings|Battery|Battery Health showed no decline. I cleaned out the charging port carefully with a toothpick on the theory that there was a current leakage. That also didn’t help. I did see a temporary benefit from deleting a lot of long-running message threads with many attachments. The phone cooled off, Messages stopped its shenanigans, the battery level was again stable, and the phone could again charge reasonably fast. However, within hours, the problem (heat, Messages issues, battery drain) returned. Now, I was wondering if I was going to need to replace my expensive phone after only a couple of years.

A write-up by Rahul Saigal at MakeUseOf.com pointed me in the right direction. The key was looking at Settings|Privacy|Analytics & Improvements|Analytics Data. I discovered that there was one process frequently being trashed by iOS for using too much CPU over an extended time. A web search revealed that process was responsible for syncing calendar data. When I then looked at Settings|Passwords & Accounts, I found the likely reason: multiple entries for the same Outlook.com accounts. I had gone back and forth between using the built-in Mail app and the official Microsoft Outlook app for connecting to my two Outlook.com accounts. I hadn’t realized, but both types of connection were being used to sync with my accounts. On the theory is that must have been caught in a vicious loop, each connection sync triggering the other connection to sync, I disconnected the redundant Calendar, Reminders and Contacts associations.

Today, my phone is working perfectly once again: cool, responsive, full day battery life, and quick charging.

4K Display Blanking Issue – Solved!

I recently purchased a LG 4K monitor, specifically model number 27UL600. After placing and connecting it, I experienced periodic (every 30 minutes or so, for 1-2 seconds) blanking of the screen, a slightly annoying situation.

I had connected it to my home office docking station (the Dell Tunderbolt TB16), which provides 2 display connections: one HDMI and one DisplayPort. The DisplayPort connection was being used for a second (1080p) monitor, and the HDMI port was being used for the new 4K monitor via my preexisting 6-foot cable. This went against some strongly-worded advice in the new monitor’s instruction manual:

Make sure to use the supplied cable. Otherwise, this may cause the device to malfunction.

There were two 3-foot cables provided in the box: one HDMI cable and one DisplayPort cable. I looked closer at my connections, and saw that the 1080p monitor has no DisplayPort input, and was actually connected using passive DisplayPort-to-HDMI converter. I went ahead and swapped to the LG-provided cables: HDMI for the 1080p monitor, and DisplayPort for the 4K monitor. No more blanking issue!

Why did this fix the issue? I have a few theories about the LG-provided cable:

  1. It has been manufactured more recently to handle greater bandwidth, i.e., later HDMI/DisplayPort protocol versions.
  2. It is shorter – so possibly less signal loss/degradation than the 6-foot cable.
  3. It has better strain relief on the connectors, so the pins stay connected more reliably.

Whatever the reason, the lesson is clear: When your fancy new monitor comes with nice new cables, use those instead of just plugging into existing cables.

On President Trump and Popular Mandates

President Trump, in his first week in office, appears to be concerned that he be perceived as having a popular mandate. This is my explanation for his doubling down on the unfounded claim that he would have won the popular vote if it hadn’t been for 3-5 million (!) illegal immigrants voting. Much has been written about how false this claim is, but I won’t waste time on that here.

Both Trump and Clinton failed to achieve 50% of the popular vote, at 62.99 million votes (45.94% of votes cast) and 65.85 million votes (48.03%) respectively. Gary Johnson, the Libertarian candidate, was third place, with 4.49 million votes (3.27%). Jill Stein, the Green candidate, was fourth with 1.46 million votes (1.06%). On top of that, Evan McMullin, an Independent from Utah, won 0.73 million votes (0.53%), and managed to win over 20% of Utah’s popular vote. Indeed, as I have shown in another post, if the states allocated their Electoral College votes fairly and efficiently, the final EC vote tally would have been 261 (Trump)-261 (Clinton)-14 (Johnson)-1 (Stein)-1 (McMullin). I find that interesting, but it doesn’t point to a mandate for anyone. Let us suppose that:

  1. Voters had been allowed to rank their choices.
  2. The actual 2016 results actually reflect the #1 choices that voters would have made.
  3. Since no candidate hit the 270 EC vote mark in the first tally, then there is an automatic runoff. In national rounds, states eliminate the bottom EC vote recipients one at a time, in order from least popular votes (in that state) to most. In each round, they re-allocate their EC votes adding in the lower ranked choices of the ballots where the higher ranked choices have been eliminated. This process iterates until there is a candidate with 270+ EC votes, or there are only 2 candidates with EC votes left. (If my explanation is confusing, watch this short video that explains how single-winner instant runoff elections work.)
  4. Voters who put Stein as their #1 choice may safely be assumed to mostly have put Clinton as their #2 choice.
  5. Voters who put McMullin at #1 may safely be assumed to mostly have put Trump or Johnson as their #2 choice.
  6. Enough voters who put Johnson as their #1 or #2 choice, put Trump as their next choice, which puts him over the top with 270+ EC votes. (A 269-269 draw is also possible, which would punt the choice to the House of Representatives. Here, though, I want to assume a Trump victory.)

In this ranked choice voting (a.k.a. instant runoff) scenario, the President would have both his Electoral victory and a popular vote victory of sorts. Indeed, I imagine much of the current rancor from the Left wouldn’t exist, because there would be more of a feeling that everyone had been represented in the choice. In fact, Trump could look at the instant runoff details, see for himself that up to 4% of his win came from voters who preferred Johnson or McMullin, and adjust his rhetoric to say that he understands his mandate also came from them.

Now, forget my fantasy scenario above, and look again at the actual popular results. Unfortunately, they are much less information rich about the will of the electorate. Even so, Presidents who don’t secure 50% of the popular vote will normally take a look at those “spoiler” votes. They then consider how they might also appeal to and be the president for those voters as well. Indeed, ideally, they should also consider how to have constructive dialog with their major opposition.

Or they could just do as the current President is doing, and blame any problems on certain foreign groups and illegal immigrants.

Added Fair, Efficient Electoral Tally for 2000

I’ve been wanting to do this one, the other election in recent memory where the national popular vote winner lost in the Electoral College (EC). I’m, of course, talking about Bush v. Gore in 2000. I updated my GitHub project, adding a notebook that scrapes the 2000 state-wise results from Wikipedia, and applies my fair, efficient EC tally method. Here’s what I found:

Candidate Party Electoral College Votes Wasted Popular Votes
George W. Bush Republican 263 765,498
Al Gore Democratic 262 863,577
Ralph Nader Green 13 1,197,844
Pat Buchanan Reform 0 448,895
Harry Brown Libertarian 0 384,431
Howard Phillips Constitution 0 98,020
John Hagelin Natural Law 0 83,714
Others 0 51,186
U.S. Total 538 3,893,165

The all-important Florida count would have been a non-story, with no need for the Florida and U.S. Supreme Courts to weigh in. The EC count from Florida would have been Bush 12, Gore 12, and Nader 1, with it being not even close on allocating that last EC vote to Nader. Bush and Gore each had about 50k remaining popular votes after getting their 12 EC votes, to Nader’s 97.5k votes.

Just as in 2016, the real story is that both candidates failed to win a clear majority of the popular vote, with substantial voting for so-called 3rd party candidates. However, in 2000, the popular vote difference between the leaders was much smaller. The baked-in EC advantage for less populous states shows in the fact that the national popular vote loser still got one more EC vote than the national vote winner, even using my method. Recall that my method tries to make the allocation fair and efficient only on the state level, since it’s the states that pick the EC members. Also, in 2000, it is clear that Nader and the Green party caused an election upset for the Democrats, since there is a lot of philosophical similarity between the Green and Democratic parties.

In 2000, the failure of the Democrats to secure the White House can be pinned on voters that chose Ralph Nader and the “winner take all” allocation method. This is especially true looking at Florida, where all those Nader voters would probably have preferred a Gore victory to what happened. (Of course, as I’ve stated before, I would prefer the EC members be allowed to deliberate when no candidate gets the requisite 270 votes in the first round. This would give the 3rd party EC members a chance to caucus and influence. In 2000, this would likely have meant an ultimate 275-263 Gore victory.) By contrast, in 2016, most of the 14 Libertarian EC members would likely have caucused with the 261 Republican EC members, still resulting in a Trump victory.

Added Fair Electoral Tally for 2012

I created a notebook to compute what the Electoral College tally would have been in 2012, had my fair and efficient method been used. As one might expect, Barack Obama would still have won, but at 276-261 (Gary Johnson managing to win 1 vote in CA) instead of the apparent blowout 332-206 he received under the winner-take-all (WTA) system. This is also much more in line with the 51.1%-47.2% national popular vote result, also as might be expected. Both candidates got a bump over the popular percentage: Obama got 51.3% of the Electoral College votes, while Romney got 48.5%. This makes sense, since even under my system, the party more popular in the less populous states gets a representation boost. It’s a fundamental design feature of the Electoral College, and I don’t attempt to diminish the states’ role, like a national popular vote hack would. See the full details in the current commit.

These fantasy tallies make one wonder how different presidential campaigns would be conducted without WTA. I imagine candidates would focus on anywhere they could bump the electoral college count in their favor, and the concept of key “swing” states would fade away. I counted the number of states/districts in 2012 where, under my method, the candidate would have at least 2 more votes than their opponent. It was 19. Only 7 states/districts had a differential of 3 or more.  In 2016, those numbers were 20 and 8. That tells me that much fewer of the states/districts lean heavily partisan than typically thought. Our concept of “red” and “blue” states has been heavily influenced by the WTA system.

Updated Fair Electoral College Tally

I have created a project on GitHub at dwvisser/electoral-fair that scrapes the state results compiled at the Wikipedia page for the 2016 U.S. Presidential Election, and computes a fair electoral college tally according to the methodology I laid out in my blog post, Fair, Efficient State-wise Electoral College Vote Allocation. As you can see for yourself in the Jupyter notebook, the results are as follows:

Party Presidential Candidate Electoral College Voters “Wasted” Popular Votes
Democratic Hillary Clinton 261 1,014,221
Republican Donald Trump 261 443,583
Libertarian Gary Johnson 14 2,089,659
Green Jill Stein 1 1,188,700
Independent Evan McMullin 1 513,253
Other various 0 955,577
Total 538 6,204,993

The “Wasted” column tallies all votes that didn’t manage to count towards securing an Electoral College member. Remember that this number is closer to half of the ~137 million total popular votes under the current “winner-take-all” system. I interpret this as an over 90% reduction (~68M -> ~6M) in “unfairness”. Due to the Wikipedia article’s lumping of all candidates below the top 5 into the “Other” column, I forced the calculations to never assign an electoral vote to “Other”, which would be meaningless. It should be clear that this makes no material difference in the results. California has the largest “Other” count at 147,244. It appears that the largest of these was write-ins for Bernie Sanders, so it is possible that one electoral vote may have gone to him in my allocation method.

In my fantasy ideal implementation of the Electoral College, these electors would be selected by the states, and sent to the U.S. Capitol as an actual deliberative body. Normally, their “moral obligation” is to vote as shown in the table, meaning no winner with the needed 270 votes, which would throw the choice to the House. In my fantasy version, they could have a chance to deliberate when there is no clear immediate winner. This would often be the case in my allocation method, judging by the national popular vote results in 4 of the last 7 elections.

In this year’s election, the Libertarian electors are the ones which could swing the electoral victory. They come from all kinds of states: red, blue, and purple. I see it more likely than not that they would break for the Republican, given the philosophical similarities. Lessig has made the case that the College should break from obligation, and instead give the needed votes to national popular vote victor, Hillary Clinton. He argues this based on the information that has come to light since election day about the  compromised position that Donald Trump is in vis-a-vis Russian hacking. In my scenario, they would be free to do that, too.

Fair, Efficient State-wise Electoral College Vote Allocation

Twice now in recent memory, in the U.S. presidential election system, we have had the popular vote loser still win in the Electoral College. As laid out brilliantly in Lawrence Lessig’s recent blog post, The Equal Protection argument against “winner take all” in the Electoral College, the blame for this can be laid at the feet of the “winner take all” system of allocating electors used by the vast majority of states.

Within that post, a spreadsheet from Atlanta attorney Jerry L. Sims is shared that shows how the electors would have been allocated if each state had allocated them proportional to the popular vote. I was not happy with the methodology, though. They apply an arbitrary requirement of candidates needing a de minimus 5% of the vote in order to get allocated any electors. Looking at California, which has 55 electors, a de minimus 1.8% (~1/55), would have been a more appropriate choice. A 1.8% de minimus should have produced one elector for the Libertarian candidate (who received 2.6%). I suspect it is no accident that a 5% de minimus results in Clinton/Kaine receiving the requisite 270 electoral votes to win. I feel Lessig and Sims went against their own fairness arguments by pressing a thumb on the scales in favor of the two major parties.

In my recent blog post, Presidential Elections Efficiency Gap, I was inspired by the notion of the efficiency gap. The efficiency gap, as nicely explained and illustrated in the Washington Post, is a comparison measure of how fairly voters are represented in legislatures, based purely on votes cast in actual elections. The deeper notion in efficiency gap is that the representatives in an elected body should ideally be selected proportionally to how the populace votes.

Put in the language of the efficiency gap, the most fair representation result is one that minimizes the number of wasted votes, i.e, votes that didn’t ultimately get representation. To that end, I will attempt to lay out a scheme here that, like in the spreadsheet above, attempts to fairly and efficiently allocate electoral votes. In my scheme, I strive to not unnecessarily disenfranchise voters for third parties or independent candidates. I attempt to adhere to the following principles in my scheme:

  1. The number of people voting for electors in each state whose votes are “wasted” should be minimized, within reason.
  2. States independently select their electors, just once. That is, there can be no automatic run-offs or reallocations in the case that no candidate garners 270 electors. That would be adjusting the individual states’ results based on the national result.

Here is the scheme: For each state, define V as the total popular votes cast. Define Vi as the votes cast for electors for the i’th party/candidate, such that ∑Vi=V. E is the number of electoral votes allocated to that state. Bi=⌊E×Vi/V⌋ is the baseline number of electors allocated to the i’th candidate. Ri=Vi-⌈V×Bi/E⌉ is the remaining “unused” popular votes for the i’th candidate. The Ri all have the property that they are less than V/E. We now allocate the remaining electoral votes, E-∑Bi,one at a time by sorting the Ri from largest to smallest. The end result is the Ei, the actual allocation of electors to the college. Taking my earlier California example, using data from the current Wikipedia page for the 2016 election:

Candidate Popular Votes Percentage Bi Ri Ei
Hillary Clinton – DEM 8,696,374 62.28% 34 63,827 34
Donald Trump – GOP 4,452,094 31.88% 17 135,820 18
Gary Johnson – LIB 474,615 3.40% 1 220,715 2
Jill Stein – GRN

275,823 1.98% 1 21,924 1
Others 65,507 0.47% 0 65,507 0
Total 13,964,413 53 (out of 55) 55

How fair is this allocation? At one extreme, Jill Stein gets 1 elector for 1.98% votes cast. At the opposite extreme, Gary Johnson gets approximately one elector per 1.70% votes cast. The two major party candidates fall in the middle. Only “Other”, with just 0.47% of the cast votes, is unrepresented. This seems right, given that 1/E is about 1.8%. Contrast this with the earlier-cited spreadsheet, which with the above vote counts would have still allocated 35 electors to Clinton and 20 to Trump. That’s 1 elector per 1.77% of the popular vote for Clinton, and 1 elector per 1.62% of the popular vote for Trump. However, ~4.7% of the popular votes went unrepresented. I see this as 10 times more unfair than the 0.47% lack of representation in my scheme.

Using the same “townhall” dataset as I considered in my efficiency gap post, here’s the electoral vote tally I come up with:

Candidate Ei
Hillary Clinton – DEM 262
Donald Trump – GOP 261
Gary Johnson – LIB 13
Jill Stein – GRN 2
Others 0
Total 538

The California result was identical to that given here considering the latest data, giving me confidence in the result’s robustness. The earlier dataset showed only a 47.0% of the national popular vote for Trump, while the latest Wikipedia data set shows only 46.1% Trump, with Clinton’s percentage holding essentially constant at 48%. It’s possible that might alter this result by switching as many as 4 electoral votes away from Trump to other candidates, but it doesn’t even come close to affecting the outcome. There are 2 major observations to make about this outcome:

  1. Most importantly, the almost 5.9 million (at latest count) votes cast for the Green and Libertarian candidates get some representation. Admittedly, Jill Stein got over 1% of the popular votes, which one would hope would have translated into about 5 electors, rather than 2. However, as I stated above, the idea in the Constitution that the states pick the electors should be respected. Also, 2 electors is infinitely more representative than zero.
  2. Both the major party candidates are denied the 270 electors needed for a win under the rules of the Electoral College. This outcome shouldn’t be surprising that when the popular vote is close and there’s a big desire for change, pushing many people to third party candidates. Having no Electoral College winner throws the election to the state delegations in the House. The vote would be among the top three Electoral College candidates (Clinton, Trump and Johnson). where it is likely that the Republican candidate would be selected by a vote of 27-24.

It could be argued that a Trump win in the House is itself disproportional, and due to gerrymandering distortion. However, it would still be a valid, legal result, ultimately determined by state representatives. It is up to the courts to solve the gerrymandering issue.