It's commonplace to note that American children don't score that well in scientific and technical subjects compared to other developed nations. But maybe it's our law enforcement officials who need the education.

This scientific illiteracy has been on bald display for the past week. Most recent was the case of Ahmed Mohamed, the 14-year-old engineering whiz who was arrested when school administrators and local police convinced themselves that his homemade clock was actually a bomb. That followed on the heels of espionage charges being dropped against a Chinese-American scientist when the case against him collapsed ignominiously. It's what happens when cops and prosecutors are more concerned with racial stereotypes than they are with getting their facts straight.

Let's take them in turn. As reported by The Dallas Morning News, Ahmed brought a homemade clock to school to show to a teacher, which he had put together with some wires and circuit boards. Despite the fact that it was manifestly a clock, one of Ahmed's teachers ratted him out, after which he was confronted by the school principal, Dan Cummings, and a policeman, who attempted to browbeat him into admitting he had tried to make a bomb. He insisted over and over that it was just a clock, but the police arrested him (as he was wearing a NASA T-shirt, no less) and then suspended him from school for three days.

The rest is history. The story set the internet ablaze, culminating in an invitation to the White House from President Obama.

Set aside the gutter racism of both the police and the school administration, and focus on the logic of the situation. At that point, either the device was a bomb or it wasn't. If the authorities thought there was even the tiniest chance that it was an actual bomb — and it seems pretty clear that this bunch were a few semesters shy of an explosives degree — then what on Earth were they doing wasting time arguing with the kid? They should have called an expert, or even emptied out the school and called in the bomb squad. First figure out whether there is a real danger, then either take the kid into custody, or apologize profusely for a mistaken accusation.

It's a stark example of the fundamental uselessness of racial profiling as a strategy of fighting crime or terrorism. (The local mayor, by the way, is also an Islamophobic fruitcake.) In a letter defending himself, the school principal goes on and on about safety, security, necessary precautions, and so forth. But by his own assumptions, he put the entire school in danger! It turns out that being racist is not actually a serviceable replacement for competence, technical knowledge, or simple common sense.

The Xi Xiaoxing case follows the same broad pattern. He's the chair of the physics department at Temple University, and was arrested and charged with espionage when the FBI found him apparently sending a blueprint of something called a "pocket heater" to a Chinese colleague. Only one problem: The blueprints weren't actually those of a pocket heater, and according to Xi's lawyer, the Justice Department didn't even consult with an expert before bringing the case before a grand jury.

Faced with numerous sworn statements from technical experts testifying that the blueprints were not what prosecutors said they were, including the very inventor of the pocket heater himself, the Justice Department was forced to drop the charges in disgrace.

Sherry Chen, a hydrologist for the National Weather Service, faced a similar situation earlier this year — though she is still fighting for her job even after the charges were dropped.

Both those cases are reminiscent of the case of Wen Ho Lee, a Chinese-American scientist who was pursued by the government with a deranged ferocity back in 1999. He worked on nuclear weapon simulations at Los Alamos National Laboratories, and was charged with 59 counts of espionage. That was later reduced to one count of mishandling classified information after the government case fell to pieces. In 2006, Lee won a $1.6 million settlement against the government for violating his privacy.

All the above cases are demonstrations of what happens when the violent arm of the state is high on racist suspicion, and low on technical competence. These officials end up frittering away vast amounts of time and resources on pointless wild goose chases, subjecting innocent people to gross injustice, all while ignoring the basic bureaucratic competence that is at the core of any quality policing effort.