- May 11, 2008
- 23,225
- 1,565
- 126
For those that like cpu's and parallel execution of threads (swapping threads while waiting for results, might like this small excerpt from this book from Richard Feynman : Surely you are joking.
Funny view on how to solve a problem.
It is all about the colored cards...
Take note, i did not edit out some parts of the text (would have made it easier to keep the focus on the computing problem).
Funny view on how to solve a problem.
It is all about the colored cards...
Take note, i did not edit out some parts of the text (would have made it easier to keep the focus on the computing problem).
Another kind of problem I worked on was this. We had to do lots of calculations, and we did them on Marchant calculating machines. By the
way, just to give you an idea of what Los Alamos was like: We had these Marchant computers-- hand calculators with numbers. You push them, and
they multiply divide, add, and so on, but not easy like they do now. They were mechanical gadgets, failing often, and they had to be sent back to the
factory to be repaired. Pretty soon you were running out of machines. A few of us started to take the covers off. (We weren't supposed to. The rules
read: "You take the covers off, we cannot be responsible . . .") So we took the covers off and we got a nice series of lessons on how to fix them, and
we got better and better at it as we got more and more elaborate repairs. When we got something too complicated, we sent it back to the factory but
we'd do the easy ones and kept the things going. I ended up doing all the computers and there was a guy in the machine shop who took care of
typewriters.
Anyway we decided that the big problem--which was to figure out exactly what happened during the bomb's implosion, so you can figure out
exactly how much energy was released and so on--required much more calculating than we were capable of. A clever fellow by the name of Stanley
Frankel realized that it could possibly he done on IBM machines. The IBM company had machines for business purposes, adding machines called
tabulators for listing sums, and a multiplier that you put cards in and it would take two numbers from a card and multiply them. There were also
collators and sorters and so on.
So Frankel figured out a nice program. If we got enough of these machines in a room, we could take the cards and put them through a cycle.
Everybody who does numerical calculations now knows exactly what I'm talking about, but this was kind of a new thing then--mass production with
machines. We had done things like this on adding machines. Usually you go one step across, doing everything yourself. But this was different--where
you go first to the adder, then to the multiplier, then to the adder, and so on. So Frankel designed this system and ordered the machines from the IBM
company because we realized it was a good way of solving our problems.
We needed a man to repair the machines, to keep them going and everything. And the army was always going to send this fellow they had, but
he was always delayed. Now, we always were in a hurry. Everything we did, we tried to do as quickly as possible. In this particular case, we worked
out all the numerical steps that the machines were supposed to do--multiply this, and then do this, and subtract that. Then we worked out the program,
but we didn't have any machine to test it on. So we set up this room with girls in it. Each one had a Marchant: one was the multiplier, another was the
adder. This one cubed--all she did was cube a number on an index card and send it to the next girl.
We went through our cycle this way until we got all the bugs out. It turned out that the speed at which we were able to do it was a hell of a lot
faster than the other way where every single person did all the steps. We got speed with this system that was the predicted speed for the IBM machine.
The only difference is that the IBM machines didn't get tired and could work three shifts. But the girls got tired after a while.
Anyway we got the bugs out during this process, and finally the machines arrived, but not the repairman. These were some of the most
complicated machines of the technology of those days, big things that came partially disassembled, with lots of wires and blueprints of what to do.
We went down and we put them together, Stan Frankel and I and another fellow, and we had our troubles. Most of the trouble was the big shots
coming in all the time and saying, "You're going to break something!"
We put them together, and sometimes they would work, and sometimes they were put together wrong and they didn't work. Finally I was
working on some multiplier and I saw a bent part inside, but I was afraid to straighten it because it might snap off--and they were always telling us
we were going to bust something irreversibly. When the repairman finally got there, he fixed the machines we hadn't got ready and everything was
going. But he had trouble with the one that I had had trouble with. After three days he was still working on that one last machine.
I went down. I said, "Oh, I noticed that was bent."
He said, "Oh, of course. That's all there is to it!" Bend! It was all right. So that was it.
Well, Mr. Frankel, who started this program, began to suffer from the computer disease that anybody who works with computers now knows
about. It's a very serious disease and it interferes completely with the work. The trouble with computers is you play with them. They are so wonderful.
You have these switches--if it's an even number you do this, if it's an odd number you do that --and pretty soon you can do more and more elaborate
things if you are clever enough, on one machine.
After a while the whole system broke down. Frankel wasn't paying any attention; he wasn't supervising anybody. The system was going very,
very slowly--while he was sitting in a room figuring out how to make one tabulator automatically print arc-tangent X, and then it would start and it
would print columns and then bitsi, bitsi, bitsi, and calculate the arc-tangent automatically by integrating as it went along and make a whole table in
one operation.
Absolutely useless. We had tables of arc-tangents. But if you've ever worked with computers, you understand the disease--the delight in being
able to see how much you can do. But he got the disease for the first time, the poor fellow who invented the thing.
I was asked to stop working on the stuff I was doing in my group and go down and take over the IBM group, and I tried to avoid the disease.
And, although they had done only three problems in nine months, I had a very good group.
The real trouble was that no one had ever told these fellows anything. The army had selected them from all over the country for a thing called
Special Engineer Detachment-- clever boys from high school who had engineering ability. They sent them up to Los Alamos. They put them in
barracks. And they would tell them nothing.
Then they came to work, and what they had to do was work on IBM machines--punching holes, numbers that they didn't understand. Nobody
told them what it was. The thing was going very slowly. I said that the first thing there has to be is. that these technical guys know what we're doing.
Oppenheimer went and talked to the security and got special permission so I could give a nice lecture about what we were doing, and they were all
excited: "We're fighting a war! We see what it is!" They knew what the numbers meant. If the pressure came out higher, that meant there was more
energy released, and so on and so on. They knew what they were doing.
Complete transformation! They began to invent ways of doing it better. They improved the scheme. They worked at night. They didn't need
supervising in the night; they didn't need anything. They understood everything; they invented several of the programs that we used.
So my boys really came through, and all that had to be done was to tell them what it was. As a result, although it took them nine months to do
three problems before, we did nine problems in three months, which is nearly ten times as fast.
But one of the secret ways we did our problems was this. The problems consisted of a hunch of cards that had to go through a cycle. First add,
then multiply --and so it went through the cycle of machines in this room, slowly, as it went around and around. So we figured a way to put a different
colored set of cards through a cycle too, but out of phase. We'd do two or three problems at a time.
But this got us into another problem. Near the end of the war, for instance, just before we had to make a test in Albuquerque, the question was:
How much energy would be released? We had been calculating the release from various designs, but we hadn't computed for the specific design that
was ultimately used. So Bob Christy came down and said, "We would like the results for how this thing is going to work in one month"--or some
very short time, like three weeks.
I said, "It's impossible."
He said, "Look, you're putting out nearly two problems a month. It takes only two weeks per problem, or three weeks per problem."
I said, "I know. It really takes much longer to do the problem, but we're doing them in parallel. As they go through, it takes a long time and
there's no way to make it go around faster."
He went out, and I began to think. Is there a way to make it go around faster? What if we did nothing else on the machine, so nothing else was
interfering? I put a challenge to the boys on the blackboard--CAN WE DO IT? They all start yelling, "Yes, we'll work double shifts, we'll work
overtime," all this kind of thing. "We'll try it. We'll try it!"
And so the rule was: All other problems out. Only one problem and just concentrate on this one. So they started to work.
My wife, Arlene, was ill with tuberculosis--very ill indeed. It looked as if something might happen at any minute, so I arranged ahead of time
with a friend of mine in the dormitory to borrow his car in an emergency so I could get to Albuquerque quickly. His name was Klaus Fuchs. He was
the spy, and he used his automobile to take the atomic secrets away from Los Alamos down to Santa Fe. But nobody knew that.
The emergency arrived. I borrowed Fuchs's car and picked up a couple of hitchhikers, in case something happened with the car on the way to
Albuquerque. Sure enough, just as we were driving into Santa Fe, we got a flat tire. The two guys helped me change the tire, and just as we were
leaving Santa Fe, another tire went flat. We pushed the car into a nearby gas station.
The gas station guy was repairing somebody else's car, and it was going to take a while before he could help us. I didn't even think to say
anything, but the two hitchhikers went over to the gas station man and told him the situation. Soon we had a new tire (but no spare--tires were hard to
get during the war).
About thirty miles outside Albuquerque a third tire went flat, so I left the car on the road and we hitchhiked the rest of the way. I phoned a garage
to go out and get the car while I went to the hospital to see my wife.
Arlene died a few hours after I got there. A nurse came in to fill out the death certificate, and went out again. I spent a little more time with my
wife. Then I looked at the clock I had given her seven years before, when she had first become sick with tuberculosis. It was something which in
those days was very nice: a digital clock whose numbers would change by turning around mechanically. The clock was very delicate and often
stopped for one reason or another--I had to repair it from time to time--but I kept it going for all those years. Now, it had stopped once more--at 9:22,
the time on the death certificate!
I remembered the time I was in my fraternity house at MIT when the idea came into my head completely out of the blue that my grandmother
was dead. Right after that there was a telephone call, just like that. It was for Pete Bernays-- my grandmother wasn't dead. So I remembered that, in
case somebody told me a story that ended the other way. I figured that such things can sometimes happen by luck--after all, my grandmother was
very old--although people might think they happened by some sort of supernatural phenomenon.
Arlene had kept this clock by her bedside all the time she was sick, and now it stopped the moment she died. I can understand how a person who
half believes in the possibility of such things, and who hasn't got a doubting mind--especially in a circumstance like that--doesn't immediately try to
figure out what happened, but instead explains that no one touched the clock, and there was no possibility of explanation by normal phenomena. The
clock simply stopped. It would become a dramatic example of these fantastic phenomena.
I saw that the light in the room was low, and then I remembered that the nurse had picked up the clock and turned it toward the light to see the
face better. That could easily have stopped it.
I went for a walk outside. Maybe I was fooling myself, but I was surprised how I didn't feel what I thought people would expect to feel under the
circumstances. I wasn't delighted, but I didn't feel terribly upset, perhaps because I had known for seven years that something like this was going to
happen.
I didn't know how I was going to face all my friends up at Los Alamos. I didn't want people with long faces talking to me about it. When I got
back (yet another tire went flat on the way), they asked me what happened.
"She's dead. And how's the program going?"
They caught on right away that I didn't want to moon over it.
(I had obviously done something to myself psychologically: Reality was so important--I had to understand what really happened to Arlene,
physiologically--that I didn't cry until a number of months later, when I was in Oak Ridge. I was walking past a department store with dresses in the
window, and I thought Arlene would like one of them. That was too much for me.)
When I went back to work on the calculation program, I found it in a mess: There were white cards, there were blue cards, there were yellow
cards, and I started to say, "You're not supposed to do more than one problem--only one problem!" They said, "Get out, get out, get out. Wait --and
we'll explain everything."
So I waited, and what happened was this. As the cards went through, sometimes the machine made a mistake, or they put a wrong number in.
What we used to have to do when that happened was to go back and do it over again. But they noticed that a mistake made at some point in one cycle
only affects the nearby numbers, the next cycle affects the nearby numbers, and so on. It works its way through the pack of cards. If you have fifty
cards and you make a mistake at card number thirty-nine, it affects thirty-seven, thirty-eight, and thirty-nine. The next, card thirty-six, thirty-seven,
thirty-eight, thirty-nine, and forty. The next time it spreads like a disease.
So they found an error back a way, and they got an idea. They would only compute a small deck of ten cards around the error. And because ten
cards could he put through the machine faster than the deck of fifty cards, they would go rapidly through with this other deck while they continued
with the fifty cards with the disease spreading. But the other thing was computing faster, and they would seal it all up and correct it. Very clever.
That was the way those guys worked to get speed. There was no other way. If they had to stop to try to fix it, we'd have lost time. We couldn't
have got it. That was what they were doing.
Of course, you know what happened while they were doing that. They found an error in the blue deck. And so they had a yellow deck with a
little fewer cards; it was going around faster than the blue deck. Just when they are going crazy--because after they get this straightened out, they
have to fix the white deck--the boss comes walking in.
"Leave us alone," they say. I left them alone and everything came out. We solved the problem in time and that's the way it was.
Last edited:
