2013-05-10 § Leave a Comment
2013-04-19 § 2 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.
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.
2012-10-27 § Leave a Comment
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.
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 »
2012-02-12 § 9 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.
For script authors: Every bash script that uses the
cd command with a relative path needs to call
unset CDPATH, or else it may not work correctly. Scripts that don’t use
cd should probably do it anyway, in case someone puts a
cd in later.
For users: Never export CDPATH from your shell to the environment. If you use CDPATH then set it in your
.bashrc file and don’t export it, so that it’s only set in interactive shells.
For the bash implementers: Change bash to ignore the inherited value of CDPATH in shell scripts (as opposed to interactive shells).
Since I wrote this, thanks to commenters here and on Reddit I’ve learnt two interesting things:
- CDPATH is not a bash-specific feature; it’s actually specified by POSIX.
- You can avoid it in some cases by using
cd ./foo, which does not consult CDPATH. But this is not a panacea: it can’t easily be used with paths that might be absolute or relative, such as
`dirname "$0"`, so I think unsetting CDPATH is still the best way to deal with it.
2011-12-11 § 26 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.
2011-08-03 § 2 Comments
2011-07-31 § 6 Comments
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 »
2010-08-26 § Leave a Comment
This was originally posted to Posterous in two parts, on the 23 and 26 August 2010. Now that Posterous is closing down I have edited it a little, combined the two posts into one, and posted it here on 13 March 2013. Reading it again now, I think I overstated the rarity of useful recursive functions. Many important algorithms – sorting algorithms, for example – are most straightforwardly expressed in recursive form. But there is still something worth keeping here, I think, even if I can’t quite put my finger on what it is.
Last week I wrote a recursive function, and next to it I was moved to remark:
# Just occasionally, one would be quite lost without recursion
It’s pretty unusual to encounter a problem that is best solved using recursion. I suppose traversing a recursively-defined data structure, like a tree, is a good example – but it’s telling that good examples of recursive code are so rare that shockingly bad examples are often used. « Read the rest of this entry »
2009-11-16 § 7 Comments
Several years ago I typed up a rough English translation of André Joyal’s hard-to-find 1977 paper Remarques sur la théorie des jeux à deux personnes, describing the category of Conway games.
My version was on the web server of the University of Manchester mathematics department for a while: I’ve just noticed that it’s not there any more, which is understandable. I’ll put a copy here, in case it’s useful to somebody.
added on 2010-12-29: I’ve updated the file with a version that includes a correction to the definition of the sum of games. Thanks to Glynn in the comments (presumably Glynn Winskel?) for reminding me of this error. Apologies for mistakenly uploading the uncorrected version.