David Gale, a UC Berkeley mathematician who made fundamental contributions to game theory and economics and was a fervent popularizer of math, died March 7 at Alta Bates Summit Medical Center in Berkeley after a heart attack. He was 34 + 22 + 1, or 86.

His work on linear optimization is widely used in industry for a variety of tasks, such as scheduling work assignments, routing telephone networks and figuring out production and transportation schedules.

He developed tools "that enable computer scientists to figure out solutions efficiently, mathematicians to know the detailed properties of solutions and economists to understand how a solution to a problem will change if you change a parameter," said economist Joel Sobel of UC San Diego, a former student of Gale.

"David was known for his elegance, which is a term of honor for math arguments that go directly to the point, that are simple and, to our community, are beautiful," Sobel said.

He also developed an award-winning website (mathsite.math.berkeley.edu) to demonstrate mathematical concepts and allow hands-on participation by laymen.

Gale's "intellectual depth, originality of insight and thorough liveliness were apparent from the beginning and have remained a source of joy and inspiration to all of us," said Kenneth Arrow of Stanford University, a Nobel laureate in economics.

Linear optimization allows individuals or companies to maximize their preferences, subject to known constraints. For an individual, for example, that might mean purchasing the maximum amount of desired goods, subject to the limited money available.

Linear optimization theory was originally developed in the late 1940s and early '50s by renowned mathematician John von Neumann, but it was refined and brought into the computer age by Gale and his associates: Harold W. Kuhn and Albert W. Tucker. Gale's 1960 book, "The Theory of Linear Economic Models," is one of the most widely used reference texts in the field.

The work earned the three researchers the 1980 John von Neumann Theory Prize.

Working with Lloyd S. Shapley, now a professor emeritus at UCLA, Gale also solved the so-called stable marriage problem. In simplest terms, they proved that, given an equal number of men and women who rank one another in terms of romantic interest, it is possible to pair them in marriages such that everyone is happy with the outcome.

A variant of the solution was already being used nationally to pair graduating medical students and residency programs. The technique is now being used, among other things, to allocate desirable positions in public high schools to students in New York City and Boston.

Harvard economist Alvin Roth nominated Gale for the Nobel Prize in economics, noting that "it was past time that David and Lloyd share that award. I'm sorry that this now won't happen." (Nobels are not awarded posthumously.)

Gale invented his own games, including Bridg-It, also known as the "Game of Gale," and Chomp, which can be played with a bar of chocolate.

About 30 years ago, he became convinced that the world needed a math museum and began building exhibits and puzzles to demonstrate principles of mathematics and geometry. He eventually gave up on the idea because it was too large an undertaking.

But with a $40,000 grant from the Alfred P. Sloan Foundation, he was able to hire a programmer and develop MathSite, which he promoted as "an interactive source for seeing, hearing, doing mathematics." The site received the 2007 Pirelli Internetional Award for multimedia communication of mathematics.

Gale achieved a certain notoriety last year when he challenged government figures purporting to show that men had 12.7 heterosexual partners in their lifetimes, while women had only 6.5. He argued that this was logically impossible because two people had to be involved in every heterosexual coupling, and one of them had to be female.

To prove it, he offered what he called the High School Prom Theorem. "We suppose that, on the day after the prom, each girl is asked to give the number of boys she danced with," he told the New York Times. "These numbers are then added up, giving a number G. The same information is then obtained from the boys, giving a number B.

"Theorem: G = B.

"Proof: Both G and B are equal to C, the number of couples who danced together at the prom. Q.E.D."

David Gale was born Dec. 13, 1921, in New York City. He earned his bachelor's degree in mathematics at Swarthmore College in 1943, his master's at the University of Michigan in 1947 and his doctorate at Princeton in 1949.

At Princeton, he was a classmate of John Nash, the Nobel laureate in economics who was the subject of the book and movie "A Beautiful Mind." Nash credited Gale with being partly responsible for the simplicity of the proof of the theorem for which he received his Nobel.

Gale spent a year at Princeton as an instructor, then 15 years at Brown University before joining Berkeley in 1966, spending the remainder of his career there.