Nicholas FitzRoy-Dale's personal journal. I also write a programming blog and a tumble log. Contact me at or subscribe to my RSS feed.

Aug 24, 2016
Game theory in action
I just love this video, in which two gameshow contestants have to choose whether to share the money or to take it all, with the caveat that if both choose to take it all then neither of them get it. (Via Reddit.)
Jul 31, 2016
Review: The Dream of Rome
The Dream of Rome, Boris Johnson, 2006

Boris Johnson has a charming, avuncular style of writing, weaving hundreds of interesting stories of the Roman empire together to trace its history, through its apotheosis under Augustus to its decline. He always treats the reader as an intellectual equal, leading them gently through a complex tangle of issues, which he has dotted with facts in the same way that one might sprinkle dressing on a salad, to arrive at the conclusion that any reasonable person should make — i.e. the one which the author happens to be promulgating. This style is so fun to read, and so charmingly beguiling, that it’s easy to miss that half the time the author, by the end of the chapter, has started, apparently without noticing, to argue against himself.

The problem is that what could have been a very engaging history of the Roman empire is also interspersed with analogies to the current-day EU. These comparisons appear infrequently and unexpectedly, like dog poos in a public park, and one is left with the feeling that the Classics scholar felt compelled to demonstrate how much one can learn from history, but wasn’t really sure how to go about it.

There simply isn’t a lot of commonality between the EU and the Roman Empire. This causes Johnson problems in two ways. The first is that you can’t use one system as a model for another until you’ve demonstrated that they are sufficiently similar in the areas of interest. Johnson doesn’t do this, or even get close, so he is stuck with a sort of parody of comparison in which he points out the things which made the Roman empire great, and then points out that the EU does not have those things. He then leaves things there, presumably expecting the reader to make the obvious, but incorrect, logical leap.

Worshipping the emperor, for example, was one of the shared practices which united the Roman empire culturally. Nobody is going to worship any president of the EU, whose high-ranking members are so far the opposite of “charismatic leadership” that it sometimes feels that they were specifically selected for unpleasantness. That doesn’t, of course, mean that the EU is doomed to failure — it just means that it’s not like the Roman empire.

But Johnson’s failure to draw reasonable parallels between Rome and the EU causes a second problem, which is much worse: he ends up contradicting himself.

Take the issue of Turkey entering the EU, for example. This crops up near the end of the book, which has been busily occupied with teaching us that the Roman empire succeeded because it established a common, but loose, cultural identity — a common religion (but not an exclusive one); a common Roman architectural style, even an empire-wide favourite fish sauce. Part of the reason for its decline was that it spread itself too thin, and accepted local rule. With that act, a lot of the unifying Roman-ness disappeared. Without the egg-white in the cake, as Johnson puts it, the empire fell apart. The implication is of course that the empire should have avoided this if possible — retain a cultural identity; consolidate power in Rome; and so on.

But Turkey, with its Muslim population, is very culturally distinct from the EU. Some people, writes Boris, would argue that this means they shouldn't join it -- it wouldn't work, would dilute the common values, such as they are, and would weaken the union.

Miraculously, Johnson at this point attempts to turn his argument about on its head. The EU will never be the new European empire, he writes. There is no common culture! No common architectural style, no common customs. Certainly no common fish sauce. So why not give up on these half-baked ideas of commonality and let Turkey in? His reasoning is mostly based around security — better to have Turkey striving to align itself with the EU’s goals than working against them. I happen to agree with the reasoning, but it is an argument for increasing the cultural diversity of an already-very-diverse EU — rather oddly-placed in a book which has just finished making the case that too much cultural diversity and division of power destroyed the Roman empire.

The EU portion seems like a wash — the connections are poorly placed and never come together coherently. The history portion, however, is great — and, fortunately, that’s the majority of the book.

