Hacker News new | past | comments | ask | show | jobs | submit login
Beautiful Simplicity (jgc.org)
159 points by jgrahamc on Sept 30, 2010 | hide | past | favorite | 28 comments



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.


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.


Alternate hypothesis: personality is highly heritable. http://www.google.com/url?sa=t&source=web&cd=1&v...


Interesting.

My father was always pissed off. Now my sister is always pissed off. I'd like to send her this paper, but I think that would just piss her off.


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?


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.


"You'd think this would have led to a career in the military, but it didn't."

The people I know who went into the military did so because they had no discipline, and wanted to get some.


Must be like the social workers I met who went into that profession to fix themselves. Social work is a poor career to chose on that basis.


My parents read like fiends. It rubbed off.


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.


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...), but the system in the article is the common system (http://en.wikipedia.org/wiki/Multiway_switching#Common_syste...).


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.


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------------+


The line in the diagram connects the lamp to both switches. You can't say it's the common system with parts omitted for simplicity. It has a part included that only exists in the Carter system.

Mansr is right and you are wrong.


Looking at the diagrams again, I suppose such an interpretation is possible. I still maintain that the diagram is ambiguous due to the mains connections being left out entirely.


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


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...


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/


I'm 100% wrong here - misread the parent AND misremembered Residential Wiring classes.

I am taking this as a signal that I should not do any AC wiring on my own any time soon. Also, I can't seem to make this an edit, only a reply :(


That sounds like the opposite of the point I was making.


Why, oh why, don't such countries just make idiots illegal :(


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.


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).


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.


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).


The wires in the switching system are not exactly hot and neutral; they are hot and disconnected. Neutral is connected to the mains (mains has two connections, hot is the high voltage connection, and neutral is the connection at around zero). In this case the wire between the bulb and mains is neutral, the disconnected wires between switches are, well, disconnected.


Thanks for the explanation!


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: