It requires a minimum of 297 outs for a team to win a World Series — 11 playoff wins, at 27 outs apiece — and the path by which you get there is half science and half art.

The science has never been more attainable, with the ever-growing mining and understanding of advanced analytics guiding the way teams construct and deploy pitching staffs in October to secure those outs.

But then sometimes your closer goes kaput.

And that’s when it becomes an art.

Last fall, the Houston Astros were fighting for a championship as they watched their closer, the sturdy, dependable Ken Giles, slowly fall apart. By midway through the American League Championship Series, he was basically unusable. They were forced to get artistic.

When they closed out the New York Yankees in Game 7 of the American League Championship Series, it was with starter Lance McCullers throwing four shutout innings of relief. And when they outlasted the Los Angeles Dodgers in Game 7 of the World Series, it was Charlie Morton, another starter, handling the last four innings.

“We’ve got to get 27 outs, one way or another,” Astros Manager A.J. Hinch said then. “I don’t care who gets them. Our guys don’t care who gets them.”

What we are seeing now, at the cusp of the 2018 Major League Baseball trade deadline, is a lot of contending teams applying a lot of science to the task of roster-building. Many of the pitching moves that have been made, and many of the ones still to be made ahead of Tuesday’s deadline, can be distilled to the outs those teams still need to secure in August and September, and especially the ones they might need in October.

The New York Yankees face 10 more regular-season games against the Boston Red Sox — the team they trailed by 4 ½ games in the AL East entering the weekend, and a team that has hit about 70 points of OPS lower against left-handed pitching this season than against right-handers. And in a span of 48 hours this week, the Yankees added a pair of all-star lefties, closer Zach Britton and starter J.A. Happ.

The Red Sox, meantime, facing those same 10 regular-season games against the Yankees — and theoretically, as many as seven more in October — added a starting pitcher, Nathan Eovaldi, who eviscerates right-handed batters. Guess from which side most of the Yankees’ top hitters bat?

In October, when rotations are streamlined, the Red Sox could shift Eovaldi to relief, or perhaps do the same with lefty Drew Pomeranz, to fill a role they don’t currently have — a dependable, high-leverage lefty reliever.

You’ve got to get 27 outs, one way or another. It doesn’t matter who gets them.

Many of the moves made this month were done so with October in mind, as six teams — the Red Sox, Yankees, Indians, Astros, Cubs and Dodgers — enjoyed playoff odds, as calculated by FanGraphs, of 90 percent or better entering the weekend. No, not all of them are firm locks, but even the ones, such as the Cubs and Dodgers, with much work still to do are operating with one eye on October.

Both the Yankees and the Milwaukee Brewers — the wild card leaders in the AL and NL, respectively, entering the weekend — added proven closers (Britton to the Yankees, Joakim Soria to the Brewers) to bullpens that were already rated among the best in their respective leagues. This reflects the growing importance of bullpens in the postseason. Simply put, you can never have too many shut-down arms in October.

A year ago, relievers accounted for 38.1 percent of all regular-season innings pitched — a record — but in the postseason, that number shot up to 46.4 percent. In the 2016 World Series, not a single Indians or Cubs starter secured an out after the sixth inning.

The distinct disadvantage for a wild card team is being forced to use your ace to win the one-game playoff, thus limiting his availability, should you win, for the Division Series. But given the remarkable strength of the Yankees’ relief corps, it would not be out of the question for them to “bullpen” — a term and a concept gaining momentum across the sport — the wild card game (if they are in it), and thus save their ace, Luis Severino, for Game 1 of the Division Series (assuming, of course, they advance).

In a sense, that is what the Yankees did in last year’s AL wild card game, when Severino failed to finish the first inning, and the Yankees had to use four relievers, three of them in multi-inning stints, to outlast the Minnesota Twins — a win that helped propel them all the way to Game 7 of the American League Championship Series.

“We’ve deployed it already,” Yankees General Manager Brian Cashman said in a conference call with reporters following the Britton trade. After Severino’s implosion of last October, “we bullpenned it the rest of the way.”

The science of securing outs down the stretch and into October reached perhaps its most granular level with the Astros’ low-key trade with the Los Angeles Angels for catcher Martin Maldonado on Thursday. The Astros already had a serviceable catcher with better offensive numbers than Maldonado, in Max Stassi, and are hopeful veteran anchor Brian McCann can return from arthroscopic knee surgery in September.

So why would the Astros give up a pitching prospect for three months of a 31-year-old catcher with a .616 OPS this season (aside from the fact McCann’s healthy return is no sure thing)?

Because Maldonado was last year’s AL Gold Glove winner at catcher, and his rate of throwing out 44.4 percent of would-be base-stealers this season leads the majors.

And why does that matter so much?

Because the three teams with the best stolen base percentages in baseball are the Angels (83.1 percent success rate), Red Sox (82.6 percent) and Indians (82.3) — in other words, a division rival the Astros must play 10 more times down the stretch, and two of Houston’s likeliest playoff opponents on the AL side of the bracket.

Maybe Maldonado nets the Astros two or three additional outs per month, but every one of those outs matters, as does every stolen base an opponent might otherwise consider but decide against because of Maldonado’s presence.

These days, science wins titles, and the science of constructing a pitching staff around future opponents, potential matchups and theoretical situations is a fascinating process to observe, especially this time of year. And it is all fueled by the nightly countdown of outs, from 27 to zero.

But because these are human arms we are talking about, some will inevitably sputter and fail, sometimes at the worst possible times.

As the Astros learned last fall, it helps to have depth, a solid backup plan and perhaps a bit of good fortune. You still have to get those 27 outs, and it doesn’t matter how you do it, but baseball is at its best when doing so becomes an art.

Read more: