IT WAS another good day for North Korea's Workers' Party. On July 24th 2011, amid music and gongs, the late Kim Jong Il shuffled past queuing throngs to cast his vote in the country's local elections. Like everyone else, he voted for the ruling party; its 28,116 candidates were all elected unopposed on a 99.97% turnout.

Though such extreme cases are confined to the handful of remaining workers' paradises, crude ballot-rigging is far from extinct. Alyaksandr Lukashenka, the Belarusian autocrat, has even admitted it publicly—he claimed he had ordered the result of the 2006 presidential election to be tweaked downwards in order to avoid an embarrassingly large majority. Of the 70-odd states holding national elections in 2012, Freedom House, a lobby, counts only 40 as full “electoral democracies”.

For the most part, however, technology and the presence of outside observers is complicating the election-rigging business, requiring dodgy politicians to work harder and more cleverly. Most manipulators make only sparing use of blatant election-day frauds, says Sarah Birch of the University of Essex. She compared observer reports of 136 elections held between 1995 and 2006 and found that a more frequent tactic is to alter election laws, often as a means of deterring opposition candidates or gerrymandering unlosable constituencies. (Youssou N'Dour, a famous musician who hoped to stand in Senegal's presidential election on February 26th, was struck from the ballot on a technicality.)

Also more common are attempts to influence the genuine choices of voters—frequently through vote-buying, using state resources in campaigning, and exploiting partisan media. Such subterfuge is harder to detect and less likely to enrage a mob. Public-spirited voters with smartphones can photograph irregularities at polling stations (see article), but not the abuse of campaign-financing rules. “People don't often take to the streets to protest against media bias,” says Ms Birch.

Some fraud masquerades as incompetence. Judith Kelley at Duke University crunched American government reports on more than 1,000 elections held between 1980 and 2004. The most blatant forms of cheating were recorded, on average, in about 40% of polls, but the biggest rise in complaints concerned electoral administration. Too few voting slips, patchy voter lists, and long queues at polling stations distort elections as surely as burnt ballot boxes and bribes. Yet election observers are likely to withhold their worst scoldings if the line between cock-up and corruption is unclear.

Nearly 80% of elections come under scrutiny from at least some sort of international observers, up from less than 30% in 1989, says Susan Hyde of Yale University (see chart). Domestic election observers are also getting more numerous and more professional. Such local monitors are better placed to record pre-election manipulations than small groups from overseas. And more observers on election day (especially those toting smartphones and tablets) make possible more comprehensive fraud-detection techniques, including the “quick count”—an effective but resource-intensive practice which compares results declared at polling stations with those tabulated centrally by election officials. Blinding the watchers Now the monitors themselves have become a target for election-riggers. They may face intimidation, sabotage (doors being glued shut, for example, in Russia) or manipulation. In 2007 the Kazakh embassy in Washington tried to pack a mission from the Organisation for Security and Co-operation in Europe, an international monitoring outfit, with sympathetic staff. Another dodge is to invite more than one mission. Observers disagree about a third of the time, Ms Kelley says, and some bodies are consistently more lenient than others. Russia, Kenya and Zimbabwe have all exploited these differences. Monitors sent by the Commonwealth of Independent States (a post-Soviet talking shop based in Minsk) have verified scores of elections, including those in Ukraine and Belarus, which were condemned by more established institutions. Credible outfits may boycott the worst-run elections, but such aloofness avails little if less reputable groups attend in their place.

Researchers disinclined or unable to loiter in polling stations are increasingly drawn to statistical means of detecting fraud. A principle now known as Benford's law (though discovered by an autodidact called Simon Newcomb) shows that naturally occurring sets of numbers, such as returns from polling stations, have distinctive patterns that made-up numbers almost never match. Worried vote-riggers may be driven to commission a countermeasure from a friendly mathematician.

With so many possibilities for subtle rigging, it may seem odd that the crude stuff remains so popular. Perhaps election-rigging is a hallmark of ill-run political systems, where corrupt local officials instinctively revert to the malpractice that comes naturally. Or perhaps, since the clever stuff can go wrong, ballot-stuffing is a safety valve. Politicians in shoddy democracies are learning what leaders in real ones have long known—you can fool only some of the people, and only some of the time.