Overall, it’s a fun walk in the park if you watch where you step.
Aug 8, 2015
Android permissions show the "what", but we care about the "how"
Android permissions are in the wrong place, but the real problem with them is that they’re so far removed from what you care about. You don’t care if an app reads your data (or at least I can’t see why you should care) — what you care about is what the app does with that data. For example, if an app reads your contacts data and then does nothing with it, that’s totally okay (if strange). Likewise if it just uses the data to show birthday reminders within the app (for example). It’s only when the information is transmitted somewhere that (potential) problems arise. In other words, we don’t care what data are accessed as much as how the data are used. 

Rather than permissions revolving around (for the most part) personal information (contacts, photos) and potentially-personally-identifying information (location, device ID), it would be far more useful to have a dialogue which stated exactly what the app would do with that data. For example, “Transmits precise location and your device’s unique ID to”. Getting this sort of description right, and ensuring that apps are accurately described, would be difficult — but not impossible. More on how this might be done in the next post.

Aug 8, 2015
Android's permission request dialog is in the wrong place
Any Android user will be familiar with the problem: you decide you need an app, do a search for it, pick one you like, maybe look at the screenshots and read the reviews, and finally press “install” to be greeted by this:

Well, maybe a flashlight which requires “Device & app history” and “Device ID & call information” sounds a bit suspect to you, so you backtrack and find a better one which won’t obviously sell your personal information to advertisers. Or maybe you’re not entirely happy with the permission request, but by this stage you just want to start using your flashlight, so you go ahead and install it anyway.

In either of these cases, the problem is that the permissions request is positioned right at the end of the app-install flow, which runs something like this:

  • Launch store
  • Search for app
  • Select desired app from list
  • Press “Install” (if it’s free) or the displayed cost (if it’s paid)
  • Press “Accept” on the permissions request

By the time you get to permissions, you’ve made a mental commitment to the particular app, and reversing the process costs time and mental energy. Admittedly, these costs are very small, but they don’t have to be large — they only have to be more work than the alternative (going ahead with the install) to cause some people, some of the time, to give permissions to apps which they are not, in general, comfortable giving. 

Three possible solutions come to mind, but they are all dreadful.

Bad option 1: Allow the device user to choose which permissions they are happy with for a particular search. So for example you may never want to give your flashlight app access to your precise location, you indicate this to the store somehow, and you never see apps which request that particular permission. This is great in that it gives people control, bad in that most people won’t bother and that it would seem to discourage innovative apps which do interesting things but require more permissions to do them.

Bad option 2: The store itself ranks apps within a category according to their permission requests, and uses the rank to indicate positioning in search results. This removes the burden of permission-curation from the user, but gives it to a third party, which may not be beneficial. It also has the same innovation-stifling problem as option 1.

Bad option 3: The store displays a permission summary on, for example, the search results page. This could be very high-level, using (for example) icons to indicate access to personally-identifying information, device location, social graph, etc. This seems a little better than the first two options, but it’s hard to see how much useful information could be conveyed in a search result without overwhelming people. 

Ultimately, there is no good solution here because the entire concept of application permissions is flawed and somewhat useless. People don’t (or shouldn’t) care that an app has access to their data, they should care what the app does with it — the focus should be on data in motion rather than on data at rest. Nothing yet (as far as I know) does this. More thoughts on it in the next post.

Apr 26, 2015
Mini-est digital photo frame

Photo frame from a Christmas cracker (this was the best part), tiny LCD from iTead, generic Arduino. Next step would be wireless.
Jan 10, 2015
Poker solved by artificial intelligence
Okay, not all poker, but heads-up limit hold ‘em. Okay, not solved, but “weakly solved”, which means it is statistically extremely unlikely that a human would beat it (fair enough). And the strategy used, while cool and, classically, really AI, is an improvement on existing search-based techniques for game solving dating back to draughts.

It’s not that it isn’t a cool result. Drafts, Chess, Go, and so on are all perfect-information games, where players don’t have any information that their opponents don’t know. Poker isn’t, which makes play inherently probabilistic. The reporting of this is one was kind of atrocious, that’s all, with last-bastion-of-humanness-doomed headlines like the one above.

