
The puzzle that started complexity theory. - gnosis
http://cs.nyu.edu/shasha/outofmind/mccarthypuzzle.html
======
diiq
I guess I would have failed to create complexity theory with my solution ---
but everyone involved would have understood it, no long calculations required:
give the guard a lock and the spy a key. It's still a sort of one-way function
(easier to make a lock from a key then a key for a lock), but it doesn't
require squaring 100 digit numbers in the dead of night before deciding
whether to shoot a man.

~~~
Gupie
For what its worth, my solution was to give the guard a set of sealed
envelopes. Each envelope having a password written on the outside and a
password written on a piece of paper inside. The spy would give the guard the
word that is written on one of the envelopes, the guard would then open the
envelope and ask the spy for the password contained inside.

~~~
motxilo
How do I know that you, the creator of the password pairs, are not an enemy's
spy?

~~~
Gupie
How do I know that you, the selector of the 100 digit number, are not an enemy
spy?

~~~
motxilo
Every "good" spy chooses his X, and sends the corresponding Y to the guards.
No need to involve a 3rd person in between like in your solution.

------
Fargren
The "hint" is the solution. That would be annoying for someone who hadn't
figured it out.

~~~
redwood
Doesn't anyone else find the solution a bit problematic: sure great concept
but unless the guards have a black box tool which is secured and can churn out
Y from X, they will have to know the function to prove that Y was congruent
with an X...and if they know the function, so too would the enemy. On the
other hand if they have a secure tool that does this fine, but this seems to
simplify the problem considerably b/c the key is that the guard doesn't need
to know anything at all: the tool does all the work.

~~~
shub
Let f(x) = y. The guards have f and y. A spy gives a guard an x, and the guard
computes f(x) and checks it against his list of ys. If it's on the list, the
spy can pass. The enemy has f and y too, but it doesn't help them! f(x) is
trivial to compute but the inverse is hard, so the enemy knows exactly the
answer they want the guard to get and no idea how to make him get it!

One-way functions are very cool and form the basis of public-key cryptography,
although it's quite a bit more complicated than this example.

~~~
colanderman
What I don't get is: if the guards aren't to be trusted, how can the spies
safely tell them x?

I suppose this is why public-key cryptography was invented ;)

~~~
nandemo
They can throw _x_ away after using it. Alternatively, they can cross the _y_
off their list after matching it (making it a one-time password).

The idea is that the guards aren't malicious, just stupid.

------
anonymoushn
The solution doesn't seem to work on its face. If the spy simply gives the
guard Y, the scheme is the same as having a bunch of fixed passwords. If the
spy gives the guard X, X becomes public to the enemy. Some machine that lets
the spy input X (with the input hidden to the guard) and displays Y to the
guard would work, assuming the guard doesn't snoop around to discover X.

~~~
blahedo
Well, in this formulation, they're one-time passwords; but once the spy is
back in the country they could get a fresh one. Of course the more complete
solution would be public-key encryption, but they didn't know that yet in 1958
---this idea of a one-way function is basically a precursor to that.

~~~
eru
And nowadays we would probably use the discrete logarithm problem or factoring
integers as the one-way functions of choice.

~~~
cdavidcash
The suggested solution (modular squaring) already reduces to factoring.
[http://en.wikipedia.org/wiki/One-
way_function#Modular_squari...](http://en.wikipedia.org/wiki/One-
way_function#Modular_squaring_and_square_roots)

(And we'd use a cryptographic hash function anyway.)

~~~
eru
Thanks!

------
thret
In real life, similar problems were solved with a shibboleth.
<http://en.wikipedia.org/wiki/Shibboleth> Americans used 'lollapalooza' in
WW2.

------
kanak
Somewhat related, here's the letter that Kurt Godel wrote to John von Neumann
where he describes a problem very similar to the P vs NP problem:

[http://blog.computationalcomplexity.org/2006/04/kurt-
gdel-19...](http://blog.computationalcomplexity.org/2006/04/kurt-
gdel-1906-1978.html)

------
mcknz
original text:

 _Out of their Minds: The Lives and Discoveries of 15 Great Computer
Scientists_

[http://books.google.com/books?id=-0tDZX3z-8UC&lpg=PA79&#...</a>

