Saturday, January 21, 2017

Before the Women's March

Before heading to the Women's March in Seattle in a couple of hours, I'd like to share something that happened at work a few months ago. You might need to enlarge the picture, it's a bathroom scrawl, not easy to read.

There you go, simple and standard bit of sexist humor, scribbled in a "safe" place where the other people who see it are expected to agree, chuckle, and move on. As you can see, this time I didn't.

After scrawling my angry rejoinder, I shared the picture with my boss and HR rep, who were terrific. We were only a small company sharing the floor at the time, so we hoped it wasn't one of us - and I bet each of the other tenants hoped it wasn't one of them, and the building facilities hoped it wasn't one of them. The other tenants on the floor and building services were notified, and told their employees that the incident had happened, and if any more such behavior was encountered, there'd be a thorough investigation, and a culprit if positively identified could well get fired. Short of taking contortionist handwriting samples from every frequenter of the men's bathroom, I'm not sure what more they could have done. It seems to have sent the right message - at least, we haven't seen anything like this since.

Lots of us, women and men, will go to the march today. That's great. But not everyone can attend. Like a lot of parents, we're fitting it in for a couple of hours in between other commitments today. People have all sorts of reasons for being busy, and if you can't go, don't feel guilty. 

But for men in particular, what we do any other day is as important as what we do today. If we see something like the above and think "hey, it's just a bit of fun in the men's bathroom", then we're part of the problem. If we feel that somehow the real men like this kind of stuff, and it's only wimpy men that feel bad about it, then we're allowing ourselves to be part of the problem. 

Strong men don't demonstrate their prowess by disparaging women, or anyone else. They don't need to. If you want to be strong, stand up for others. Marching today is a great way to stand up. But there are no shortage or other opportunities, day by day. Most times the media isn't watching - the people watching are our friends, colleagues, and the hundreds of people we encounter in small ways as we go about our lives, in the supermarket, the parking lot, at the bus stop, on the sidewalk.

Men, do your part standing up for women. Logically it's just a special case of "people, stand up for other people", but social constructs make it a particularly important special case. Other people will stand with you given half a chance. Be gentle, be strong. Be a gentleman.

Monday, October 31, 2016

Searching e-mail headers is easy