One thing I did find interesting, which has nothing to do with AI, is that several articles mentioned that it was strange that "inherently human" things, such as bluffing, are now being emulated by computers. Perhaps it’s just my background, but this is a really weird thing to write about. You see an opponent play a move which may be a bluff or may just be a bad move. Since you don’t know, you play as if it could be either. Ultimately the motive doesn’t matter. This has been the case in online poker for decades, where the only information available to you is the cards.

Heads-up limit hold’em poker is solved

Dec 2, 2014
AI news snippets
I get news updates relating to artificial intelligence, and I thought it would be nice to record some information about them.

Turing test alternative, the Winograd Schema Challenge

There has been a lot of talk recently, and not even that recently, about the inadequacies of the Turing Test. The problem with the test is of course that it’s pretty easy to write a program which produces output that looks a little bit human-like, and if you make things easy on yourself by pretending that it doesn’t speak English particularly well and is a child then you can sometimes fool people into thinking that it is human.

Nonetheless, I kind of like the Turing Test. I feel that nobody who was permitted extended, or repeated, interactions with a chatbot would be fooled, and, although I realise that changing the rules post hoc is a little no-true-Scotsman, the test is ultimately about distinguishing intelligence from nonintelligence, something which programs which succeed by taking advantage of the strictness (or laxity) of the rules, like the above-linked Eugene Goostman, clearly do not exhibit.

The Winograd Schema Challenge attempts to address rule-benders by imposing stricter rules. Specifically, participating programs and humans would have to give answers to common-sense questions such as "The town councilors refused to give the demonstrators a permit because they feared violence. Who feared violence?”. Any answer other than “the councilors” would be wrong. By contrast, Goostman’s reply to the question "Which is bigger, a shoebox or Mount Everest?” was "I can’t make a choice right now. I should think it out later. And I forgot to ask you where you are from…”

So it seems like a nice idea, but ultimately this represents a subset of human interaction as represented by the Turing test, specifically the subset dealing with factual questions related to semantic understanding. It seems a bit like a big data problem. Not that I'm suggesting it's easy. 

Articles about the Winograd Schemas Challenge: LivescienceVoxCommonsense ReasoningWinograd Schemas Challenge.

The end of law firms.

There are plenty of AI-related predictions which start with “The end of”, but this is a particularly weird one as the prediction hinges on viable general-purpose AIs, essentially, which would do much more than render lawyers obsolete.

Legal Futures, The End Of Law Firms

Movie: The Imitation Game

I haven’t seen this Turing biopic yet as I instinctively doubt it will do the man justice, though I did like the NY Times piece which argued that movies must portray genius as insensitive and cold because it gives us an otherness against which we can contrast ourselves.

Nov 18, 2014
Life goals of our washing machine

1. Do not, under any circumstances, let my owner open my door until I say so.

2. Wash clothes.

Sep 5, 2014
The canonical opinion column headline

Found this in the opinion column of my local newspaper.

Aug 24, 2014
Book review: The Player of Games, by Iain M. Banks

Possible subtitle: The Rubber of Beards

Possible alternative subtitle: It seems that the player… got played!

The last time I read "serious" sci-fi I was twelve years old. I was a bit obsessed with robots, so I bought Asimov's I, Robot collection and dove in. Even at that age, I could sense that something was off. It wasn't the robots -- Asimov writes great robots. In fact, Asimov is so good at writing robots that it seemed like he had applied the same formula to people. Everyone (or at least all the good people) were logical, unemotional, rational, and cold. Reading the stories was like watching a visualisation of a gas in a volume: each character was like a little molecule of logic, bouncing off other molecules to release tiny whisps of Plotium, the rarest of all sci fi elements. Disappointed, I gave up on the genre for a long time. Coming back to it with this book by Iain M. Banks, I soon remembered why I left.

