Liz Hannah wrote the first draft of “The Post,” which stars Meryl Streep and Tom Hanks and is directed by Steven Spielberg. (Kendrick Brinson/For The Washington Post)

In 1961, before Harvard economist-turned-military analyst Daniel Ellsberg leaked the Pentagon Papers, he published a study on risk. His experiments found humans prefer gambling on low but specific probabilities — say, a one-in-a-million shot — to gambling on the unknown. The Ellsberg paradox does not appear to hold true in Hollywood, where dreamers bet everything on the misty hope that their spec script will launch a bidding war, sign Steven Spielberg to direct and charge into Oscars season at the front of the pack.

A few months ago, 31-year-old screenwriter Liz Hannah was listening to a film podcast insist that attempting a spec-to-statuette Cinderella story was a losing bet. “But I’m the one in a million,” admits Hannah, now 32. Over coffee in downtown Los Angeles, two blocks away from the federal courthouse where Ellsberg stood trial for violating the Espionage Act, she recounts how her first script, “The Post,” was snatched up by producer Amy Pascal and handed to Spielberg, who cast no less than Meryl Streep and Tom Hanks as the leads. Now the film has six Golden Globe nominations.

Just 18 months ago, Hannah thought her career had flatlined. After a decade of hustling, first in development at Charlize Theron’s female-centric production company and then as an ­aspiring screenwriter, she was beginning to think, “Maybe this isn’t what I’m supposed to do.” Her boyfriend, TV writer Brian ­Millikin, suggested she spend the summer writing about the woman who had fixated her for years: Washington Post Publisher ­Katharine Graham, who braved the Nixon administration’s legal threats and her own insecurities to print the Pentagon Papers.

Graham had taken over the family business unexpectedly after her husband’s suicide eight years earlier, and she defied advisers who said that printing the secret study about the Vietnam War could lead to the company’s demise. “That’s the moment where she came of age,” Hannah says. “You want to find the most interesting and relatable window into a person’s life.”

Graham’s autobiography, “Personal History,” won her a Pulitzer. Hollywood, however, left her heroism on the cutting room floor. In “All The President’s Men,” she’s merely an off-camera quip by Attorney General John Mitchell: “Tell Katie Graham she’s gonna get her tit caught in a big fat wringer if that’s ­published.” Afterward, Graham wore a necklace with two gold charms: a miniature wringer and one breast. “She always was a little sad that she wasn’t in it,” Hannah says of the film. “This movie is giving Kay her due.”

Tom Hanks as Ben Bradlee and Meryl Streep as Katharine Graham in “The Post.” (Niko Tavernise/Twentieth Century Fox)

In person, Hannah is sharp and charming, much like Graham herself. She’s an old soul in a young body. “I was a child of the ’60s more than the ’80s,” Hannah says of the politics and culture she was steeped in while growing up outside New York City. Fresh screenwriters are ­often advised to write what they know, which is how slush piles get clogged with teen dramas. Yet Hannah understands Graham almost like she’s ­wearing the first female Fortune 500 chief executive’s emotions under her leather jacket.

“I’m not a 55-year-old woman in 1971,” says Hannah, lightly stating the obvious. “But I know what it’s like to be a woman. I know what it’s like to want the truth out there. And I care about morality and ethics.” Tattooed on Hannah’s right arm is a line from Harper Lee: “Remember it’s a sin to kill a mockingbird.” (Her dog, a three-legged Great Dane, is named Boo Radley.)

Her father was an industrial designer; her mother, a social worker, also ran a knitting store. “I grew up in a house that worshiped JFK and Bobby and Martin Luther King Jr. and ­Malcolm X,” Hannah says. Still, “The Post” calls out John F. Kennedy and Lyndon B. Johnson’s responsibility for the Vietnam War. “Lying is bipartisan,” says Hannah.

For research, she devoured other memoirs about The Post, especially former executive editor Ben Bradlee’s “A Good Life: Newspapering and Other Adventures.” Hannah didn’t expect her unsolicited script to sell. At best, she hoped “The Post” would get her an agent.

Hannah finished her first draft on the Friday of Labor Day weekend in 2016. The next day, Millikin proposed. She enjoyed two months of tinkering with notes while casually planning their wedding. Then, in 24 hours, her life changed. Her manager leaked the script, a buying frenzy began and at midnight, former Sony Pictures chairman Amy Pascal won the auction and rang Hannah to say hello.

“I was like, ‘Amy Pascal wants to call me? Now?’ ” says Hannah, laughing. Pascal’s father had shared an office with Ellsberg at the Rand Corp. headquarters in Los Angeles, where Ellsberg poached the Pentagon Papers. Also, notes Hannah, during ­Pascal’s 30-year climb from ­secretary to studio boss, “it was not uncommon for her to stand in a room of men and not be listened to.”

The script ranked No. 2 on the 2016 Blacklist, which lists the best still-unproduced scripts of the year. “You’ve got this issue-driven story grounded in an intensely personal and dramatic story,” says co-screenwriter Josh Singer. After the sale, Pascal hired Singer, who shared the best original screenplay Oscar for “Spotlight,” to help strengthen “The Post.” “Look, it’s not the obvious way to tell the story of the Pentagon Papers,” he adds. “But it is a brilliant way to tell the story of Kay Graham.”

“I’ve learned that if you throw your passion into something, it makes other people care,” Hannah says. (Kendrick Brinson/For The Washington Post)

After Pascal enlisted Spielberg, and Streep and Hanks agreed to play Graham and Bradlee, “the world opened up.” Suddenly, Hannah could meet her characters’ families and run lines by colleagues who’d known them firsthand.

“The Post” rushed into production and things moved fast. Hannah had to hand her November wedding to an organizer. “I will show up,” she pledged. “And it will be great.” Everyone she met gave her the same two pieces of wisdom. First, appreciate that her stunning skyrocket “never happens.” And second, diary the on-set details, like the way Hanks, a typewriter collector, tested every ribbon in the newsroom. Hannah says, “There is something romantic about the sound.”

With no time for a honeymoon, the couple ducked away after their vows for a quick weekend retreat, where Hannah woke up in the middle of night and learned “The Post’s” trailer had premiered. Her now-husband, half-asleep, mumbled: “Did you watch it? I cried.”

“I’ve learned that if you throw your passion into something, it makes other people care,” ­Hannah says. Now that she’s beaten the odds, Hannah’s ­second lucky ace is that she has the zeal to write about anyone. MGM recently hired her to pen “Only Plane in the Sky,” an ­account of George W. Bush’s eight hours aboard Air Force One on 9/11. “It’s been fascinating with how much I empathize with Bush on that day,” Hannah says. “There were no good decisions to make.” After studying a Pulitzer winner, she’s reading “The Pet Goat.” “It’s like the most obscure children’s book of all time — and it’s literally just about a pet goat.”

Correction: A caption in an earlier version of this story said Daniel Ellsberg stood trial at the Clara Shortridge Foltz Criminal Justice Center. He was tried in the federal courthouse nearby.

Read more:

Review: In ‘The Post,’ Streep and Hanks lead a stirring homage to the pursuit of truth

How ‘The Post’ and ‘All the Money in the World’ got rushed to theaters so quickly