Nine minutes into its final descent and with three minutes left to touchdown, the Apollo 11 mission was in trouble.
Eagle, the Lunar Module (LM), initiated the crucial burn sequence to decelerate as it approached the Moon’s surface. The onboard computer guidance system had locked onto the landing site within the Sea of Tranquility (Mare Tranquillitas). Meanwhile, back on Earth, Chief Flight Director Gene Kranz had just completed the rapid fire GO NO-GO calls with his team of flight directors. With the Eagle, hovering precariously 3,000 feet above the lunar landscape, all systems were now GO. Earth-bound clocks marked the moment as July 20, 1969. UTC 20:05:06, while clocks in Mission Control Center ticked to Ground Elapsed Time (GET) of 102 hours, 33 minutes, and 6 seconds. On Earth, hundreds of millions peopled looked up at the sky, closed their eyes, and took one final collective breath in awe and in hope. The Moon was entirely calm.
Above the Eagle, the Command Module, piloted by Michael Collins circled in lunar orbit. From his window, Collins could observe Earth’s orb casting a warm blue and white marble glow against the grey lunar horizon. Nervously, he ran through the abort checklist one more time as the Eagle slowly tilted 90 degrees from horizontal to vertical in preparation for the final stage of descent. Kennedy’s audacious goal, set in 1961, of landing a man on the Moon “within a decade” was now only seconds away.
Program Alarm!
With only three minutes remaining to touchdown, the emergency alarms set off once again. The Apollo Guidance Computer’s Display and Keyboard Unit, known as the DSKY (pronounced “dis-key”), lit up with a series of alerts. Inside the Eagle, Commander Neil Armstrong and LM Pilot Buzz Aldrin could also hear the audible alarms.
Aldrin. Program alarm!
Aldrin: 1201
Armstrong. 1201!
The emergency alerts were quickly confirmed by Mission Control Center (MCC) and the Flight Director.
MCC: Roger, 1201 alarm
Flight: 1201 alarm!
With seconds to touchdown, the entire mission hung in the balance. Was the Eagle about to crash? Was it too late to abort? What to do?
To understand what happened and how the NASA astronauts and Mission Control Center navigated the emergency, we turn to the story of the woman who refused to serve tea, Margaret Hamilton. In this first installment, we trace her career before she became Director of the team which developed the on-board flight software for NASA’s Apollo Program.
The Woman Who Refused to Serve Tea
Margaret Hamilton was born on August 17, 1936, in Paoli, Indiana, a small town nestled in the heartland of the United States. She was the daughter of Kenneth Heafield, a philosopher and poet, and Ruth Esther Heafield, a school teacher.
Growing up, Hamilton loved mathematics: the more abstract the better.
Driven by her passion for abstract patterns and complex problem-solving, she chose to major in mathematics at Earlham College, a prestigious liberal arts college in Richmond, Indiana, where her mother had once been a student. Encouraged by her father, Hamilton also minored in philosophy.
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54683023-1d70-43c8-80a7-c6f2eb30a0c7_1024x1024.webp)
In high school and at Earlham College, Hamilton was developing into an exceptional but quirky student.1 Her mathematics began to form as an almost sixth sense, allowing her to view the world in terms of patterns, principles, and systems. Her life course was set: she would go to graduate school and pursue a career in mathematics.
She met her future husband James Cox Hamilton at Earlham College. In a pivotal moment, she decided to postpone her graduate studies to support her husband's law career and start a family. The couple settled in Cambridge, Massachusetts, where her husband had enrolled at Harvard Law School. Margaret Hamilton would look for a job to support her husband and family.
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bbeef9d-7ea5-44d3-94f4-9586548315bb_1024x1024.webp)
Harvard was mostly men. Harvard Law School was also mostly men. At the time, Harvard’s social tradition required wives of law students to pour tea for the men. Hamilton would support her husband but she had her limits: she graciously and defiantly refused to serve tea, telling her husband.
“No way am I pouring tea!”
Hamilton’s move to Massachusetts, while initially aimed at facilitating her husband's career, serendipitously placed her at the epicenter of technological innovation and research. Cambridge was home to both Harvard University and the Massachusetts Institute of Technology (MIT). With 50 colleges and universities nearby, Boston was also home to poets, philosophers, musicians, mathematicians, scientists, and dreamers. Margaret Hamilton had arrived. Looking in the mirror, she did not feel alone.
The Advent of Chaos Theory
Hamilton soon found a job working for Edward Norton Lorenz in the meteorology department at MIT. Lorenz, like Hamilton, had majored in mathematics. He had enrolled at Dartmouth College as an undergraduate and then began graduate studies at Harvard. Just months before he was to receive his graduate degree, the war intervened and in March 1942 Lorenz enrolled in the Army Air Corps (now the Air Force) to train as a weather forecaster.
His training took place during an eight-month master’s program down the Charles River at MIT. The program emphasized both theory and practice. According to Lorenz, “Our faculty in meteorology was as outstanding as any in the world, and it was natural that they should want to teach real science to their students.”2 By “real science” Lorenz meant the rigorous application of the scientific method to understand the natural world.
Lorenz is recognized today as the founder of chaos theory, one of the most profound discoveries in modern science and widely considered to be the third leg of modern physics, along with General Relativity and Quantum Mechanics. More popularly known as the “butterfly effect”, its hallmark is the discovery that small changes in the initial conditions of a system can lead over time to large differences.
But this way of describing it, doesn’t fully capture Lorenz’s groundbreaking discovery which demonstrated, among other things, why perfectly accurate long-term weather forecasting is impossible. It is well known, for example, that even in classical systems small changes at the beginning can lead to large differences at the end. For example, when shooting a missile into space, a small deviation in the initial angle of launch can lead to a large deviation of the missile from its intended target position.
What Lorenz had uncovered was deeper and more profound, and it has to do with predictability. In classical systems, no matter how complex, if we know the initial conditions and the system's laws, we can predict the future behavior of the system, at least in theory, with perfect accuracy.
Newton’s Laws portray a deterministic universe of perfect predictability. The view was famously enshrined by the great French mathematician Pierre-Simon Laplace in his A Philosophical Essay on Probabilities (1814):
We may regard the present state of the universe as the effect of its past and the cause of its future. An intellect which at a certain moment would know all forces that set nature in motion, and all positions of all items of which nature is composed, if this intellect were also vast enough to submit these data to analysis, it would embrace in a single formula the movements of the greatest bodies of the universe and those of the tiniest atom; for such an intellect nothing would be uncertain and the future just like the past could be present before its eyes.3
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c215fea-5e9a-4468-9bc3-43e08f0208d3_256x300.jpeg)
Lorenz’s work demolished Newton and Laplace’s “clockwork universe”. He demonstrated that Nature is full of “chaotic systems” which are intrinsically unpredictable over time. Despite fully knowing the initial conditions and the deterministic rules governing the state of the system, the long term future state of the system is unknowable. This unpredictability arises not from a lack of understanding of the system's dynamics, or from randomness, but from the exponential amplification of even the smallest differences in the initial conditions. The unpredictability will not go away no matter how much “data” we collect about the system.
The Road to Chaos Theory via Computing and Simulations
Lorenz never completed his graduate degree in mathematics at Harvard. At the end of the war he decided to switch to meteorology and the PhD program at MIT, where he was to spend his entire career. In 1948, he joined MIT as a a research scientist. In 1955, he became an assistant professor and then eventually headed MIT’s Department of Meteorology and Physical Oceanography from 1977-1981.
After completing his graduate thesis, Lorenz was increasingly disturbed by the gap between theory and practice in meteorology. The nagging feeling that something was missing had been lodged during his early training at MIT as a member of the Army Corps. Theory had taught him equations. But the equations never touched practice. They existed uneasily in entirely different worlds.
Not only were we never shown how to use the dynamical equations to make weather forecasts, which I had naively assumed was the reason for our studying dynamic meteorology, but we were not even told whether they could be used in this manner. I also learned that some outstanding meteorologists at other universities believed that it was impossible.4
Lorenz knew that equations mattered, of course, but if they were to be of use for weather forecasting he would need to chart a very different course. The path meant solving the dynamical equations numerically and then battle testing the different solutions through simulations. And for this approach, he would need a computer.
Hamilton Enters the Picture
In 1958, Lorenz acquired an LGP-30, a “desk computer”. “Suddenly I realized that my desire to do things with numbers would be fulfilled.”5 The unit weighted about 800 pounds and was the size of large desk in Lorenz’s office. Its entire memory was approximately 4096 words, which is astonishingly small by today’s standards. Lorenz began to “model” complex weather systems, using “numbers”, with a computer that had only ten pages of memory and storage.
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20a7a725-f2b8-4835-b6e0-fa9a31a63346_591x416.jpeg)
Hamilton joined Lorenz very soon after. If Lorenz was the pilot, Hamilton took over as co-pilot. However, neither knew how to fly the airplane. Since “programming” was entirely new, they taught themselves and each other. While Lorenz was discovering chaos theory with Hamilton’s assistance, both were also discovering how computer programming could be used in the service of science.
“He loved that computer,” Hamilton said. “And he made me feel the same way about it.”6 Programming the LGP-30 involved a process significantly different from programming modern computers using high-level languages like Python, C, or Java. The LGP-30 was programmed at a low level, close to the machine's hardware. Hamilton would have needed to understand its specific “machine language”, which involved knowing the numerical codes that corresponded to its different operations. She would then need to code by hand using assembly language. After the writing the code by hand on a piece of paper, the instructions were transferred to punched paper tape, a storage medium where holes represented binary data. The tape was then fed into the LGP-30 for reading. The computer read the holes in the tape as binary data, loading the program into its memory. Debugging was equally manual and laborious. Programmers had to scrutinize printouts of the program's execution or meticulously observe the machine's operation to find and correct errors.
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3725676-f255-47b0-a7ce-48f2cbb1503c_3169x2499.jpeg)
Although programming was tedious, Hamilton experienced the power that comes with “interfacing” directly with the computer hardware. She was also learning first-hand “systems” thinking, including where and how errors are made. Unlike modern day programmers who are shielded from hardware through multiple layers of abstraction, Hamilton learned to swim the surface currents but could also dive below, when necessary, to study the ocean’s depths.
With the aid of the LGP-30 and Hamilton’s assistance, Lorenz began to make steady progress with his numerical approach to meteorology. By the end of 1960, with Hamilton’s assistance, he had demonstrated that linear regression methods, favored by the meteorological community, give excellent forecasts one day in advance, but deteriorate to “mediocre” forecasts over time. This was a bold first step, laying the groundwork for defining non-linear systems underlying chaos theory. In his 1960 paper “The Statistical Prediction of Solutions of Dynamic Equations”, Lorenz acknowledged Hamilton’s contributions:
“The writer is greatly indebted to Mrs. Margaret Hamilton for her assistance in performing the many numerical computations which were necessary in this work.”
By the time Lorenz published his later groundbreaking paper in 1963, Hamilton had moved onto another part of MIT to work on the SAGE (Semi-Automatic Ground Environment) Project and then soon after to the Apollo Project at MIT’s Instrumentation Laboratory.
Another Hidden Heroine of Chaos Theory
Another forgotten star of chaos theory, until was Ellen Fetter.7 Fetter was a graduate student at MIT, having studied mathematics at Mount Holyoke College in South Hadley, MA, when Hamilton hired her to join Lorenz’s lab. After Hamilton’s departure, Fetter took over much of the heavy lifting of programming and numerical computations that led to the seminal results in Lorenz’s famous paper. Fetter was also instrumental in developing the data visualizations of convection which illustrate the shape of what is now known as a Lorenz Attractor. In today’s parlance, Ellen Fetter was a virtuoso data scientist working alongside Ed Lorenz, carrying on the work begun by Margaret Hamilton.
Lorenz acknowledged Fetters’ contribution in the landmark 1963 paper (“Deterministic Nonperiodic Flow”)8 which established chaos theory.
Special thanks are due to Miss Ellen Fetter for handling the many numerical computations and preparing the graphical presentations of the numerical material. (p.141)
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cbbc9af-9c43-42ff-ab56-acacb546cc8c.heic)
In the next installment, we will look at the next phase of Margaret Hamilton’s career, when she begins work at MIT’s Instrumentation Laboratory (now known as Draper Laboratory) where she led the team tasked with the developing the software for Apollo’s command and lunar modules.
Green, Caleb. “Margaret Hamilton - The Woman Who Put Men on the Moon”. UNLV William Boyd School of Law.
Emanuel, Kerry. Edward Norton Lorenz (1917-2008). A Biographical Memoir. National Academy of Sciences, 2011. Washington, D.C. p. 7.
Laplace, Pierre Simon, A Philosophical Essay on Probabilities, translated into English from the original French 6th ed. by Truscott, F.W. and Emory, F.L., Dover Publications (New York, 1951)
Emanuel. p. 8.
Ibid. p. 15.
Sokol, Joshua The Hidden Heroines of Chaos Theory. Quanta Magazine. May 20, 2019.
Ibid.
Lorenz, Edward N. "Deterministic nonperiodic flow." Journal of atmospheric sciences 20.2 (1963): 130-141.