The plot can be covered fairly briefly: the Player of Games is a story about a man named Gurgeh, who is the first sci-fi man to be named after the noise of cat sick. Gurgeh is a brilliant game player. I mean this literally: he plays board games exceptionally well. Alas, one day, Gurgeh makes a mistake -- if only he could play upon human emotions as well as he could play the board! The mistake means that Gurgeh is obliged to play the most complicated board game ever, against aliens whose very civilisation is based upon it. As the games progress, we realise that not just honour is at stake: Gurgeh represents a civilisation of peaceful expansion; the aliens are barbaric and thirsty for war. Whose culture will prevail?

Stop yawning. The fate of the galaxy is at stake.

Gurgeh lives alone in his house in seclusion, being brilliant in various private ways. People sometimes visit him for entertainment or sex, but then they politely leave again after a few days. When people are visiting, Gurgeh's house takes care of the catering and cleaning up, so all Gurgeh has to do is be witty and/or skilled and/or seductive. You can imagine that a life of brilliance, quietude, pampering, relationships maintained by others, and no-strings-attached sex would appeal to a certain type of reader. In fact the whole novel is epic wish-fulfilment of the highest order, as what may be the single greatest game player in the Universe overcomes his own doubts about himself and comes into his own. I hadn't, however, realised that I was going to be reading escapist fiction, so the repeated references to Gurgeh's perfect, ubernerd, life-of-the-mind existence were a little jarring.

Rather like the stereotypical nerd, the book talks a lot about sex but doesn't actually have much sex, and it's always discussed in a rather disinterested, clinical context. Strewn throughout the book are passages about sex, alien sex, and sexual politics, all of which Banks somehow manages to make boring. The passages on alien sex, in particular, sound like a textbook for a kid's health class in a particularly conservative country: "The vagina turns inside-out to implant the fertilized egg in the third sex, on the right, which has a womb."

In fact, the particular aliens Gurgeh visits don't want to have sex with him and think he's kind of disgusting. This would be funnier, except that Gurgeh, predictably enough, decides that he didn't want to have sex with them anyway.

The sexual politics of the novel is also extremely tedious. Early on in the book Gurgeh is talking to a woman, Yay, who visited for the evening but refused to have sex with him. He asks her why. '"I feel you want to ... take me," Yay said, "like a piece, like an area. To be had; to be ... possessed." Suddenly she looked very puzzled. "There's something very ... I don't know; primitive, perhaps, about you, Gurgeh."'

I'm not sure what Banks was trying to do here, but this is classic romance-novel stuff: frail woman thrown into confusion by pure, raw, unadulterated gender role. It later transpires that changing gender and homosexual sex are completely normal in Gurgeh's civilisation, but Gurgeh has never done either of these things, making him a weirdo -- but a sexy, raw, "primitive" weirdo. In any case, this geek wish-fulfillment stuff is very strange to encounter in a sci fi book.

Gurgeh is also kind of a jerk. He ignores people he doesn't like, or actively brushes them away. Gurgeh's civilisation treats conscious machines as equivalent to people, and they certainly act like people, yet it's clear that Gurgeh considers the machines beneath him. Banks seems to go out of his way to establish Gurgeh as irascible and discriminatory. In one baffling scene a drone is trying to discuss an assignment with Gurgeh while Gurgeh actively flicks crumbs from his dinner at it in a remarkably petulant display of passive aggression. Yet at no point is the reader invited to sympathise with Gurgeh's negative aspects -- he's just the main character, he's kind of horrible, that's all there is to it.

