On suboptimal optimization.

On suboptimal optimization.

I’ve been helping a friend learn the math behind optimization so that she can pass a graduation-requirement course in linear algebra. 

Optimization is a wonderful mathematical tool.  Biochemists love it – progression toward an energy minimum directs protein folding, among other physical phenomena.  Economists love it – whenever you’re trying to make money, you’re solving for a constrained maximum.  Philosophers love it – how can we provide the most happiness for a population?  Computer scientists love it – self-taught translation algorithms use this same methodology (I still believe that you could mostly replace Ludwig Wittgenstein’s Philosophical Investigations with this New York Times Magazine article on machine learning and a primer on principal component analysis).

But, even though optimization problems are useful, the math behind them can be tricky.  I’m skeptical that this mathematical technique is essential for everyone who wants a B.A. to grasp – my friend, for example, is a wonderful preschool teacher who hopes to finally finish a degree in child psychology.  She would have graduated two years ago except that she’s failed this math class three times.

I could understand if the university wanted her to take statistics, as that would help her understand psychology research papers … and the science underlying contemporary political debates … and value-added models for education … and more.  A basic understanding of statistics might make people better citizens.

Whereas … linear algebra?  This is a beautiful but counterintuitive field of mathematics.  If you’re interested in certain subjects – if you want to become a physicist, for example – you really should learn this math.  A deep understanding of linear algebra can enliven your study of quantum mechanics.

The summary of quantum mechanics: animation by Templaton.

Then again, Werner Heisenberg, who was a brilliant physicist, had a limited grasp on linear algebra.  He made huge contributions to our understanding of quantum mechanics, but his lack of mathematical expertise occasionally held him back.  He never quite understood the implications of the Heisenberg Uncertainty Principle, and he failed to provide Adolph Hitler with an atomic bomb.

In retrospect, maybe it’s good that Heisenberg didn’t know more linear algebra.

While I doubt that Heisenberg would have made a great preschool teacher, I don’t think that deficits in linear algebra were deterring him from that profession.  After each evening that I spend working with my friend, I do feel that she understands matrices a little better … but her ability to nurture children isn’t improving.

And yet.  Somebody in an office decided that all university students here need to pass this class.  I don’t think this rule optimizes the educational outcomes for their students, but perhaps they are maximizing something else, like the registration fees that can be extracted.

Optimization is a wonderful mathematical tool, but it’s easy to misuse.  Numbers will always do what they’re supposed to, but each such problem begins with a choice.  What exactly do you hope to optimize?

Choose the wrong thing and you’ll make the world worse.

#

Figure 1 from Eykholt et al., 2018.

Most automobile companies are researching self-driving cars.  They’re the way of the future!  In a previous essay, I included links to studies showing that unremarkable-looking graffiti could confound self-driving cars … but the issue I want to discuss today is both more mundane and more perfidious.

After all, using graffiti to make a self-driving car interpret a stop sign as “Speed Limit 45” is a design flaw.  A car that accelerates instead of braking in that situation is not operating as intended.

But passenger-less self-driving cars that roam the city all day, intentionally creating as many traffic jams as possible?  That’s a feature.  That’s what self-driving cars are designed to do.

A machine designed to create traffic jams?

Despite my wariness about automation and algorithms run amok, I hadn’t considered this problem until I read Adam Millard-Ball’s recent research paper, “The Autonomous Vehicle Parking Problem.” Millard-Ball begins with a simple assumption: what if a self-driving car is designed to maximize utility for its owner?

This assumption seems reasonable.  After all, the AI piloting a self-driving car must include an explicit response to the trolley problem.  Should the car intentionally crash and kill its passenger in order to save the lives of a group of pedestrians?  This ethical quandary is notoriously tricky to answer … but a computer scientist designing a self-driving car will probably answer, “no.” 

Otherwise, the manufacturers won’t sell cars.  Would you ride in a vehicle that was programmed to sacrifice you?

Luckily, the AI will not have to make that sort of life and death decision often.  But here’s a question that will arise daily: if you commute in a self-driving car, what should the car do while you’re working?

If the car was designed to maximize public utility, perhaps it would spend those hours serving as a low-cost taxi.  If demand for transportation happened to be lower than the quantity of available, unoccupied self-driving cars, it might use its elaborate array of sensors to squeeze into as small a space as possible inside a parking garage.

But what if the car is designed to benefit its owner?

Perhaps the owner would still want for the car to work as a taxi, just as an extra source of income.  But some people – especially the people wealthy enough to afford to purchase the first wave of self-driving cars – don’t like the idea of strangers mucking around in their vehicles.  Some self-driving cars would spend those hours unoccupied.

But they won’t park.  In most cities, parking costs between $2 and $10 per hour, depending on whether it’s street or garage parking, whether you purchase a long-term contract, etc. 

The cost to just keep driving is generally going to be lower than $2 per hour.  Worse, this cost is a function of the car’s speed.  If the car is idling at a dead stop, it will use approximately 0.1 gallon per hour, costing 25 cents per hour at today’s prices.  If the car is traveling at 30 mph without breaks, it will use approximately 1 gallon per hour, costing $2.50 per hour.

To save money, the car wants to stay on the road … but it wants for traffic to be as close to a standstill as possible.

Luckily for the car, this is an easy optimization problem.  It can consult its onboard GPS to find nearby areas where traffic is slow, then drive over there.  As more and more self-driving cars converge on the same jammed streets, they’ll slow traffic more and more, allowing them to consume the workday with as little motion as possible.

Photo by walidhassanein on Flickr.

Pity the person sitting behind the wheel of an occupied car on those streets.  All the self-driving cars will be having a great time stuck in that traffic jam: we’re saving money!, they get to think.  Meanwhile the human is stuck swearing at empty shells, cursing a bevy of computer programmers who made their choices months or years ago.

And all those idling engines exhale carbon dioxide.  But it doesn’t cost money to pollute, because one political party’s worth of politicians willfully ignore the fact that capitalism, by philosophical design, requires we set prices for scarce resources … like clean air, or habitable planets.

On the water-fueled car.

On the water-fueled car.

“I heard there was, like, a car that runs on water … “

“Dude, no, there’ve been, like, six of them.  But oil companies bought all the patents.”

A lot of the people who attend my poetry class in jail believe in freaky conspiracy theories.  Somebody started telling me that the plots of various Berenstain Bears books are different from when he was a child, which is evidence that the universe bifurcated and that he’s now trapped in an alternate timeline from the path he was on before …

old hat(New printings of some Berenstain Bears books really are different.  Take Old Hat New Hat, a charming story about shopping and satisfaction: after the protagonist realizes that he prefers the old, beat-up hat he already owns to any of the newer, fancier models, a harried salesperson reacts with a mix of disgust and disbelieve.  This scene has been excised from the board book version that you could buy today.  Can’t have anything that tarnishes the joy of consumerism!)

I’ve written about conspiracy theories previously, but I think it’s worth re-iterating, in the interest of fairness, that the men in jail are correct when they assume that vast numbers of people are “breathing together” against them.  Politicians, judges, police, corporate CEOs and more have cooperated to build a world in which men like my students are locked away.  Not too long ago, it would have been fairly easy for them to carve out a meaningful existence, but advances in automation, the ease of international shipping, and changes to tax policy have dismantled the opportunities of the past.

Which means that I often find myself seriously debating misinterpretations of Hugh Everett’s “many worlds” theory (described midway through my essay, “Ashes”), or Biblical prophecies, or Jung-like burblings of the collective unconsciousness.

Or, last week, the existence of water cars.

In 2012, government officials from Pakistan announced that a local scientist had invented a process for using water as fuel.  At the time, I was still running a webcomic – one week’s Evil Dave vs. Regular Dave focused on news of the invention.

dave062.jpg

When scientists argue that a water-powered car can’t exist, they typically reference the Second Law of Thermodynamics (also discussed in “Ashes”).  The Second Law asserts that extremely unlikely events occur so rarely that you can safely assume their probability to be zero.

If something is disallowed by the Second Law, there’s nothing actually preventing it from happening.  For an oversimplified example, imagine there are 10 molecules of a gas randomly whizzing about inside a box.  The Second Law says that all 10 will never be traveling in the exact same direction at the same time.  If they were, you’d get energy from nothing.  They might all strike the north-facing wall at the same time, causing the box to move, instead of an equal number hitting the northern and southern facing walls.

But, just like flipping eight coins and seeing them all land heads, sometimes the above scenario will occur.  It violates the Second Law, and it can happen.  Perpetual motion machines can exist.  They are just very, very rare.  (Imagine a fraction where the denominator is a one followed by as many zeros as you could write before you die.  That number will be bigger than the chance of a water-fueled car working for even several seconds.)

When chemists talk about fuel, they think about diagrams that look roughly like this:

graph.PNG

The y axis on this graph is energy, and the x axis is mostly meaningless – here it’s labeled “reaction coordinate,” but you wouldn’t be so far off if you just think of it as time.

For a gasoline powered car, the term “reactants” refers to octane and oxygen.  Combined, these have a higher amount of energy stored in their chemical bonds than an equivalent mass of the “products,” carbon dioxide and water, so you can release energy through combustion.  The released energy moves your car forward.

And there’s a hill in the middle.  This is generally called the “activation barrier” of the reaction.  Basically, the universe thinks it’s a good idea to turn octane and oxygen into CO2 and H2O … but the universe is lazy.  Left to its own devices, it can’t be bothered.  Which is good – because this reaction has a high activation barrier, we rarely explode while refueling at the gas station.

Your car uses a battery to provide the energy needed to start this process, after which the energy of the first reaction can be used to activate the next.  The net result is that you’re soon cruising the highway with nary a care, dribbling water from your tailpipe, pumping carbon into the air.

(Your car also uses a “catalyst” – this component doesn’t change how much energy you’ll extract per molecule of octane, but it lowers the height of the activation barrier, which makes it easier for the car to start.  Maybe you’ve heard the term “cold fusion.”  If we could harness a reaction combining hydrogen molecules to form helium, that would be a great source of power.  Hydrogen fusion is what our sun uses.  This reaction chucks out a lot of energy and has non-toxic byproducts.

But the “cold” part of “cold fusion” refers to the fact that, without a catalyst, this reaction has an extremely steep activation barrier.  It works on the sun because hydrogen molecules are crammed together at high temperature and pressure.  Something like millions of degrees.  I personally get all sweaty and miserable at 80 degrees, and am liable to burn myself when futzing about near an oven at 500 degrees … I’d prefer not to drive a 1,000,000 degree hydrogen-fusion-powered automobile.)

Magnificent_CME_Erupts_on_the_Sun_-_August_31.jpg
Seriously, I would not want this to be happening beneath the hood of the family ride.

With any fuel source, you can guess at its workings by comparing the energy of its inputs and outputs.  Octane and oxygen have high chemical energies, carbon dioxide and water have lower energies, so that’s why your car goes forward.  Our planet, too, can be viewed as a simple machine.  High frequency (blue-ish) light streams toward us from the sun, then something happens here that increases the order of molecules on Earth, after which we release a bunch of low-frequency (red-ish) light.

(We release low-frequency “infrared” light as body heat – night vision goggles work by detecting this.)

Our planet is an order-creating machine fueled by changing the color of photons from the sun.

A water-fueled car is impractical because other molecules that contain hydrogen and oxygen have higher chemical energy than an equivalent mass of water.  There’s no energy available for you to siphon away into movement.

If you were worried that major oil companies are conspiring against you by hiding the existence of water-fueled cars, you can breathe a sigh of relief.  But don’t let yourself get too complacent, because these companies really are conspiring against you.  They’re trying to starve your children.

On smell (again!).

On smell (again!).

