跪拜 Guibai
← Back to the summary

Ada Lovelace Wrote the First Program, Then Lost a Fortune Trying to Predict Horse Races With Math

Many people have heard her name: the world's first programmer. But few know she was Byron's daughter, and that her mother wanted to use the rationality of mathematics to extinguish the romance of poetry in her bones. In the end, romance and rationality coexisted wildly within her. She had the foresight to see that machines could do more than arithmetic—they could create. Yet she stubbornly believed she could conquer horse racing with mathematics, and finally lost to fate.

图片

Image from the internet; delete if infringing.

Today we look at a pioneering woman of computing—Ada Lovelace.

Byron's daughter, an "anti-poet" raised by mathematics

On 10 December 1815, Augusta Ada Byron was born in her father's residence at Piccadilly Terrace in London, then part of Middlesex. Her father was the Romantic poet Lord Byron, whose fame and notoriety had swept Europe.

Perhaps then as now, from East to West, talented men shared one common flaw: philandering.

Piccadilly was a fashionable upper-class district in central London; Byron was at the height of his fame, and this house was his marital residence.

图片

139 Piccadilly Terrace, London, Byron's residence (image from internet; delete if infringing)

Byron glanced at the newborn Ada and spoke a cold sentence that has been quoted ever since: "Ah! I have got a tormenting instrument."

The marriage was a farce from the start.

Byron was reckless and passionate; his wife, Anne Isabella, was a rare aristocratic woman of her time who loved mathematics, and Byron mockingly called her the "Princess of Parallelograms."

Anne abhorred Byron's feverish, emotional, unconstrained poetic temperament.

Just a month after Ada's birth, Anne took the baby and left, separating from Byron.

Byron soon left England permanently; Ada would never see her father again.

图片

Lord Byron (image from internet; delete if infringing)

When Ada was eight, Byron died in Greece. Her entire impression of her father came from her mother's daily warnings: poetry is dangerous, madness, and destroys lives.

Perhaps out of alarm at "poetry," Anne set an extreme goal for raising Ada: to snuff out any romantic spark inherited from Byron with rigorous mathematics, logic, and science.

It was an absurd childhood.

To train self-discipline, young Ada had to lie still for long periods. (This reminds me of kindergarten teachers making children sit through lessons; it seems "inhuman" in hindsight~)

Her timetable was filled with arithmetic, geometry, astronomy, and the like; poetry and novels were strictly limited.

Anne hired top scholars as tutors, including mathematician Augustus De Morgan, one of the founders of mathematical logic.

图片

Mathematician Augustus De Morgan (image from internet; delete if infringing)

Anne failed. Perhaps Byron's blood ran true, or perhaps women are naturally poetic. Beneath the rational shell, imagination never disappeared.

At twelve, Ada was obsessed with flight. She studied bird wing structures, drew plans, and wrote a manuscript called Flyology, designing a steam-powered flying horse with enormous wings—a mechanical horse with a steam engine inside, beating its wings to carry a person into the air.

She seriously wrote her mother letters describing flight plans, dreaming of building the world's first flying machine.

Although Ada was exceptionally intelligent, her health was poor.

图片

Ada Lovelace (image from internet; delete if infringing)

She was sickly from childhood, suffering chronic migraines. After measles at fourteen, she became almost paralyzed and needed a cane for two years.

During long bedridden days, her curiosity never waned; she reasoned through geometry and imagined machinery in her head.

Was it rationality driving her imagination of a mechanical world, or romance accelerating her search into the unknown? We cannot know today.

Still, Ada pursued mathematics to meet her mother's expectations while secretly keeping a poet's soul.

In a later letter she wrote a touching confession: "If you can't give me poetry, give me science that is like poetry."

If you are a programmer, you have probably heard the phrase: write code that is as beautiful as poetry. That feeling is probably what she meant.

图片

Ada Lovelace (image from internet; delete if infringing)

In 1835, at nineteen, Ada married nobleman William King, who later became Earl of Lovelace, making her the Countess of Lovelace.

Thereafter she became known as Ada Lovelace.

She bore three children, lived a stable, proper aristocratic life, but never let go of mathematics and mechanics in her heart.

A machine on paper: the first program in history

Victorian salons were places where high society exchanged ideas.

At one dinner party, Ada first met Charles Babbage (readers interested in him can comment; I may write about him later).

图片

Charles Babbage's Analytical Engine plans (image from internet; delete if infringing)

Babbage was an extremely inventive man. He designed the Difference Engine, then conceived the grander Analytical Engine: a purely mechanical general-purpose computer with memory and looped instructions. Does that sound like a computer? Yes—it is the ancestor of the modern computer.

But the machine was never actually built.

Though drawings filled rooms, the British government withdrew funding because the project's future was unclear, and contemporaries saw it as an expensive toy that could only calculate tables.

In 1843, a French paper on the Analytical Engine reached England. Ada took the initiative to translate it into English.

Beyond the translation, she wrote notes that far exceeded the original text: seven notes labelled A through G, which later became the famous Notes.

图片

Note G from Ada's *Notes*: this table is the first computer program in human history.

The greatest is Note G, in which she wrote a complete algorithm for calculating Bernoulli numbers, with flowcharts, variables, loop logic, and conditional branches.

That is truly the first computer program in human history written specifically for a computer. Ada Lovelace thus became the world's first programmer.

Many confuse the roles now: Babbage designed the machine, but Ada saw its true potential.

Babbage himself regarded the machine as a tool for rapidly computing mathematical tables.

Ada saw further. She envisioned the machine handling not just numbers; if you encoded symbols, musical notes, and letters, it could compose music, create, and process anything expressible in symbols.

This was 1843, and the idea was terrifyingly ahead of its time.

图片

The world's first electronic computer, 1946 (image from internet; delete if infringing)

