You probably couldn't get New York Mayor Bill de Blasio and President Trump to agree on the time of day. But on the question of prices they are of one mind. Both of them think they know better than others what stuff should cost.

De Blasio recently boasted he will raise (apparently by decree) the price of a pack of cigarettes to $13—"the highest price in the country." The New York Times said his goal "is to persuade or coerce 160,000 of the 900,000 New York City residents who smoke to stop doing so by 2020."

De Blasio clearly understands the law of supply and demand: When you raise prices, demand falls. But he evidently hasn't applied that lesson to labor; he supports raising the minimum wage to $15 (which, incidentally, would help the poor afford cigarettes again). Advocates of minimum wage hikes like to claim raising the price of labor doesn't affect the demand for it. They're about as convincing as skeptics of climate change.

Trump also wants to raise the price of many things—particularly those things imported from China, for which he has proposed steep tariffs. The trouble with Chinese goods, as he sees it, is that they cost too little, so Americans like buying them, and that hurts domestic producers. To protect producers, it's important to deny the American consumer what she wants. And the simplest way to do that is to raise prices.

On the other hand, Trump thinks prescription drugs cost too much. He says the prices must come down "immediately," and he summoned drug company leaders to the White House for a lecture on the topic.

Certain drugs do cost a great deal. One stellar example is Sovaldi, a hepatitis cure that costs $75,000. But the price for Sovaldi actually has plunged from a decade ago, when it was essentially infinite because the compound didn't yet exist.

Prices for certain goods—a gigabyte of computer storage or a megawatt of solar-generated electricity, for instance—have plunged in recent years. And in historic terms, the relative prices of most consumer goods has fallen sharply too. As the Federal Reserve Bank of Dallas noted 20 years ago, "If modern Americans had to work as hard as their forebears did for everyday products, they'd be in a continual state of sticker shock—$67 scissors, $913 baby carriages, $2,222 bicycles, $1,202 telephones."

Prices for some goods do keep going up, however. Two obvious examples are college tuition and health care. By a remarkable coincidence, those also happen to be two areas of the economy in which the government is most heavily involved.

Federal and state politicians keep increasing subsidies for college attendance, which encourages colleges and universities to raise prices. Two years ago the Federal Reserve Bank of New York issued a study showing that every dollar of federal student aid hikes tuition by 50 to 65 cents. Health care has suffered from a similar phenomenon. Exempting employer-sponsored health insurance from income taxation while treating it as income for collective-bargaining purposes encouraged employers to substitute overly generous health plans for salary and wages, leading to medical inflation and wage stagnation.

All of this price-fixing produces a raft of unintended consequences, not least among them the gunking up of market efficiency. Too many politicians fail to understand that prices are not just charges, they are also signals.

Among other things, they signal the need for conservation. When the price of batteries spikes after a hurricane knocks out the power, that tells consumers at least two things: (a) They should not waste batteries on frivolous purposes and (b) they should not buy more than they truly need, so that shortages will be mitigated. It also tells suppliers that they should ship more batteries to the affected area, even if it means extra work, because they will make a lot more money if they do. That's what makes anti-price-gouging laws so foolish: They short-circuit those important market signals.

Hurricanes don't happen every day, but prices still steer goods to their highest and best use. A tungsten producer is never going to understand the complex totality of the industrial and commercial market in the United States, but prices mean he doesn't need to. All he needs to know is that he can get a better price for tungsten from a mobile-phone maker than from a ballpoint pen company, and he will send his supplies to where they will do the most social good.

Trying to decree the market price for a product or service simply doesn't work. De Blasio should know that already, but if he doesn't he will learn. Already, roughly three-fifths of all the cigarettes sold in New York are contraband smokes, and they go for $7 to $8 a pack—no matter what the law says. Like Shakespeare's Glendower, de Blasio and other politicians might command the devil. But that doesn't mean he will obey.