Saturday, August 18, 2007

The mathematics of TrueColor (and what it has to do with legal education)

Editor's note: This post is adapted from its original version in Jurisdynamics. Its publication in that forum predated the creation of MoneyLaw, which is arguably a better forum for expressing ideas regarding legal education. In any event, we stand again at the beginning of a school year, the most appropriate time for the sentiment articulated here.

CIE chartAugust is the cruelest month, bringing students back to the law schools, mixing memory and desire, stirring dull thoughts with fall pain.

This I remember, and this I love. Imparting visual power to an entire blog network has rekindled an old passion of mine: mathematics in motion. The mathematics of TrueColor arose in connection with website maintenance. And now footfalls echo in my memory down a passage I did not take, towards the door I now will open into the rose-garden.

I needed to redo the background in a .jpg file. "What color?" asked Microsoft Paint. "Ochre," I replied. But the oracle of Redmond understood me not. She demanded values in red, green, blue.

In despair, I asked Dr. Peter Jones, purveyor of the Web's easiest color calculator. "DDDD99," I muttered. "221 221 153," he replied.

And thus the hex was broken.

The six-digit codes designating TrueColor values represent the culmination of longstanding efforts to master the fascinating mathematics of color perception by humans in order to direct color production by machines. The graphic at the top of this post depicts the first step. The CIE (Commission International d'Éclairage) mapped human color perception onto the two-dimensional chart depicted here. Using the CIE chart, as French as the metric system but as intuitive as fathoms and furlongs, proved as easy as charting great circle routes on a flat map.

HSV coneThe CIE color chart gave way to the more geometrically satisfying HSV system for expressing color as a function of hue, saturation, and value. The HSV model resembles a cone, and slicing it generates conic sections that express some portion of the universe of visible color in a useful way. The whole enterprise is vaguely reminiscent of navigating according to spherical coordinates.

RGB color modelSo much for modeling how the human eye perceives color. How can a machine produce the 10 million different colors that the sharpest human eye can see? Coding the visible spectrum as different portions of red, green, and blue -- with each constituent color assigned eight bits of information -- yields 256 x 256 x 256 colors, or 16,777,216 in all.

The unwieldy decimal number 16,777,216 is more elegantly described as 224, or, if you insist, a binary septillion. The exponent, 24, reveals an important truth: 24 bits suffice for the expression of TrueColor. More powerful 32-bit and 48-bit systems enable transparency and sophisticated overlays that are less prone to rounding errors that would otherwise accumulate with each iteration of image filtering.

The familiar RGB (red green blue) color scheme, traceable to the awful days of the four-bit, 16-color palette of IBM's color graphics adapter, is even more helpfully expressed in hexadecimal format. Since 16 x 16 equals 256, base 16 mathematics allow us to express any value from 0 to 255 with exactly two digits. Digits 1 and 2 represent red, digits 3 and 4 represent green, and digits 5 and 6 represent blue. DDDD99 -- quite a bit of red and green, with considerably less blue -- produces MoneyLaw's background color, casually described as "ochre."

Very well then. What does all this have to do with legal education?

Long ago I ran out of digits to tally the number of legally trained professionals who have confessed bewilderment at the idea that law might -- and indeed should -- be quantified to the very limits of the power of numbers to describe the world and to prescribe how best to fix its flaws. Law school, so these individuals confessed, was the refuge from numbers, equations, graphs. Check your probability distributions at the door. We went to the law school because we bombed the GMAT, much less the MCAT.

Ah, but there lies the rose-garden. The world is filled with problems that can be expressed in numbers. If the law harbors any hope of solving them, it cannot afford to discard so basic a tool as mathematics. As undergraduates approach the LSAT, as 1Ls matriculate, as professors end their collective estivation, I offer this wish for the coming academic year. Would it be that our profession no longer confessed -- no longer cherished -- its rampant innumeracy. Would it be that the law, reunited with the tools of quantitative analysis and reinvigorated with an appreciation of mathematical beauty, might cease to be the mathematical waste land of the social sciences.

1 Comments:

Anonymous Anonymous said...

Jim (if I may and with all due respect),

No one denies the beauty and power of numbers, but I suspect there are good reasons the law is one arena of theory and praxis in which topics and problems are not amenable to quantification, any more than, say, legal reasoning is fully captured by deductive logic. One need only look at economics (with Deirdre, formerly Donald, McCloskey), which has increasingly taken refuge in mathematics in a rhetorical manner quite often deleterious to the profession. Of course there's much about economics that lends itself to mathematical axioms and models, but they suggest the attainment of a formalism and a degree of certainty that continues to elude this social science, and this observation pertains above and beyond the usual critiques of rational choice theory (which likewise has its place, provided we are keen on its very real limits, as well as the hazard of extending it beyond economics proper).

Applied to law, mathematics brings in its wake the temptations and hazards of scientism, prompting us to forget the forms and standards of rationality and practical reasoning exemplified in if not peculiar to the law. McCloskey writes that “It would of course be idiotic to object to the mere existence of mathematics in economics," as it would in jurisprudence, but in three indispensable books (The Rhetoric of Economics, 1985; If You're So Smart: The Narrative of Economic Expertise, 1990; and Knowledge and Persuasion in Economics, 1994) she courageously and cleverly attempts to persuade her colleagues in the profession to rely far less on mathematical formalism and a “scientistic style,” and far more on the “whole rhetorical tetrad—the facts, logics, metaphors, and stories necessary” [….] that allow this social science to be ever “more rational and more reasonable…”

Of course the law is not structurally liable to the same kind or degree of formalistic and scientistic temptations that have afflicted neo-classical economics for about a half century now, but given the social esteem of science, any intellectual field of inquiry is prone to the siren song of scientism...or an infatuation with numbers (See, for instance, Theodore M. Porter's Trust in Numbers: The Pursuit of Objectivity in Science and Public Life, 1995). Resort to mathematics in the social sciences, for example, leads to spillover effects, as in the tendency to believe mathematical reasoning is virtually co-extensive with what counts as rational, exemplifying, like deductive logic, a gold standard of reason and rationality.

Philosophers of science are no longer hypnotized by the hypothetico-deductive method, and while some quarters persist in thinking inductive reasoning can and should be formalized, the prospects for this seem rather dim (See John D. Norton's essays on induction). More recently, Bayesian reasoning has been the norm. As Richard Miller explains, Bayesian reasoning represents the latest incarnation of positivist fantasy, "an excess of formalism in which truisms about likelihood (plausibility, simplicity, and so forth) are given one-sided readings and abstract results are developed at too far a remove from the problems to be solved." Miller more than plausibly avers that this falling head over heals for such formalism is a consequence of “the triumph and prestige of the physical sciences, or ingrained ways of thinking in a highly monetary society, or both…” Nicholas Rescher likewise tries to account for this "penchant for quantities," this "fetish for measurement:" "People incline to think that if something significant is to be said, then you can say it with numbers and thereby transmute it into a meaningful measurement. They endorse Lord Kelvin’s dictum that ‘When you cannot express it in numbers, your knowledge is of a meager and unsatisfactory kind.’ But when one looks at the issue more clearly and critically, one finds there is no convincing reason to think this is so on any universal and pervasive basis."

While applicable to stochastic systems (as probabilistic analysis of games of chance), Bayesianism has been stretched in application to belief, “based on the principle that belief comes in degrees, usually numerical, and is governed by a calculus modeled more or less closely on the probability calculus" (Norton). Bayesianism has all the formalist pretensions of deductive reasoning, for “if there is one account of induction that does aspire to be the universal and final account, it is the Bayesian account” (Norton). Richard Miller, John D. Norton, John Earman, and the late L. Jonathan Cohen, provide reason enough to be skeptical of this latest adventure in “scientific imperialism,” that is, “the tendency for a successful scientific idea to be applied far beyond its original home, and generally with decreasing success, the more its application is extended” (John Dupré). Recall that in philosophy, Pragmatism began as a revolt against formalism: "This revolt against formalism is not a denial of the utility of formal models in certain contexts; but it manifests itself in a sustained critique of the idea that formal models, in particular, systems of symbolic logic, rule books of inductive logic, formalizations of scientific theories, etc.—describe a condition to which rational thought can or should aspire” (Hilary Putnam). To paraphrase and quote again from Putnam, our conceptions of rationality cast a net far wider than all that can be scientized, logicized, mathematized, in short, formalized: “The horror of what cannot be methodized is nothing but method fetishism.”

So, law need not discard mathematics (and I don't think it has). But without more concrete illustrations or compelling evidence to the contrary (specific applications, etc.), the belief that the legal world is chock full of problems that can be expressed in and solved by numbers, strikes this reader as unwarranted if not altogether mistaken. With good reason your story is about the mathematics of color perception, a topic well outside the law.

All good wishes,
Patrick

8/18/2007 6:20 PM  

Post a Comment

<< Home