THERE are no iron rules of politics, but some patterns repeat often enough to resemble physical laws. In America, perhaps the most reliable one is that voters express buyer’s remorse in mid-term elections. In 23 of the 26 mid-terms held since 1911, when the House of Representatives was fixed at 435 members, the president’s party has lost ground in the lower chamber. The average swing towards the opposition has been 30 seats; Democrats need to gain just 23 to win control.

With less than a month of campaigning left, the most likely result is that Democrats will take the House while falling short in the Senate. Nonetheless, both contests are close enough that the outcome is highly uncertain. Statistical models—including The Economist’s own forecast of the House race—and betting markets agree that there is around a 30% probability of the Republicans holding both chambers, and perhaps a one-in-five chance that the Democrats will flip both. Either outcome falls within the range of credible estimates of Mr Trump’s odds in November 2016.

The only prediction about the mid-terms that can be made with confidence is that many more people will vote for Democratic House candidates than for Republican ones. When pollsters ask which party respondents plan to support this year, Democrats lead by eight points. That is the second-biggest advantage an opposition party has had at this point in a mid-term campaign since 1994 (see chart). District-by-district polls tell a similar story: Democrats’ performances in surveys of single House districts are on average seven percentage points higher than the party’s vote shares in 2016.

Unexpected changes in the mix of people who turn out to vote can undermine the most rigorous polling methods. But in special elections held to fill seats in state and federal legislatures that have become vacant, Democratic candidates have on average fared five percentage points better than Hillary Clinton did in those districts in 2016. Fundraising totals also suggest Democratic partisans are more fired up than Republicans. Across all House contests in which both major-party nominees have filed reports with the Federal Election Commission, 57% of contributions by individuals have gone to Democrats. Combining all of these factors and more, our mathematical model of the race calculates that the Democrats’ most likely share of votes cast for House candidates (excluding third parties, and adjusting for districts where candidates run unopposed) is just over 54%. That would be a bigger opposition-party wave than those of 1994, 2006, 2010 and 2014, and fall just short of 2008, when voters pummelled Republicans during the financial crisis. It is consistent with a narrow Democratic House majority, of around 12 seats. Nonetheless, a takeover is far from assured. Thanks to gerrymandering and to the concentration of Democratic voters in big cities, the Democrats need to win about 53.5% of the vote—roughly their margin in their wave of 2006—just to exceed a 50/50 chance of taking control. The Republicans’ best hopes lie with a handful of candidates who have insulated themselves politically from the unpopular president. Voters in competitive districts with large Hispanic populations have not shown the degree of anti-Trump fervour displayed by college-educated white women.

Wildest dreams

In the Senate, it is the Democrats who need an inside straight. A gain of just two seats would give them control, which sounds like a low bar. However, only nine of the 35 races this year involve seats currently held by Republicans. And of those, just two—Nevada’s and Arizona’s—are in states where Democrats are even faintly competitive in presidential elections.

Neither race will be easy. An outsize share of Democratic voters in both states are Hispanics, whose turnout has dropped precipitously in previous mid-terms. In an open-seat race in Arizona between two current congresswomen, Kyrsten Sinema, the Democrat, is clinging to a narrow lead. Dean Heller, the incumbent Republican in Nevada, is roughly tied with his challenger.

Although Democrats could well flip both seats, that would probably not be enough for a majority. The party must also defend its incumbents in five staunchly Republican states, and beat a sitting governor running for the Senate in Florida. The confirmation fight over Brett Kavanaugh may well help Democrats in House elections. However it has coincided with a strengthening of partisan loyalty in Republican states with Senate races.

Overall, the vulnerable Democrats have held up remarkably well. The party’s incumbents in Indiana, Missouri and Florida are all tied or narrowly leading in post-Kavanaugh polling, while its senator from Montana was clearly ahead in the most recent polls, which were conducted in September. North Dakota, however, looks likely to be Senate Democrats’ Waterloo. In all five polls taken since June, Heidi Heitkamp has trailed Kevin Cramer, the state’s lone congressman—the last two by double digits. Such deficits are not insurmountable: Ron Johnson, a Republican senator from Wisconsin, rallied from ten points down to win re-election in 2016. And Ms Heitkamp raised $3.8m in the third quarter, ensuring she will have a large cash advantage.

Nonetheless, comebacks like Mr Johnson’s are rare. And if Ms Heitkamp cannot replicate the feat, the Democrats’ backup plans to compensate for her loss are in trouble. After a flurry of encouraging polls over the summer, the party’s polished, popular candidates in Tennessee (a centrist former governor) and Texas (a charismatic congressman) have fallen behind their opponents. A special election in Mississippi is even more of a long-shot.

Although the nature of Mr Trump’s presidency makes it foolish to rule out an October surprise, national-level surveys for Congress tend to be fairly stable. During the past 40 years, the overall polling average has moved by less than a percentage point during the final month of the campaign. However, with the races for both chambers this close, even a modest change could be decisive. Ms Heitkamp’s numbers in North Dakota may be temporarily depressed by the media’s focus on Mr Kavanaugh. A few good polls for her could double the Democrats’ Senate chances. Mr Trump won two years ago thanks to 80,000 votes spread across three states. He may well find the fate of his legislative agenda, the investigations into his campaign and ultimately his presidency decided by a similarly narrow margin.