(This is a very specific post about events deemed newsworthy at the end of October 2016, namely, the announcement that the FBI has reopened an investigation because emails found on a computer might be relevant to a previous case. For those that don't know me, I'm a software engineer who's worked at Google and Bing and written some dozens of papers about language and search, so while I don't know all the details of this particular laptop, I'm not just ranting without expertise.)
My professional opinion: the notion that the FBI may take days to figure out if some of 650K emails went through a particular server is nonsense. This is a one-line grep-the-headers command and may take as much as a few minutes on a standard laptop. Doing a more thorough preliminary analysis to see if a few individuals are mentioned by names or synonyms is a bit more work - maybe a couple of hours for a beginner programmer. More detailed topical analysis, now it's getting more fun - about a day's work for an NLP specialist using tools readily available for over a decade.
If you've read any "tech news" articles telling you that FBI agents might spend weeks looking for something vaguely AI-blabber sounding like "metadata", please realize that you're being deceived. The notion that this task takes days is utter nonsense. American readers and voters are being played and manipulated by claiming something is hard that is in fact easy.
From a language-processing point of view, the claim that James Comey had to notify Congress that they'd found a "big box of something" but it would take until after the election to have any idea of whether that big box contained anything relevant is incompetent nonsense.
If instead they're saying that out of those 650K emails, they have to read every one by hand because maybe, just maybe, someone-said-something-to-someone that could count as referring to something that was once at some grade of classification, then that's quite a different proposition. It's not a standard that is applied to any politician other than Hillary Clinton, and the notion that until you've done this you have "no idea what the box of stuff contains" is just not true.
At the very least, we should have a Director of the FBI who has beyond a mid-1980's sense of how hard it might be to search through fewer than 1 million email headers.


My this seems dated now. So as you probably know, a week or later just before the election the FBI reported that after all they didn't have anything new. Hillary Clinton went from a decisive lead in the polls to a dip in the polls, won the popular vote, but lost the presidential election. Given how close the elections were in the swing states that mattered, I suspect that history will tell the story of an election that was marred by scandal, and was decided in the end by the exact timing of when scandals were reported, real or imagined.

Sunday, July 10, 2016

27% is not a Majority, and Leaving the EU Requires an Act of Parliament

It's now a couple of weeks since the Brexit referendum. The question on the ballot was "Should the United Kingdom remain a member of the European Union or leave the European Union?" and a majority of the votes cast were for "Leave". Since democracy is the rule of the majority, and the majority voted to leave, some say that the decision to leave the EU has been made democratically, and any objections to this decision are anti-democratic sour grapes.

I disagree, and I've been asked (in this case, by my mother) to explain why I disagree. Here are the reasons why leaving the EU without an Act of Parliament would be both undemocratic in the short term and destructive to the UK's democratic constitution in the long term.

Of course, our constitution is unwritten, and so the process for changing it isn't formalised. We go by tradition, precedent, common law, and common sense.

The mandate for constitutional change is insufficient

In the referendum, 17.41 million votes were cast for "Leave" and 16.14 million were cast for "Remain". The population of the UK is 64.1 million (World Bank estimate). So about 27% of the population voted to Leave, about 25% voted to Remain. Moreover, the largest disenfranchised group (those under 18) would probably have voted strongly to Remain.

So the statement "A majority of the people voted for Brexit" is not true, not even close. If we had a formal constitution and an official process for changing it, I would wager that a popular vote of 27% to 25% would not be enough. (In the USA, for example, one of several conditions such as "ratified by three quarters of the State Legislatures" must be met.)

The campaign and result could probably not be repeated

We're used to election campaigns involving contested claims and exaggeration, but this one was extreme. This has been pointed out many times already, so I'll be brief. There's no £350 million a week coming back, immigration is not being curtailed, for those who wish to curtail immigration the path is entirely unclear, but the House of Commons has voted by 245 to 2 to guarantee that EU citizens living in the UK will have the right to remain. Given the obvious public unravelling of the Leave campaign's promises and its leadership, and some already clear economic damage, it is very unlikely that the referendum result could be repeated.

The referendum is not a mandate for a particular policy

In the weeks since the referendum, the UK's position is less clear than ever. It's clear that a deal with the rest of the EU to maintain free movement of goods but not of people is very unlikely, and that there are a baffling array of options in between staying in the EU and abandoning free trade between Britain and Europe altogether. The Leave vote is not a vote for anything except "not being in the EU". It did not set forth a particular option for relations with the rest of Europe, and almost every member of Parliament was elected on a manifesto that advised staying in the EU. The British people may have voted about something that's not wanted, but have not voted about what is wanted.

The only legitimate way forward involves Parliament

There isn't much precedent for using referenda in Britain, but what precedent there is says that referenda can be used in conjunction with Parliament, not instead of it. In the process whereby the UK joined the EEC in the 1970's (the only real precedent), the referendum result was much stronger (67% majority), but it was never used instead of passing laws in Parliament.

So far the only legal alternative to Parliament I've read about is the idea of using Royal Prerogative to pass laws relating to leaving the EU, apparently suggested by government lawyers. You don't need to be a constitutional lawyer to know that in theory the Crown can pass and rescind whatever laws it likes, but a monarch who does this in practice risks losing a Civil War, getting their head chopped off, and bringing down the monarchy. Of course I don't mean this as a threat, I certainly don't want it to happen! But the Queen is probably more aware of her role than anyone else alive, and the idea that she may make an exception from her well-known avoidance of politics and abolish an Act of Parliament without consulting Parliament, on an issue so controversial that England and Wales might go one way and Scotland and Northern Ireland another - well, even if that's legal it's still preposterous. If the government or the monarchy wants to nullify laws passed by Parliament, they have a perfectly legal and practical way of doing it - by asking Parliament.

This does leave the option that the Government might try to invoke Article 50 (giving notice of an intent to withdraw from the EU) without Parliament's consent, presuming that Parliament will cooperate later in repealing the 1972 European Communities act and many other pieces of legislation. But presuming that Parliament will comply with all this is a very risky alternative compared with asking first!

What if Parliament doesn't cooperate?

Let's briefly consider the reasons for not consulting Parliament.

  •  Parliament might vote against triggering Brexit by invoking Article 50.
    • It might. The alternative, "Don't ask Parliament because they might disagree", sounds utterly illegal and contrary to  Parliamentary Sovereignty, which is the very first principle of British politics.
  • Parliament might vote in favour of triggering Brexit, but that's against the manifesto promises of most MPs.
    • MPs are representatives, not delegates. If they choose to vote differently from their manifesto promises, that is legal and has many precedents.
  • The Government needs to negotiate with other EU countries before it can bring a bill before Parliament.
    • Nonsense. There is nothing stopping the Government from bringing forward a bill that asks for permission to negotiate.
  • It might lead to enough controversy to bring down the Government in a vote of no confidence, triggering a general election.
    • If the Government can't pass its most important legislation through Parliament, that's exactly what a general election is for. General elections are a costly, uncertain, and time-consuming process - but given that the whole Brexit process is already all of these things and more, the notion of doing something unconstitutional instead of holding a general election is crazy.
Can these arguments be dismissed as motivated reasoning? Something like "You wanted Remain to win anyway, of course you'll throw obstacles in the way of a Leave victory". Well, I do want the UK to remain part of the EU, but in this case that's not the point. The point is that overriding Parliamentary Sovereignty using an unlikely alliance between a 27% referendum vote and Royal Prerogative would set a terrible precedent. If the Government passes proper legislation to leave the EU, I'll be disappointed, I admit that. But if the bill is honest, properly worded, sensibly debated, and passed by Parliament, I'll be the first to accept its legality.

The Crown can be asked to dissolve Parliament, but not to ignore it. The people have the right to replace Parliament, but not to ignore it. These are the cornerstones of Britain's rather ad hoc but surprisingly robust democracy. It's not perfect by any means, but over the centuries it's done pretty well, particularly at avoiding the worst forms of oppression. Let's not give up our most cherished principles because of a narrow vote on a single day.

What should you do?

If you agree with this conclusion, please feel free to share and promote this article. But much more importantly for those living in the UK, write to your local MP. If you're below voting age, or a foreign national not allowed to vote in the referendum, they are still your local MP and you should write to them. This is not just for Remain supporters - if you're a Leave supporter, please write to your MP and say that Parliament should immediately put its authority behind the referendum result. This is one of those times in our history when Britain urgently needs Parliamentary leadership.

Wednesday, June 22, 2016

Why Britain Should Remain in the European Union

If I was voting with just my head tomorrow, I would vote Remain.

It should be enough that the UK pound and financial markets have taken a battering on just the fear of leaving. It should be enough that so many major economic leaders and institutions advise us to stay. That in spite of the popular myth to the contrary, actual data shows that immigrants are net contributors to the benefits system, not net takers. That millions of British retirees in other European countries are likely to be victims of Brexit, as well as younger working-age people in Britain. That stories about freeloading European countries taking Britain's money and Britain getting nothing in return are so easily debunked. That surveys demonstrate that "average British beliefs" about how much of our tax money flows to and from the EU are utterly misinformed. That I and my children can live and work in so many places from Ireland to Greece, and that's not something we would risk lightly.

But the referendum has clearly not been about voting with our heads. We're voting with our hearts as well. Would I vote differently?

The Remain campaign has looked lacklustre. It doesn't get people whipped up or nearly so passionate. As a parent I understand that: it's hard to make "Don't risk hurting yourself just to prove your independence" an inspiring message. If you show a picture of what hurting yourself might look like, you're scaremongering. If you don't, you're just being a wimp. But if I can explain that to a child about jumping down the stairs in a pillowcase, it shouldn't be so hard to explain it to grownups voting about their political and economic future. Perhaps my heart isn't immediately excited about staying in the EU. But is excitement really the point?

By contrast, the Leave campaign has looked ugly. Pictures of how wicked foreigners are. How we're being either overrun by underling dark-skinned swarthy types, or overlording light-skinned calculating types. About how everything is "us" versus "them". About how all the "them" must be kept away from "us". Not facts, not data, not research, not all the boring nerdy stuff that should go into actual policymaking. Just appealing to the idea that I should belong to a tribe, and feel threatened by every other tribe. The Leave campaign, and nearly all the material I've seen shared and circulated to promote it, does stir my emotions. It makes me ashamed that anyone would think that this is what being British should mean.

If I was voting with just my heart tomorrow, I would vote Remain. 

Saturday, March 19, 2016

The Weakness of the Arguments Against Hillary Clinton

I've been staying mute on politics but I'm going to make an exception.

Wave after wave of anti-Hillary mouthing is gradually making me gently but firmly pro-Hillary. Just reading random news and other people's feeds over the past week I've heard all of the following arguments:

"She won't be able to win in all-important swing states."
Like Ohio and Florida?

"It's wrong that all those superdelegates are going to vote for her."
She's currently nearly 40% ahead in the regular delegate count.

"I have lots of friends who say they won't vote for her. Like really really won't vote for her ever ever."
That's not how national elections are decided.

"She sounds shrill."
The person behind the microphone should have a deeper voice - but it's not about sexism?

"She must be dishonest, look at all those investigations into her."
When investigation after investigation leads to no indictment, that sounds like an ever-more-desperate smear campaign.

So I guess in my own way I too am done with politics-as-usual and angry at the establishment. There isn't any other person in the United States who's been more targeted by the establishment over and over again than Hilary Clinton. The more successful she is, the more specious the arguments against her become.

At this rate, I'm probably going to vote for her.

Saturday, June 27, 2015

The Day Marriage Equality Became the Law of the Land

On February 14th, 2004, thousands of couples were lining up to get married at City Hall in San Francisco. In a strange quirk of fate, we found ourselves in a great crowd of people - we accidentally chose to get married the same weekend that the city began to suddenly issue marriage licenses to same-sex couples! After some initial confusion about where to line up and how to get the papers we needed in the pandemonium, the historic nature of the events gradually dawned on me. Like being an immigrant for the first time, sometimes it takes a jolt of someone else's reality to see the basic wrongness in classifying people as "normal" and "other". And of course I grew up in Yorkshire, not San Francisco, so a lot was still new to me. It gave me a lot to ponder for several days, and among other things I wrote and we recorded this song.

Six months to the day later, on August 14th, we were back in San Francisco. We'd moved to Pittsburgh, Pennsylvania, but we got a slot for a green-card interview back in San Francisco, and so back we went. While we were there, the court ruling came through that the marriages from that day six months earlier were null-and-void. Luckily again for us, the headlines were one bit overblown - it wasn't all marriages from that day, the court was, ahem, discriminating enough to let the handful of straight marriages stand. It was unfair and depressing, and all too aware of the situation, we had a lot of survivor's guilt.

In a surprise turn, Maryl and I found ourselves invited to speak and even sing in front of a rally that evening, in front of the same City Hall where we were married. We were introduced, not surprisingly, as "a couple whose marriage would stand", and understandably when they saw us, most of the crowd were probably as surprised as we were. I remember, we talked of the privilege of marriage, how as an international couple it was crucial to our being able to stay together, and how irrational it was to make immigration and any number of other legal decisions based on your partner's gender. We said it was wrong, and that we would do our best to help put it right, which people appreciated.

Then what I remember saying was something like the following:

"Our culture does not protect freedom by restricting freedom. We don't protect democracy by saying that only males can vote. We don't protect liberty by saying that only white people can be free. We don't protect the Bible by saying you can only read it in Latin." (A few chuckles.)

"And we don't protect marriage by saying that only straight couples can marry!" (Reverberating cheers.)

"Today we're still together, still married. But for the sake of freedom to love each other, our marriage will not be fully complete, will not be fully consecrated, until everyone shares that freedom." And then we sang the song, and people started to join in the chorus, "Those who love has joined together ever will united be."

And it came to fulfillment today, June 26th 2015. The Supreme Court of the United States issued a ruling saying that barring same-sex couples from being legally married is in conflict with the Fourteenth Amendment to the Constitution, which includes "No State shall make or enforce any law which shall abridge the privileges or immunities of citizens of the United States".

It has come true, we have come so far together, cherishing the love we had then and seeing it grow so much already. My heart goes out to the whole nation, especially to those whose rights are sundered no longer. May those who are hurting find peace in their hearts across the country. May we all find freedom from the very idea that freedoms for one group must be taken from another. But selfishly, my heart is at home tonight. For some of the years in between, we thought we'd glimpsed something that was right, that was coming, but that was not to be for decades. We were wrong. Tonight I'm happy as well for us, for our freedom to marry, that was once restricted, is consecrated today.

Tuesday, March 31, 2015

Round the World

The Earth is roughly spherical in shape, as everyone reading this knows. What's often more of a surprise is that this part of core science has been known to humans for some millennia, and has remained generally accepted and largely uncontroversial. We see mountaintops in the distance before we see the plains below, and we see that masthead of an approaching ship before we see the hull. We see the shadow of the Earth upon the face of the moon during a lunar eclipse, and it is always circular. At different latitudes, we see different stars at night, and the sun casts shadows of different lengths during the day. These pieces of evidence are all documented in ancient times, and were gathered together in Aristotle's treatise On the Heavens (Book II, Ch 14), which means they were all known by around 350BC at the latest. This led to the prediction that you could travel in a particular direction and eventually return to the place from which you started, a hypothesis that was confirmed by the Magellan expedition nearly 2000 years later.

The practical importance of this discovery appears in many engineering situations. It's often necessary for planning and executing journeys of more than a few hundred miles. It's vital for understanding weather patterns. It's vital for long-distance communication: once the railway and the telegraph were standard, it became apparent quite quickly that some system of coordinated time and corresponding time zones was necessary to synchronize watches around the planet. Software engineers dealing with any kind of geographic application learn very quickly that trying to treat latitudes and longitudes as Cartesian coordinates is asking for trouble: and if we go back into the history of mathematics, we find that this is just what sines and cosines were invented for.

In about 180 BC, Eratosthenes of Alexandria used the difference in lengths of shadows at midday at different latitudes to estimate the circumference of the Earth, and this gave a much more accurate figure than the estimate used by Christopher Columbus to convince Queen Isabella that the east coast of China was within reach of a well-provisioned sea voyage. Like many children in school, I read that Columbus was one of the first people to believe that the Earth was round. Not true: instead, he was the first to place enough faith in an optimistically small estimate of the Earth's circumference that he was willing to risk a westward voyage from Europe to China. In the event, his ignorance of geography was turned into good fortune thanks only to the intervention of an unexpected continent in between.

In between the mathematicians of the ancient world and the European renaissance lies the period of the Middle Ages. Readers of many standard histories may be left with the impression that in this period at least, Europeans in particular believed that the Earth was flat. This is generally false: the overwhelming majority of writers who touched on the subject assumed that the reader knows that the Earth is round. These include Augustine, Bede, Aquinas, over 70 other medieval churchmen, and of course a whole range of Arab, Indian and Chinese scholars and sailors. From around 1000AD, the knowledge assumed increasing practical importance as the mariner's compass and sailing into the wind made regular longer voyages possible, particularly over the Indian Ocean. The European renaissance and voyages of discovery did not come from nowhere, but from centuries of gradual technological advances during which common knowledge of the shape of the Earth played a central part. By the time Copernicus was able to write his pivotal work On the Revolutions of the Heavenly Spheres, he could state firmly in his second paragraph that the Earth is spherical, give a short list of demonstrations similar to those above, and know that every educated reader would agree with his book thus far.

Given the importance of the Earth's shape in the day to day life of many professions, why is the story of this knowledge relatively obscure compared to that of the Earth's movement in the solar system? Most educated people today can give a reasonable estimate of when it became known that the Earth goes round the sun: many will say Copernicus; others will guess at Galileo which is roughly accurate to within a century. By contrast, if asked "At around what date did we know that the Earth was round?" many educated people will admit to not knowing at all, or will guess at a similar time in the early modern period.

In the rest of this brief essay, I will propose three reasons for this absence: one scientific, one literary, and one religious.

The scientific reason is that the Earth's daily rotation is intimately linked to its shape, but was demonstrated much later. Ptolemy of Alexandria (who knew of course that the Earth was round) considered but dismissed the idea that the sunrise and sunset were due to the Earth itself rotating, because the surface of the Earth would have to be moving so fast that there would be enormous windstorms everywhere. This is the claim that Copernicus challenges first, before going on to discuss the movement of planets and the Earth around the Sun. Copernicus argues a kind of least-action principle – if the Earth rotating once a day is "too fast to believe", then how much harder is it to believe instead that the sphere of the immeasurably distant stars rotates once a day? To explain the lack of permanent hurricanes, Copernicus suggests that even though gases are attracted to the Earth's surface less strongly than liquids and solids, still they are attracted and pulled round as the Earth itself spins. He even goes so far as to suggest that the moon and sun may similarly attract the things near to them: to explain the lack of perpetual hurricanes, Copernicus even anticipates the law of universal gravitation! So Copernicus did contribute crucially to our knowledge of the Earth's circular motion, and the history of this discovery can understandably be confused with the history of our knowledge of the Earth's circular shape.

The literary reason is that the story of the Earth's shape lacks drama. It's like trying to write a love story about a couple who stays happily married for decades – it's dull! There is no hero thrown in jail, no individual of brilliant insight rejected by an ignorant public or a corrupt establishment, no centuries of darkness redeemed by a final enlightenment. Even worse, there's nothing that makes us today feel superior to people at other times and places with whom we feel no intellectual kinship. It doesn't fit with the narrative of modernity: instead of a revolution in thought that throws out everything that went before, it is an example of continuity, in which ancient and medieval science built a platform upon which modern science was built. If it's a dull story that doesn't fit with the standard narrative, much better to ignore it than to dwell on it. Or romanticize it: any sensible movie-maker would probably prefer the popular myth of Columbus as a steadfast and unique believer in a new idea, rather than an opportunist adventurer who got lucky in spite of using some very bad data.

The third and most controversial reason is to do with religion. During the 19th century, books like John William Draper's History of the Conflict between Religion and Science and Andrew Dickson White's History of the Warfare of Science with Theology in Christendom dwelt considerably on a few medieval authors, particularly Cosmas of Alexandria who taught of a flat earth in a 6th century work called Christian Topography. Though we know today that such flat-Earth believers were the exception rather than the rule, this mistake about the middle-ages spread into the 20th century and is still with us (see the Wikipedia article on the Flat Earth Myth). The Flat Earth Myth seems to me like an unfortunate and very human accident – Cosmas' choice of title suggests that he wanted to promote his views as decidedly Christian, and later antitheist critics have been more than happy to agree with him on this score. The story reminds us that we're prone to believe things that fit with our pre-existing biases, and that fact-checking assertions about what most scholars did or not did believe in a time as distant as the middle-ages is difficult.

Science offers two important and readily accessible methods for avoiding such errors. The first is to read primary sources. For example, to find out if Copernicus could assume that the Earth was round, and what other prior knowledge could be safely assumed, who better to read than Copernicus himself? In his first and most revolutionary chapter, parts of which were mentioned above, Copernicus cites the Pythagoreans, Plato, Aristotle, Ptolemy, Plutarch, Averroes, Martianus Capella's medieval encyclopedia, and Psalm 92:4, to name but a few. Even in the cases where he proposes different explanations (for example, Ptolemy on the movement of the Earth and Averroes on that of Mercury), he assumes that their observations were correct. His "prior art" quote for the relativity of motion comes from Virgil's Aeneid, and that for the sun lighting all things comes from Sophocles' Electra. So much for the irrelevance of a liberal arts education! His demonstrations emphasize continuity with the past wherever possible, partly because he wants his theory to have the best possible chance of being accepted by his contemporaries. You might hear a scientist today claim that the scientific revolution threw out everything that came before: this has become standard in the retelling, and deriding distant people is always easier than taking the time to understand them. But for many of the pivotal minds who made that revolution, their debt to the past was gratefully and humbly acknowledged.

The second, and most important method, is to observe the world. Take the time to convince yourself that the Earth is round – don't take someone else's word for it. Take a pair of binoculars to the top of a hill and watch the ships at sea. Note the date of the next lunar eclipse (there's one coming up on April 4th 2015, mainly visible over the Pacific regions) and look at the Earth's shadow (and first, look at the way the full moon is opposite to the sun in the sky and convince yourself that what you're seeing is the Earth's shadow!). If you travel to a distant place at a different latitude, look for a familiar constellation like Orion and see that it is higher or lower in the sky at the same time of night. These are the things that can make us fall in love with the system of the world: these are the things that make us scientists. And if you see them, remember with pride that for thousands of years, people have seen the same things with their own eyes, and in so doing, have seen beyond themselves.