Lucia de Berk is a Dutch nurse who has spent six years of a life sentence in jail for murdering seven people in a killing spree that never happened. She will hear about her appeal on Wednesday, and there is now little doubt that she will be cleared. The statistical errors in the evidence against her were so crass that they can be explained in one newspaper column. So will the people who jailed her apologise?

The case against Lucia was built on a suspicious pattern: there were nine incidents on a ward where she worked and Lucia was present during all of them. This could be suspicious but it could be a random cluster, best illustrated by the "Texas sharpshooter" phenomenon: imagine I am firing a thousand machinegun bullets into the side of a barn. I remove my blindfold, find three bullets very close together and paint a target around them. Then I announce that I am an Olympic standard rifleman.

This is plainly foolish. All across the world, nurses are working on wards where patients die, and it is inevitable that on one ward, in one hospital, in one town, in one country, somewhere in the world, you will find one nurse who seems to be on a lot when patients die. It's very unlikely that one particular prespecified person will win the lottery but inevitable someone will win: we don't suspect the winner of rigging the balls.

And did the idea that there was a killer on the loose make any sense, statistically, for the hospital as a whole? There were six deaths over three years on one ward where Lucia supposedly did her murdering. In the three preceding years, before she arrived, there were seven deaths. So the death rate on this ward went down at the precise moment that a serial killer moved in.

Even more bizarre was the staggering foolishness by some statistical experts used in the court. One, Henk Elffers, a professor of law, combined individual statistical tests by taking p-values – a mathematical expression of statistical significance – and multiplying them together. This bit is for the nerds: you do not just multiply p-values together, you weave them with a clever tool, like maybe 'Fisher's method for combination of independent p-values'. If you multiply p-values together, then chance incidents will rapidly appear to be vanishingly unlikely. Let's say you worked in 20 hospitals, each with a pattern of incidents that is purely random noise: let's say p=0.5. If you multiply those harmless p-values, of entirely chance findings, you end up with a final p-value of p < 0.000001, falsely implying that the outcome is extremely highly statistically significant. By this reasoning, if you change hospitals a lot, you automatically become a suspect.

One statistician — Richard Gill — has held the Dutch courts' feet to the fire, writing endless papers on these laughable statistical flaws (qurl.com/gill). Alongside the illusory patterns he has identified, there was one firm piece of forensic evidence. Some traces of the drug digoxin were found in one baby who died. The baby had previously been prescribed digoxin, months previously. Three court toxicologists now say the digoxin was not the cause of death.

Even the Dutch state prosecution now accepts Lucia should be acquitted and there was no evidence of any unnatural deaths, though her convictions for stealing two books from the hospital library – a charge she denies – will be upheld. Now living with her partner while awaiting judgment, Lucia is penniless, denied benefits, and paralysed down one side following a stroke she had in 2006 in the week she was told her conviction would be upheld.

Watch what the Dutch legal system does next because it owes her a great deal.