The book is hampered by bad writing. The plot is spurred by a transgression of Gurgeh's which leads to an eyebrow-raising blackmailing scene in which all the pieces are there but never seem to come together: there's a paragraph, for example, where the blackmailer explains that he would be happy to reveal the transgression simply for its entertainment value, and then, immediately afterwards, somehow convinces Gurgeh that he wouldn't reveal anything if Gurgeh would just do his bidding. That's followed by a long passage in which Gurgeh mopes that he would never be forgiven, complete with imaginary visualised scenes of social embarrassment, which seem acutely hollow given the kind of man we have established Gurgeh to be. There is a lot of rubbing of beards, which is the universal sci fi action for distracted thought (it's an action which is, of course, accessible only to males, but that is not a problem for traditional sci fi). Gurgeh is a big rubber of beards -- fourteen times, actually, over the course of the book (thanks, Kindle search). It got so repetitive that I started to feel sorry for his chin. The ship Gurgeh travels on is constantly referred to as "the old warship" in the same sense that a thug in a different book would be constantly referred to as "the big man", i.e., lazily. Ocassionally Gurgeh will take a woman back to the old warship, and fuck her in it.

The plot drags. Gurgeh is forced to play a complicated game against aliens, who, it turns out, are rather dreadful. In a hair-raising twist, the reader is invited eventually to discover that the values Gurgeh condemns in the aliens are disturbingly similar to the values that we humans have here on Earth in the present day. Nothing significant is made of this revelation that wouldn't also fit in, say, a weekend newspaper opinion column. There are some half-hearted references to the idea that one's language shapes one's thoughts, but, again, only in ways which are both heavy-handed and cursory (for example: Gurgeh starts speaking in his native language, rather than the inferior language of the aliens, and immediately has an epiphany about how to win his current game). Problems of exposition crop up in several places. There are several long passages in which Gurgeh attempts to explain his civilisation's values to the aliens, apparently because this is the only way that Banks could find to explain Gurgeh's civilisation's values to his readers. In writing about the universe's most complicated game, Banks also has the problem that he needs to write about playing the game without getting bogged down in the rules. Consequently, there are several passages of the form "Gurgeh knew that he was missing something [...] In a flash of inspiration, Gurgeh realised what he was missing". Gameplay without the gameplay, in other words, and, for the reader, all of the frustration of game-playing, but none of the fun.

Frustration is a good summary of the whole book. Banks is aware enough of the genre's tropes to mock them (the names of the spaceships are great), but he doesn't manage to escape them. The result is stereotypical SF: one-dimensional characters, great ideas, and bad writing.

Jul 21, 2014
Constant-rate gravity-fed drip irrigation
You’re going on a short holiday, but while you’re away London’s going to have the hottest day of the year and you don’t want to torture your plants. One thing you can do is set up a gravity-feed drip watering system using drip irrigation spikes. But they kind of suck: when there is a lot of water in the system, they drip quickly, and when there is hardly any water, they don’t drip at all. You basically can’t set the drip rate you want because it will change almost immediately.

There isn’t a constant drip rate because there isn’t a constant amount of water, so the solution is to provide one. You can do this by using two bottles, one of which continually feeds the other to maintain a given level. Here’s how.

First, take your first bottle and cut it.

Then, add the watering spike.
Now, take your second bottle and make a hole near the top. This bottle is going to be inserted upside down in the second bottle, and the hold should be below the surface when that happens.

Now, cover the hole with your finger and fill the second bottle with water. Then invert it and place it in the first bottle.

Note that there should be an air gap between the first and second bottles, i.e. there should be no seal where the bottles meet. If you do this right, the second bottle will empty into the first bottle until the hole you made is covered by water. After that point a partial vacuum will form at the top of the second bottle and it won’t empty any further. You can now adjust the drip rate, which will be based on the level of water in the first bottle.

When enough water has dripped out from the first bottle, the hole will be uncovered, allowing air to enter the second bottle. This will allow some more water to drain from the second bottle to the first, again covering the hole.

This set-up seems very precarious, but it worked for my (admittedly only five-day) holiday. Here is the contraption applied to a tomato plant:
Jul 12, 2014
Don't read Business Insider for AI insights
Dylan Love recently wrote an article for Business Insider titled Why We Can't Yet Build True Artificial Intelligence, Explained In One Sentence.

The sentence, by Jaron Lanier, explains nothing of the sort, but I don’t think that's Jaron Lanier’s fault. Business Insider took it from this two-sentence quote published in an opinion column in the New York Times:

We’re still pretending that we’re inventing a brain when all we’ve come up with is a giant mash-up of real brains. We don’t yet understand how brains work, so we can’t build one.

I’m not 100% sure what Jaron meant in-context, but there are plenty of reasonable interpretations. On the other hand, I think it’s pretty clear that, taken out of context, “we don’t yet understand how brains work, so we can’t build one” doesn’t argue against AI. The rest of the Business Insider article makes it obvious that, in its author's view, “true AI" is about cloning brains; we don’t understand brains so we can’t clone them; therefore AI can’t achieve its goal. All three of these claims are highly dubious.

AI isn’t about cloning brains. Well, most AI efforts aren’t. The recent trend in AI — deep learning — is nothing at all like a biological brain in terms of actual mechanisms, and earlier trends, such as expert systems and symbolic manipulators, were even less like them. When human brains are being “cloned” (simulated using computers to whatever required degree of biological accuracy) the reasoning is usually in terms of research into brain pathologies. The EU Human Brain Project, for example, has this goal.

But even if inventing a brain were AI’s main goal, one doesn't have to understand how something works in order to build it — one only has to understand how to build it. For example, we understand enough about biological neurons to be able to simulate them pretty well. One thing that we could do, then, is put together an absolutely massive and highly-accurate simulation of an arrangement of biological neurons that resembles a human brain. The challenges here lie in getting a sufficiently-accurate map of a human brain in order to copy it, and in getting enough computing power to feasibly perform the simulation. Nobody has done this yet. If someone were do to it, they might have a claim that they have produced AI, but they wouldn’t reasonably be able to claim that they understood how the brain worked.

So what did Jaron Lanier mean? Perhaps something more like this: for strong AI, aka “Artificial general intelligence”, we need to understand enough about how intelligence works in order to produce something which behaves intelligently. Plenty of people have theories about it, but nobody has yet produced anything which would demonstrate that their theories are correct. Therefore it’s safe to conclude that these theories are at best incomplete. 

Not quite as punchy a quote, but true.

Jun 28, 2014
The stamps on this letter from Australia could get me started playing some version of Catan!

Jun 26, 2014
AI Events calendar
I’ve started a calendar for AI events and conferences:

At the moment it’s just an ical version of the AISB weekly bulletin, but I may add other things later.

It’s updated roughly weekly.
Update: URL has changed as Google makes it hard for me to log in through my VPN.

Feb 26, 2014
Mouse barrel cortex: adapting to sensory deprivation

An interesting article in PLOS Biology about how the brain adapts to sensory deprivation. Cells in layer 2/3 became less active after deprivation. Cells in layer 5 compensated by being less inhibitory over L2/3 cells, but cells in layer 1 became (slightly) more inhibitory. The theory is that the L5 activity is an auto-regulation process, whereas the L1 activity is a top-down inhibition (i.e. from elsewhere in the brain) as the L2/3 cells were now essentially amplifying noise. The paper is available and has a lot more information (e.g. there seems to be a reciprocal relationship between inhibition in L1 and L5).

Feb 20, 2014
Climbing with Nicholas: A Cautionary Tale
I created a game after about five seconds of reading a Twine tutorial. It’s a tale of impulsiveness and woe, strongly inspired by my current rather sore finger.

Climbing with Nicholas

It is of course not an example of a good Twine game, or even an okay Twine game. Or even a game. But it’s a pretty impressive testament to how easy it is to get started with Twine.

Jun 29, 2013

Full-screen image gallery

Midsummer in Finland with MIrkka, Anne, and Tomas, in Anne's summer cottage.

May 6, 2013

Full-screen image gallery

Mirkka and I went to Paris over the long weekend. It was her birthday, my first time in Paris, and, basically, just a great opportunity to be tourists.

Apr 1, 2013

Dear Tesco customers: stop eating my butter.
Feb 21, 2013
The Warp Drive of the Ancient Mariner

'But why drives on that ship so fast,
Without or wave or wind?'

'The air is cut away before,
And closes from behind.'