
Beautiful Simplicity - jgrahamc
http://blog.jgc.org/2010/09/beautiful-simplicity.html
======
yan
This reminded me of a clever way to do key exchange with $0.40 of electronics
(rather than quantum computers) that Schneier blogged about a few years ago:

<http://www.schneier.com/essay-099.html>

Relevant bits:

 _Alice and Bob have a two-wire cable between them, and two resistors each --
we'll say they each have a 10-ohm and a 1,000-ohm resistor. Alice connects a
stochastic voltage generator and a resistor in series to each of the two
wires. That's the setup._

 _Here's how they communicate. At each clock tick, both Alice and Bob randomly
choose one of their two resistors and put it in the circuit. Then, Alice and
Bob both measure the current flowing through the circuit. Basically, it's
inversely proportional to the sum of their two chosen resistors: 20 ohms,
1,010 ohms or 2,000 ohms. Of course, the eavesdropper can measure the same
thing._

 _If Alice and Bob choose the same size resistor, then the eavesdropper knows
what they have chosen, so that clock tick is useless for security. But if they
choose a different size resistor, the eavesdropper cannot tell whether it is
Alice choosing 10 ohms and Bob 1,000 ohms, or the reverse. Of course, Alice
and Bob know, because they know which resistor they're choosing. This happens
50 percent of the time. Alice and Bob keep only the data from the clock ticks
where they choose a different size resistor. From each such clock tick, they
can derive one secret key bit, according to who chooses the 10-ohm resistor
and who the 1,000-ohm. That's because they know who's choosing which and the
eavesdropper doesn't. Do it enough times and you've got key material for a
one-time pad (or anything else) to encrypt the communications link._

------
edw519
_Turns out that the things that you learn as a child affect the rest of your
life._

I grew up in a house with lots of kids and lots of discipline. Everything had
to be in the right place. To this very day, I am the most organized person I
know.

You'd think this would have led to a career in the military, but it didn't. I
became a data base administrator and programmer. I've been hashing since I was
a toddler but didn't know the name for it until I became an adult.

