Suppose I had once borrowed your boat and, secretly, replaced
each board with a similar but different one. Then, later, when I
brought it back, did I return your boat to you? What kind of
question is that? It's really not about boats at all, but about
what people mean by "same."
—Marvin Minsky, The Society of Mind
I have heard of a touchy owner of a yacht to whom a guest, on
first seeing it, remarked, 'I thought your yacht was larger than
it is'; and the owner replied, 'No, my yacht is not larger than
—Bertrand Russell, "On Denoting"
The equal sign seems to be a perfectly innocent bit of mathematical
notation. We all know exactly what it means. The symbol
"=" is the fulcrum of a balance. It declares that the
things on either side of it, whatever they may be, are equivalent,
identical, alike, indistinguishable, the same. What could be
clearer? Although an equation may be full of mystery—I can't
explain what eiπ = –1 really
means—the enigma lies in the two objects being weighed in the
balance; the equal sign between them appears to be totally straightforward.
But equality isn't as easy as it looks. Sometimes it's not at all
obvious whether two things are equal—or even whether they are
two things. In everyday life the subtle ambiguities of identity and
equality are seldom noticed because we make unconscious allowances
and adjustments for them. In mathematics they cause a little more
trouble, but the place where equality gets really queer is in the
discrete, deterministic and literal-minded little world of the
digital computer. There, the simple act of saying that two things
are "the same" can lead into surprisingly treacherous territory.
What follows is a miscellaneous collection of problems and observations
connected in one way or another with the concepts of equality and
identity. Some of them are mere quibbles over the meaning of words and
symbols, but a few reflect deeper questions. The difficulty of defining
equality inside the computer may even shed a bit of light on the nature
of identity in the physical world we think we live in.
Some Are More Equal Than Others
There's an old story about the mathematician who sets out to learn a
computer programming language such as FORTRAN or C. Everything goes
swimmingly until she comes to the statement x = x
+ 1, whereupon she concludes that computer programming is
Of course this story is just a programmer's joke at the expense of
mathematicians. I would respond in the same spirit by suggesting
that a mathematician would be better equipped than anyone else to
solve the "equation" x = x + 1.
Obviously x is equal to X0, the infinite ordinal
number, which has just the property that X0 =
X0 + 1.
In truth, x = x + 1 is not an equation at all in
FORTRAN or C, because the symbol "=" is not an equal sign
in those languages. It is not a relational operator, comparing two
quantities, but an assignment operator, which manufactures
equality. When an assignment statement is executed, whatever is on
the left of the "=" sign is altered to make it equal to
the value of the expression on the right. The semantics of this
operation are altogether different from those of testing two things
for equality. As it happens, the semantics of assignment introduce
certain troublesome characteristics into computer programs, which I
shall have occasion to mention again below.
To avoid confusion between equality and assignment, many programming
languages choose different symbols for the two operations. For
example, Algol and its descendants write ":=" for
assignment. In all that follows the symbol "=" will mean
only equality (whatever that means).
By the way, the "=" notation was invented by Robert Recorde
(1510–1558). He chose two parallel lines as a symbol of
mathematical equality "because noe 2 thynges can be moare