1200px-Concentrated_animal_feeding_operation,_Missouri_(2)If you live next to a concentrated animal feeding operation – facilities that houses thousands of farmed animals in fetid conditions – there’s no point in buying perfume.  The smell of animal excrement overwhelms any scent you could wear.  If you’re interested in a romantic dalliance, you’ll have to woo people with your looks.  Or, sure, conversation.  But a charming scent won’t do it.

In other environs, scent contributes to your allure.  We humans choose our mates based on a huge number of considerations, including the way people smell.  Back in 1995, zoologist Claus Wedekind proposed that human females are most attracted to the scents of men whose immune genes differ from their own.

oldspiceDuring college, a friend tried to convince me that the best route to romantic success was Old Spice aftershave.  “It reminds women of their fathers,” he said.  This is, of course, the opposite theory from Wedekind’s – that females would seek out partners whose scents mirror their own genetic lineage.

But this much is uncontested – by overwhelming our sense of smell, air pollution makes humans less sexy.

Stick_insect_WGWe’re not the only animals who use aroma to identify attractive mates.  Stick insects can have a wide range of physical appearances, and multiple species sometimes live in overlapping areas.  Each subpopulation of stick insects secretes a different mix of oily aromatic chemicals from their skin.  These oils protect them from scrapes and dehydration – and help them find mates of their own kind.

If stick insects couldn’t smell, they might mate wantonly.

That’s what happens with fish.

When we pollute water, fish lose the ability to recognize each other.  In the same way that humans near a CAFO won’t notice each other’s scents because they can only smell ammonia and sulfurous shit, fish living near human dumping grounds – whether it be farm run-off, factory effluents, or untreated sewage – find their sense of smell overwhelmed.

fishMany types of fish behave the way my Old-Spice-sporting friend hoped humans would – they seek mates who smell like their forebears.  Which they can’t necessarily do in polluted waters.  And so fish mate across species.  Their chimeric children dissolve the old boundary lines.

Perhaps you thought this couldn’t happen – the traditional definition of a “species” is a population of organisms that can produce fertile offspring only by mating with each other.  But the traditional definition is wrong; scientists don’t actually know what a species is.  Whatever boundaries exist seem porous.  The Neanderthal genes carried by modern Homo sapiens show that humans also mated with other species, at least until we drove our relatives into extinction.  Chimpanzees are the closest we have left, sharing 98% of our DNA, but now they’re endangered too.

Although – maybe that’s fine.  Not murdering our relations, or endangering the chimps; maybe it’s fine for multiple lineages to merge back into one.  I hate to find any virtue in pollution, but dissolving species boundaries doesn’t sound so bad.

Contemporary biology textbooks claim that species boundaries arise whenever subpopulations cease interbreeding.  For the “Advanced Placement” biology test, students are expected to know that speciation can be triggered by migration, or a geographic impediment like a new highway, or even cultural barriers.

A strong preference for certain types of scent might qualify as a cultural barrier.  Or tropical birds that want their mates to look or dance a certain way.  And so would anti-miscegenation laws in the United States.  Except for the gene flow provided by pale-skinned rapists, those biology textbooks imply that epidermal melanin concentrations marked a species boundary until the 1960s in the United States.

In the contemporary U.S., parental wealth creates a similar mating barrier.  In many parts of the country, children born to rich, well-educated parents rarely even chat with children born to poor people, let alone marry them.  This phenomenon has persisted for only a generation or two, which is certainly too brief to create a species division, but shows no sign of abating.

Marrying somebody who shares your interests seems fine.  My spouse and I seem to be fairly similar people.  And yet – should I be alarmed that my own choice inches us closer toward the world of Metropolis?

 

Feature image: “Character study, strong smell” by Franz Xaver Messerschmidt.

On free-market economics & the actual meaning of words.

On free-market economics & the actual meaning of words.

CaptureDespite being rather politically liberal, I consider myself a free market economist.

(Maybe it’s unfair to self-describe as an economist, though?  I did the coursework for a master’s degree in economics… but couldn’t get a degree because I didn’t complete the residency requirement.  I was enrolled as an undergraduate at the time, and apparently would’ve needed to be enrolled as a graduate student for my coursework to count.)

