## I hate the Pumping Lemma

2013-08-18 § 34 Comments

I hate the Pumping Lemma for regular languages. It’s a complicated way to express an idea that is fundamentally very simple, and it isn’t even a very good way to prove that a language is not regular.

Here it is, in all its awful majesty: for every regular language L, there exists a positive whole number *p* such that every string *w*∈L that has *p* characters or more can be broken down into three substrings *xyz*, where *y* is not the empty string and the total length of *xy* is at most *p*, and for every natural number *i* the string *xy ^{i}z* is also in L.

« Read the rest of this entry »

## “Venn diagram” partitioning

2013-07-10 § Leave a comment

Paddy3118 wrote about partitioning elements in the same way a Venn diagram does. So, if we have sets *A*, *B* and *C*, the partitions are

## Linear Logic without Units

2013-05-10 § Leave a comment

My PhD thesis (2007) was available for several years from my web site at the University of Manchester, but since that site was taken down it’s been unavailable. Today’s announcement is that I’ve finally got round to uploading it to GitHub.

## Puzzles like Adrift

2013-04-19 § 3 Comments

Quite a few people were surprised by my description of Adrift as a “new game” – even though it was very new at the time – because they had seen similar games or puzzles before.

You can read some of the history on Wikipedia: similar puzzles were posed as early as the 19th century, and more recently Big Duck Games released a nice version called Flow Free for Android and iOS.

This game was the subject of a programming competition at Oxford University last year. The competition was won by Thomas Ahle, with this rather nice program.

Adrift puzzles are a little bit different, though: they’re on an unusual grid – the surface of half a cube, i.e. three square grids connected at the edges – and also there are rocks, squares you’re not allowed to use.

## John H Conway and the invention of the filing cabinet

2012-10-27 § Leave a comment

Conway is incredibly untidy. The tables in his room at the Department of Pure Mathematics and Mathematical Statistics in Cambridge are heaped high with papers, books, unanswered letters, notes, models, charts, tables, diagrams, dead cups of coffee, and the most amazing assortment of bric-a-brac, which has overflowed most of the floor and all of the chairs, so that it is hard to take more than a pace or two into the room and impossible to sit down. If you can reach the blackboard there is a wide range of coloured chalk, but no space to write. His room in college is in a similar state. In spite of his excellent memory he often fails to find the piece of paper with the important result that he discovered some days before, and which is recorded nowhere else. Even Conway came to see that this was not a desirable state of affairs, and he set to work designing and drawing plans for a device which might induce some order amongst the chaos. He was about to take his idea to someone to get it implemented, when he realised that just what he wanted was standing, empty, in the corner of his room. Conway had invented the filing cabinet!

Richard K Guy on John H Conway, in *Mathematical People*

*I originally posted this to Posterous on 27 October, 2012. Posterous is closing down, so I have migrated it here on 13 March, 2013.*

## The Prisoner’s Dilemma

2012-07-23 § 23 Comments

## The Prisoners’ Dilemma

The Prisoner’s Dilemma is a game, but a game that seems to bear lessons for the conduct of human affairs more generally, and it has attracted a great deal of attention from men not noted for their frivolity. It was discovered in 1950 at the RAND corporation, a military think-tank established after World War II by the United States Air Force to conduct a “program of study and research on the broad subject of intercontinental warfare”.

So it is a serious game, but a simple one for all that. It requires two players, let’s say you and me. There is only one move. Each of us must make a choice, to “cooperate” or “defect”, without knowing what the other has chosen. Perhaps each of us takes, from a chess board, one black and one white pawn, and as we face each other I put my hands behind my back and proffer a closed fist containing the pawn I have chosen. You make your choice, too, in the same way. Together we open our hands, and reveal what we have chosen. The black pawn represents the black heart of the defector, the white the innocence of the cooperator.

Now, the reckoning. Should we each reveal a white pawn, we have cooperated and each of us wins £20: a fair and happy outcome. If we both are blackhearts with black pawns in our hands, we win nothing. But wickedness is not without its rewards in this game, for if I hold black and you white then I win £40 – and you, looking sadly at the white pawn in your hand, must pay £10 for your naivety. « Read the rest of this entry »

## Something all bash scripters need to know (and most of us don’t)

2012-02-12 § 16 Comments

Calling all bash users. This is a public service announcement.

Here’s something you need to know if you want to write bash scripts that work reliably, but you probably don’t.

« Read the rest of this entry »

## How to record a screencast video for free on Mac OS X

2011-12-11 § 32 Comments

It’s hard to find any detailed information on the web about how to record a screen video without buying expensive software. I found out how to do it, so here I’m going to explain what I did for the benefit of anyone else who’s trying to do the same.

## Challenging the Power of Twitter

2011-08-03 § 2 Comments

Most of the time I use this blog to write about things I understand, so it was something of an experiment when on Sunday evening I wrote a short post about something I did not understand.

« Read the rest of this entry »

## Something I don’t understand about homomorphic encryption

2011-07-31 § 6 Comments

**Added later:** *In retrospect, now I know a little more about cryptography, I can see that my confusion here is caused entirely by the fact that I didn’t know the meaning of the technical term “semantic security”.*

Ever since Craig Gentry’s seminal work in 2009, there has been a certain amount of excitement about the potential of fully homomorphic encryption. The idea, I gather, is that using a fully homomorphic encryption scheme makes it possible to perform computations on encrypted data *without decrypting it*, yielding an encrypted result. For example, this would make it possible to process confidential data in an untrusted data centre.

The technology is edging towards practicality as better schemes are devised, and it may soon reach the point where it’s useful in some real-world situations.

But there’s something I don’t understand. I’m hoping that someone who *does* understand it may come across this and explain it.

« Read the rest of this entry »