~~~
araneae
Alternate hypothesis: personality is highly heritable.
[http://www.google.com/url?sa=t&source=web&cd=1&v...](http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBcQFjAA&url=http%3A%2F%2Fwww.psych.umn.edu%2Fcourses%2Ffall06%2Fyoonh%2Fpsy3135%2Farticles%2FJang%2520et%2520al_1996.pdf&rct=j&q=heritability%20of%20personality%20traits&ei=EoekTJ7VOoXElQfBpo38DQ&usg=AFQjCNEZAi2UNq6UC081rln0OuyvcpyFIg&sig2=IQpXtu5t-wxHDghvAZ3QqA&cad=rja)

~~~
jacobolus
I didn't read thoroughly, but it looks like they were studying twins who had
been raised in the same home, and finding big correlations of personality
attributes. (“Participants were volunteer twin pairs [...] eligible if they
were 16 years old or over and raised together in the same home.”)

How does that prove that genetics (as opposed to identical age, same family,
similar relationship to the family, close contact with each-other, etc., not
to mention similar interpretations of the meanings of questions on a
personality survey due to shared environment) was causal?

~~~
araneae
You sure didn't read thoroughly; the next sentence after that one explains it.

They were comparing monozygotic and dizygotic twins, which allowed them to
measure to the extent that they were similar because of being raised in the
same family at the same time. Comparing monozygotic twins raised in different
families is another way to measure hertibility. Both have their issues, of
course. But measures of the heritbility of personality generally do hover
around .5 _+/- .1 in other studies.

------
mansr
Wiring a lamp in this manner is illegal in some countries. One of the off
positions delivers line voltage to the lamp, making it less than idiot-proof.

~~~
tspiteri
How exactly? If you deliver line voltage to the lamp, it is on and lights.

Perhaps you are thinking of the Carter system
([http://en.wikipedia.org/wiki/Multiway_switching#Carter_syste...](http://en.wikipedia.org/wiki/Multiway_switching#Carter_system)),
but the system in the article is the common system
([http://en.wikipedia.org/wiki/Multiway_switching#Common_syste...](http://en.wikipedia.org/wiki/Multiway_switching#Common_system)).

~~~
brlewis
I voted you up because you cite such a good source, but please note that the
diagram in the article shows one wire between just the lamp and the switches,
i.e. the Carter system. The common system would have an unswitched wire to
neutral, as shown and described in the wikipedia article you cited.

~~~
tspiteri
The way I see it is that the article simplifies by just saying "lamp" for the
lamp and mains, because the only relevant part to the article is the switching
part. For it to be the Carter system, the mains live (hot) and neutral have to
be connected to a pair of wires in the switching part.

I think the article does not mention the mains details because the neutral
wiring never even enters the switch, as in the switch on the wall which he
unscrewed as a child. Perhaps the diagrams would have been a bit better if the
bottom part was

    
    
        +---Lamp----Mains---+
    

instead of just

    
    
        +---Lamp------------+

~~~
moxiemk1
The point the ancestor is making is that it's common practice to switch the
neutral instead of the mains.

~~~
mikepurvis
Really? In North America, black is hot and white is neutral, and you always
switch (and fuse, and breaker) the black wire.

"A neutral wire is the return leg of a circuit; in building wiring systems the
neutral wire is connected to earth ground at least at one point. North
American standards state that the neutral is neither switched nor fused. The
neutral is connected to the center tap of the power company transformer of a
split-phase system, or the center of the wye connection of a polyphase power
system. American electrical codes require that the neutral be connected to
earth at the "service panel" only and at no other point within the building
wiring system. Formally the neutral is called the "grounded conductor"; as of
the 2008 NEC, the terms "neutral conductor" and "neutral point" have been
defined in the Code to record what had been common usage. [1]

Hot is any conductor (wire or otherwise) connected with an electrical system
that has electric potential to electrical ground or neutral."

Source:
[http://en.wikipedia.org/wiki/Electrical_wiring_in_North_Amer...](http://en.wikipedia.org/wiki/Electrical_wiring_in_North_America#Terminology)

~~~
asmithmd1
I think they meant it is not uncommon for someone to mistakenly rewire a
switch so that the neutral line is switched.

In high school I worked in a hardware store (where I first learned how a 3-way
light worked) and you would be surprised at how often someone would want to
return a light switch as faulty after they incorrectly wired it. The symptoms
were always the same. They turn the breaker back on after replacing the switch
and either the breaker trips immediately, or the light is on and when they
flip the switch the breaker trips. Inside the switch box they would connect
white to white and black to black (because that is always the way to hook-up
wires, right?) and then hook white to one side of the switch and black to the
other. God only knows how many switched the white wire and were happy they
"fixed" the switch -- until they try to unscrew a broken light bulb.

Here are many more examples: <http://thereifixedit.failblog.org/>

------
TY
From the end of the article:

 _PS If you need a bit more beautiful simplicity go and read about NAND logic
and realize that they are all you're ever going to need._

A wonderful demonstration of how this can be done can be found in the "The
Elements of Computing Systems". Homepage: <http://www1.idc.ac.il/tecs/>

This course will show you how to build a simple but modern computer stack
starting with nothing but simple NAND gates. Make sure to do the exercises and
be prepared to invest a lot of time if you buy this book, otherwise you'll
just waste your time.

I consider TECS and Charles Petzold's "Code" to be the most approachable books
for those who want to understand what's really happening "under the hood" of
your computer and can't recommend them highly enough.

------
Tichy
I am a bit disappointed by the two-switch solution: it seems to waste a lot of
cable.

No idea if there is a better way (except for using small microcontrollers).

~~~
rimantas
It does not. For a typical cable you will have the two wires inside: "hot"
wire and "neautral". To connect switches you would use the same two-wired
cable, only hot and neautral wires would change their roles depending how the
switches are set.

~~~
sophacles
It does waste wire. The run of cable from power source to the first switch
will only use the "hot" wire. The neutral wire will not be connected. The run
from the second switch can have its neutral wire used, but unless there
happens to be a good path to ground at the point of the second switch, there
will need to be more cable run for that path to path to ground.

So assuming strictly 2-wire only cable, there will always be waste.
Fortunately for the world someone long ago noticed this, and they sell spools
of wire. These spools of wire and electrical conduit are used by electricians
to great advantage for keeping wasted wires to a minimum. (Also, it is
arguably safer to have no runs of "unused" wire just sitting there, because of
potential for mistaken "bare hots" or accidental misuses of the wire causing
shorts and fires and whatnot).

------
albertcardona
NAND gates is what neuromorphic engineers use to build circuits that can
compute and end up emulating the function of an integrate-and-fire neuron.

