England’s World Cup hopes seemed to melt away Thursday with a heartbreaking 2-1 loss to Uruguay, which followed a loss to Italy by the same scoreline last week. Since the World Cup expanded to a 32-team format in 1998, no team has advanced to the knockout stage despite taking two losses in its group.

But the Three Lions are still mathematically alive: The FiveThirtyEight forecast gives England about a 4 percent chance of backing into the knockout stage.

Here’s what would need to happen; any deviation from this scenario, and England is out.

Italy beats Costa Rica on Friday. This seems like the easy part: Isn’t Italy way better than Costa Rica? Perhaps, but the Soccer Power Index (SPI) doesn’t see it as the overwhelming favorite; it gives Italy a 40 percent chance of a win, against 30 percent for Costa Rica. (All probabilities are listed as they were Thursday morning; they’ll change slightly when we rerun SPI overnight.) Italy and Costa Rica are also fairly conservative teams, so a draw is a decent possibility. SPI doesn’t have anything against Italy in particular, incidentally; instead, it takes a more pessimistic view of European teams than other ratings systems, particularly compared to teams from South America. That’s looked reasonably smart overall. SPI was also down, relatively speaking, on Spain, Portugal and England. SPI was comparatively high on teams such as Chile and Colombia, but there have been some potential exceptions, like Italy.

England beats Costa Rica next week. As of Thursday morning, SPI put the chances of this at 45 percent, against 26 percent for a Costa Rica win and 29 percent for a draw.

Italy beats Uruguay next week. These look like fairly evenly-matched teams, but SPI puts Uruguay slightly ahead. It gives Italy a 33 percent chance of beating the Uruguayans, against a 38 percent chance of a Uruguay win and a 29 percent chance of a draw.

England wins the tiebreaker. If the remaining matches in Group D go down as I’ve described, Italy would advance first with a 3-0 record, while England, Uruguay and Costa Rica would be tied for second, each with one win and two losses. England would need to have the best goal differential among the three teams to advance. If the goal differential is tied, England would need to have scored the most goals. I’m skipping some math here, but Costa Rica has a slight advantage in the tiebreaker so far because it beat Uruguay by two goals last week. So to win the tiebreaker, England would either have to defeat Costa Rica by two or more goals or see Costa Rica lose to Italy by two or more goals; a series of 1-0 results wouldn’t work.

As I’ve said, the chance of this sequence unfolding is about 4 percent. England fans might not take much solace in this — or they might think it’s too optimistic given how unlucky their team has been in the past.

But these odds are somewhere in the vicinity of those that an NBA, NHL or Major League Baseball team has of winning a seven-game playoff series after losing the first three games. The Boston Red Sox, who came back from 3-0 to beat the New York Yankees in 2004, demonstrate that sometimes the 4 percent chance proves a winner — and the Red Sox were once thought to have cursed luck, too.