Sure, there are instances where free markets don’t fare so well — the free market solution to entertainment is for people to pirate whatever they’d like to watch, hear, or read, and then for producers of those media to realize they can never turn a profit.  But for many types of commerce, free markets work great.

But, just like the term “pro-life” (I describe myself as pro-life, for instance, which can confuse people because I am a staunch supporter of women’s rights and lives), the words “free market” have taken on a political connotation that doesn’t always gel with actual meaning.

For instance, I promptly began to pout when I read the following paragraphs in James Surowiecki’s New York Review of Books article, “Why the Rich Are So Much Richer“:

CaptureThe redistributive policies [Joseph] Stiglitz advocates look pretty much like what you’d expect.  On the tax front, he wants to raise taxes on the highest earners and on capital gains, institute a carbon tax, and cut corporate subsidies.  But dealing with inequality isn’t just about taxation.  It’s also about investing.  As he puts it, “If we spent more on education, health, and infrastructure, we would strengthen our economy, now and in the future.”  So he wants more investment in schools, infrastructure, and basic research.

If you’re a free-market fundamentalist, this sounds disastrous — a recipe for taking money away from the job creators and giving it to the government, which will just waste it on bridges to nowhere.  But here is where Stiglitz’s academic work and his political perspective intersect most clearly.  The core insight of Stiglitz’s research has been that, left on their own, markets are not perfect, and that smart policy can nudge them in better directions.

A strange turn of phrase.

Sure, it’s reasonable to imagine a free-market fundamentalist kvetching over increased taxes on high earners and capital gains (progressive taxation means that, for anyone outside the bottom tax bracket, choosing to work one additional hour produces income taxed at a higher percentage than the average tax rate being applied to your current income.  So the claim is that progressive taxation causes people to work less.  This claim is unverified, though, and indeed you could make an equally plausible argument for the opposite: if people want a certain post-tax income, raising tax rates will cause them to work more in order to earn that same amount).

But it’s very strange to write that a free-market fundamentalist would consider it “disastrous” to cut corporate subsidies.  How do government handouts to high-fructose corn syrup manufacturers reflect the free market?

They don’t, obviously.  But it’s so ingrained in our culture to equate things like “free-market fundamentalist” and “right-wing economist” that even very bright people (I enjoyed the rest of Surowiecki’s article) sometimes make claims about one when they mean the other.

Similarly, I think that someone who self-describes as “pro-life” should be concerned about women’s well-being, would weigh the well-being of a sentient neglected child above that of a pre-sentient fetus, would be an advocate for economic & social justice, would have empathy for livestock subject to torturous existences in CAFOs (concentrated animal feeding operation), would be appalled that environmental harm & climate destabilization is aggravating armed conflict across the globe.  Obviously I was thrilled to read Thomas Friedman’s editorial, “Why I Am Pro-Life.”  I thought it’d mean I’d get fewer confused looks.

It didn’t.  But it’s still a lovely editorial.

And, getting back to economics: even though right-wing politicians oppose it, a free-market fundamentalist would support a carbon tax.

CaptureProducing carbon is a negative externality.  That means it’s a cost of production that is not inherently paid by the producers — other well-known negative externalities are the raw sewage, bad smells, & concomitant reduced property values brought by CAFOs, or the suddenly poisonous well water in towns adjacent to certain types of coal mines.

For the free market to work properly, negative externalities must be priced through taxation.  If not, too many of the associated good are produced and everyone’s utility (“happiness” is a reasonable synonym for the word “utility”) is lower than it could’ve been.

(Well, almost everyone’s — in some cases net utility is lower, and all but one person’s utility drops, but the person operating a mine at below-market rates and poisoning everyone’s water is happier.  The mine owner might earn enough that he can afford to buy bottled water, a big house, & a politician or two.)

This is analogous to the well-known “tragedy of the commons,” the idea that if all shepherds have unlimited free access to a shared space, they’ll have their sheep overgraze it.  After a few years, the grass is dead & everyone’s sheep starve.  Similarly, if we give all corporations unlimited free access to the atmosphere as a garbage bin, each has an incentive to overpollute and kill us all.