That is to say, a full century before the birth of the electronic computer, Ada had accurately predicted the nature of general-purpose computing!

During their collaboration, the two worked like "love-hate" project partners.

Babbage, short-tempered, often slipped complaints into manuscripts, hoping Ada would use her paper to criticize the British government for withholding funds.

Ada refused bluntly, rebutting the elder colleague (25 years her senior) in letters: "My words must never be arbitrarily altered by others."

She even wrote to complain that Babbage was hard to communicate with, self-centered, and irritable.

Yet she stayed up nights refining the algorithm, repeatedly checking Bernoulli number formulas and sending manuscripts back and forth with Babbage.

Babbage, in turn, praised her sincerely, calling her "the enchantress of numbers who has cast her spell over the abstract sciences."

图片

Charles Babbage (image from internet; delete if infringing)

They argued, swore at each other, but genuinely recognized each other's genius.

A genius gambler who wanted to beat horse racing with math

I hesitated to include this part, but I think I should, because no one is perfect. It is also the most controversial episode of Ada's life, and a period that many popular accounts deliberately skip.

After writing the first program, Ada's ambition did not stop.

She believed almost obsessively that mathematical probability could predict everything in the world, including horse racing.

In Victorian aristocratic circles, betting on horses was the most fashionable pastime.

图片

Horse racing (image from internet; delete if infringing)

Ada planned to build a "mathematical prediction model" that would use formulas to determine race outcomes and win money steadily.

She even imagined using the winnings to fund Babbage and build the long-stalled Analytical Engine.

The ideal was grand; reality was a mess.

Even today, more than 180 years later, with AI as advanced as it is, I still don't think those "two colored balls" are predictable~.

Horse racing has too many variables: horse condition, jockey, weather, track—far beyond a simple probability model.

And perhaps she ignored the most critical element: human nature!

Her prediction system collapsed, and she lost a huge sum: about £3,200, a large amount even today (roughly several hundred thousand RMB).

图片

A 1945 pound note (image from internet; delete if infringing)

To cover the hole, she secretly pawned family jewels. Her mother Anne found out, redeemed them, and Ada pawned them again. Debt mounted, she got entangled in a scam, and was blackmailed.

Historians have long debated this episode.

Some scholars view the betting as a blemish on her life, a case of romantic fantasy overriding rationality.

Others argue it was consistent with her approach: she kept trying to apply algorithms and probability to real-world problems, but the era's data and mathematical tools could not support her ambition.

The monetary "pain" was perhaps not the most fundamental—after all, her husband was an aristocrat.

But she had to endure chronic illness alone. From childhood she suffered ongoing ailments, and to relieve the severe pain, she took the then-common laudanum, developing a dependence. When the pain worsened, she tried cannabis and hypnotherapy, but none reversed her physical decline.

图片

Victorian-era London aristocratic drawing-room salon: dinners, academic exchanges (image from internet; delete if infringing)

Victorian society was harsh on women (and not just Victorian society). A countess who loved mathematics, corresponded frequently with male scholars, and strayed from aristocratic propriety was surrounded by gossip and scandal. Even when rumors had no basis, people gossiped anyway. Much of this was people automatically pinning her father Byron's dissolute label onto her.

The end: returning to her father's embrace after death

In 1852, Ada was diagnosed with uterine cancer. Pain consumed her.

In her final days, she invited the writer Charles Dickens to her bedside to read passages from his novels.

图片

Charles Dickens (image from internet; delete if infringing)

A few days before her death, she called her husband to her bedside and confessed a secret.

No one knows what she said. Her husband listened, then turned and left, never returning to her bedside.

The secret has been buried forever in dust, one of the greatest mysteries surrounding Ada.

On 27 November 1852, Ada Lovelace died at just 36.

Almost poetically, her father Byron had also died at 36.

She left a final wish: not to be buried with her husband's family, but in the same grave as her father, whom she never met.

图片

Ada Lovelace's grave (image from internet; delete if infringing)

The girl who had been warned her whole life to stay away from Byron finally chose to return to him, sleeping forever in her father's arms.

The precious notes she left were covered in thick dust for a long time, unstudied.

In Victorian science, a noblewoman's "amateur thoughts" were not taken seriously, and no one believed an aristocratic woman could do anything great.

The Analytical Engine drawings were locked in libraries; her program lay quietly on paper for a hundred years.

Only in the 20th century, with the arrival of electronic computers, did scholars rediscover the 1843 manuscript and realize with a shock: a century earlier, someone had already understood general-purpose computing.

Memorials followed:

Every second Tuesday of October is Ada Lovelace Day, honoring women pioneers in technology.

图片

The U.S. Department of Defense named the high-reliability programming language Ada in her memory.

The U.S. Department of Defense developed the Ada programming language, named after her, for high-reliability systems like aviation and military.

Her portrait appears on posters and stamps, the symbol of a pioneering woman in computing.

Conclusion

Many biographies simplify Ada into a template: a woman who struggled to suppress romance, studied mathematics diligently, and became a great programmer.

But the real Ada was far more complex; human nature is complex.

Her mother tried to kill the "Byron" in her with mathematics, but in the end, Ada put Byron's imagination into a mathematical framework.

图片

Ada Lovelace (image from internet; delete if infringing)

She wrote the first program, yet stubbornly and naively believed mathematics could predict horse racing and conquer probability.

She was a countess, a mother of three; a patient plagued by illness, a laudanum user; an aristocratic woman surrounded by gossip, an idealist who gambled away a fortune.

She was not a perfect saint or prophet, but perhaps a genius living in the crack between reason and poetry: half precise algorithm, half poetic fantasy.

I am Li Jianyi, a programmer paying tribute to the pioneers of computing history. Welcome to follow my public account of the same name.