If that sounds overdramatic, please read the Easter Island chapter of Jared Diamond’s Collapse.  The book’s central message is that environmental disaster obliterates societies, and Easter Island is perhaps the best example of a once-fertile land pillaged by its inhabitants, who then could not survive minor geological shocks.  To this day the island is covered by grassy hills & insouciant gods, but it was once densely forested & harbored a variety of plant life.  Then the inhabitants chopped down the trees.  In Diamond’s words:

CaptureI suspect that landscape amnesia provided part of the answer to my UCLA students’ question, “What did the Easter Islander who cut down the last palm tree say as he was doing it?”  We unconsciously imagine a sudden change: one year, the island still covered with a forest of tall palm trees being used to produce wine, fruit, and timber to transport and erect statues; the next year, just a single tree left, which an islander proceeds to fell in an act of incredibly self-damaging stupidity.  Much more likely, though, the changes in forest cover from year to year would have been almost undetectable: yes, this year we cut down a few trees over there, but saplings are starting to grow back again here on this abandoned garden site.  Only the oldest islanders, thinking back to their childhoods decades earlier, could have recognized a difference.  Their children could no more have comprehended their parents’ tales of a tall forest than my 17-year-old sons today can comprehend my wife’s and my tales of what Los Angeles used to be like 40 years ago.  Gradually, Easter Island’s trees became fewer, smaller, and less important.  At the time that the last fruit-bearing adult palm tree was cut, the species had long ago ceased to be of any economic significance.  That left only smaller and smaller palm saplings to clear each year, along with other bushes and treelets.  No one would have noticed the falling of the last little palm sapling.

Sure, a free-market fundamentalist would bemoan government interventions like a cap & trade system to regulate pollution.  I’m a hippy-dippy liberal and I hate the idea of cap & trade, too.  But assessing the cost to all for each unit of carbon production, then levying a tax so that corporations know the true consequences of their decisions?  That is a free market solution.

Similarly, a free-market fundamentalist should support government subsidies to education, infrastructure, and basic research.  Those are all goods with significant positive externalities, meaning each produces benefits that accrue to the population as a whole, not just to the individual who had to pay to build a road.  Since the value of these goods to the economy as a whole is undercounted, the correct equilibrium amount won’t be produced unless they are subsidized.

CapturePositive externalities are things like keeping bees.  If you keep bees, you get some honey, maybe you get some pleasure by looking at your hive from time to time.  But your decision to keep bees also makes all nearby farmland more productive.  Because it’d be difficult to track each bee & charge each nearby farmer for every flower fertilized by one of your bees, it’s more sensible to simply subsidize beekeeping (with perhaps some restrictions on where you’re keeping bees — if you’re living in the middle of a city, your bees might not be helping much).

Similarly, if you educate children, employers gain access to a more competent workforce, citizens gain more pleasant neighbors, often less needs to be spent on policing & prisons a few years down the line.  Government-funded research made possible our wireless technologies, the internet, microwave ovens — & these make everyone’s lives more efficient.  The free-market solution that compensates the researchers who gave us all these near-magical technologies is to subsidize their research.

The other common solution, the one that is not a free-market approach but is favored by many right-wing politicians, is to grant patent protections, artificially disallowing all but one corporation from producing any of a good.

That type of distinction is why it saddens me to see habitual misuse of words or phrases as slogans lend them a connotation that’s so different from their actual meaning.  Especially because, in the case of something like “free market” or “pro-life,” the distinction changes the world in appreciable ways.  Like, okay, if everybody wants to use the word “peruse” to mean “skim,” of if everybody wants to use the word “fortuitous” to mean “fortunate,” I’ll just stop using those words.  I don’t want to use them incorrectly, but I don’t want to confuse anyone, either.  But “free market” and “pro-life” are such big, emotionally-charged concepts that I get upset about political efforts to commandeer them.