Search This Blog

Showing posts with label number. Show all posts
Showing posts with label number. Show all posts

Sunday 11 December 2011

Pick a Card, Any Card

The standard way to mix a deck of playing cards—the one used everywhere from casinos to rec rooms—is what is known as a riffle (or "dovetail") shuffle. You begin by splitting the deck into two roughly equal stacks. Then you flick the cards with your thumbs off the bottoms of the piles in alternating fashion, interleaving the two stacks.

For games like blackjack or poker to be truly fair, the order of the cards must be completely random when the game begins. Otherwise a skilled cheat can exploit the lack of randomness to gain an advantage over other players.

How many riffle shuffles does it take to adequately mix a deck of 52 playing cards?
MAGIC7
Francesco Abrignani/Alamy
As it turns out, you have to shuffle seven times before a deck becomes truly scrambled. Not only that, the cards become mixed in a highly unusual way: The amount of randomness in the deck does not increase smoothly. The first few shuffles do little to disturb the original order, and even after six shuffles, you can still pick out distinctly non-random patches.

But right around the seventh shuffle something remarkable happens. Shuffling hits its tipping point, and the cards rapidly decay into chaos.

Magical Mathematics

By Persi Diaconis and Ron Graham
Princeton, 244 pages, $29.95

The seven-shuffles finding applies to messy, imperfect riffle shuffles. The deck might not be divided exactly in half, for instance, or the cards might be riffled together in a haphazard way. Far from undesirable, a little sloppiness is actually the key to a random shuffle.

A perfect (or "faro") shuffle, meanwhile, wherein the deck is split precisely in half and the two halves are zippered together in perfect alternation, isn't random at all. In fact, it's completely predictable. Eight perfect shuffles will return a 52-card deck to its original order, with every card cycling back to its starting position.
And this doesn't just work for 52 cards. A deck of any size will eventually return to its starting order after a finite sequence of faro shuffles, although the number of faros required isn't always eight—and doesn't increase linearly. If you have 104 cards, for instance, it takes 51 faros to restore the deck. For a thousand cards, it takes 36.

These findings are among the many fascinating results explored in "Magical Mathematics," a dazzling tour of math-based magic tricks. The authors, Persi Diaconis and Ron Graham, are distinguished mathematicians with high-powered academic pedigrees. Both are also accomplished magicians who have taught courses on mathematical magic at Harvard and Stanford.

Mr. Diaconis has an especially unusual résumé for a mathematician. In 1959, at age 14, he ran away from home to study with the great 20th-century sleight-of-hand master Dai Vernon—a man who once fooled Harry Houdini with a card trick. After spending 10 years under Vernon's tutelage, Mr. Diaconis returned home to New York and enrolled in night school, eventually earning a full ride to a Ph.D. program in mathematics at Harvard.

The book's title may strike some people as odd in its pairing of magic and math, but the two subjects share a common lineage that goes back centuries. In fact, some of the earliest recorded magic tricks were based in math. Fibonacci's 1202 manuscript "Liber Abaci," the foundation of modern arithmetic, contains a number of magic tricks, including several versions of the famous three-object divination, wherein a spectator mentally selects one of three objects and the magician correctly identifies the spectator's choice.

The earliest recorded card tricks, meanwhile, appear in a math text written around 1500 by a Tuscan friar who was close friends with Leonardo da Vinci. And one of the first magic manuals was compiled in the 17th century by Claude Gaspard Bachet de Méziriac, an early number theorist.
MAGIC8
Player/Alamy

But mathematical magic truly came of age in the 20th century, with the growth of magic as a mainstream hobby. "In the past hundred years, a revolution has taken place," the authors write, citing the thousands of math-based magic tricks now in circulation.

In their breezy yet authoritative book, Messrs. Diaconis and Graham showcase some of the genre's best creations as well as many new ones of their own devising. Included are tricks with coins and cards (the reader will want to have a deck handy), a divination routine that employs the I Ching—the 5,000-year-old Chinese fortune-telling book—and, my personal favorite, a gambling demonstration in which the spectator shuffles a deck of cards but somehow still manages to deal himself a royal flush in spades.

This last effect exploits something known as the Gilbreath Principle, a beautiful property discovered in the 1950s by a mathematician who worked for many years at the Rand Corp. Take a deck of cards and arrange it in alternating red-black order. Now deal half of the deck facedown into a pile—thus reversing its order—and riffle shuffle the two piles together. Finally, deal the cards face up in pairs.

Each pair will contain one red and one black card (though not necessarily in alternating order). This is the Gilbreath Principle. This same idea applies to any repeating pattern of cards. If, for instance, the deck is arranged so that the cards cycle through the four suits—clubs, hearts, spades, diamonds, clubs, hearts, spades, diamonds, and so on throughout the deck—and the same procedure is executed, then every four cards dealt off the top will contain a complete set of suits. This result, combined with a few clever subtleties, is the basis of the royal-flush effect.

All the tricks in "Magical Mathematics" are of the "self-working" variety—meaning they require little or no physical skill—and while a grasp of the underlying mathematics is helpful, it is by no means a necessity. Even math-phobes will be able to astound audiences by simply following the directions and consulting the many full-color illustrations provided throughout the text.

The mixing of magic and math is more than just a means to new tricks. It has also spawned a host of major mathematical breakthroughs. "Some magic tricks use 'real mathematics' and lead to questions beyond the limits of modern mathematics," the authors write. "Sometimes, we have been able to solve the math problems."

The seven-shuffles result is one such solution. Mr. Diaconis became interested in the math of shuffling after he encountered a card trick published in the early part of the 20th century by Charles Jordan, a chicken farmer and champion puzzle solver who invented several groundbreaking card tricks. In this particular effect—called "Long Distance Mind Reading," because it could be performed through the mail—the spectator shuffles before and after picking a card, but the magician still finds his selection.

Mr. Diaconis realized that for the trick to work shuffling had to be less effective than people generally assumed. While at Harvard, he teamed up with a mathematician named David Bayer and the two undertook a theoretical analysis, building on work done at Bell Labs in the 1950s. Their landmark 1992 paper—"Trailing the Dovetail Shuffle to its Lair"—rigorously proved that anything less than seven shuffles is inadequate. Not only that, their results had implications for a wide class of "mixing" phenomena—from stirring cake batter to compounding chemicals.

Similarly, the remarkable "looping" property of perfect shuffles is a facet of group theory—a branch of abstract mathematics that deals with, among other things, symmetric structures. Group theory has applications to chemistry, biology and, most notably, physics, where it provides the mathematical framework for the Standard Model—the overarching theory of subatomic particles and forces.

There's also a deep link between the perfect shuffle and the binary number system—the universal language of modern computing. To appreciate the connection, you first have to understand that there are two ways to do a faro. You can either weave the cards together so that the top and bottom cards stay in place—this is called an "out-faro"—or you can do what is known as an in-faro, in which the top and bottom cards each move inward by one card.

Now let's say that the ace of spades is on top, and you want to move 25 cards above it, so that the ace will be 26th from the top. The sequence of faros required to bring about this arrangement can be found by writing the number 25 in binary notation, like this: 11001. For each 1, you do an in-faro, and for each 0 you perform an out-faro. In this case, you would do two in-faros (11), followed by two outs (00) and, lastly, one more in (1).

Shuffling is one example of something seemingly ordinary that subtends an elegant mathematical structure. Juggling is another. "Mathematics is often described as the science of patterns," Messrs. Diaconis and Graham (a former president of the International Jugglers' Association) write. "Juggling can be thought of as the art of controlling patterns in time and space. Both activities offer unbounded challenges."

The central challenge in the mathematical study of juggling is to figure out which sequences of throws are possible and to categorize them according to the number of balls they require and their length—or period. Toward that end, mathematicians have developed a notation, called "siteswap," that uniquely describes all possible throwing sequences.

A siteswap pattern consists of a string of numbers, each of which specifies how much time one ball—or club, or chainsaw, or banana—spends in the air. The classic three-ball cascade, for instance, is denoted 333, because each ball is aloft for the same amount of time (three beats), and the sequence repeats after every third throw.

The remarkable thing about siteswap is that it allows jugglers to devise new patterns on paper and determine whether they're juggleable with a few simple calculations, all without tossing a single ball. What's more, the average of the digits in a pattern tells you the number of objects needed to juggle it—3 in the case of 441, for example, since the average of 4, 4 and 1 is 3.

Siteswap has led to the discovery of hundreds of unknown throwing sequences, many with just three or four balls. "Once the connection has been made between juggling (sequences) and mathematics, all kinds of doors, both mathematical as well as juggling, are thrown wide open," the authors note. "Many jugglers have been working hard to master the almost unlimited number of new patterns suggested by siteswaps."

Throughout the book, Messrs. Diaconis and Graham shuttle back and forth between magic and math, probing each trick for hidden mathematical insights and developing new magic based on what they find. In the process, they encounter a number of unsolved problems, some of which have prize money attached to them. It's a fun ride, even if you don't follow the nuances of every theorem and proof, and a refreshing change from the bombastic sort of magic one typically encounters on television.

Lovers of recreational mathematics, and especially fans of the late Martin Gardner, who contributed the foreword, will find many pleasures in "Magical Mathematics." And while exposing magic secrets in a book intended for the general public may raise hackles among some old-guard magicians, exploring the math behind these tricks will, in truth, only deepen the mystery. For, as the authors remind us, sometimes the methods are as magical as the tricks themselves.
 
—Mr. Stone is the author of the forthcoming "Fooling Houdini: Magicians, Mentalists, Math Geeks, and the Hidden Powers of the Mind."

Thursday 27 October 2011

Is modern science Biblical or Greek?


By Spengler

The "founders of modern science", writes David Curzon in Jewish Ideas Daily [1] of October 18, "were all believers in the truths of the opening chapter in the Hebrew Bible. The belief implicit in Genesis, that nature was created by a law-giving God and so must be governed by "laws of nature," played a necessary role in the emergence of modern science in 17th-century Europe. Equally necessary was the belief that human beings are made in the image of God and, as a consequence, can understand these "laws of nature."

Curzon argues that the modern idea of "laws of nature" stems from the Bible rather than classical Greece, for "ancient Greeks certainly believed that nature was intelligible and that its regularities could be made explicit. But Greek gods such as Zeus were not understood to have created the processes of nature; therefore, they could not have given the laws governing these processes."

Is this just a matter of semantics? Is there a difference between the "Greek" concept of intelligibility, and what Curzon calls the biblical concept of laws of nature? After all, the achievements of Greek science remain a monument to the human spirit. The Greek geometer Eratosthenesin the third century BCE calculated the tilt of the earth's axis, the circumference of the earth, and (possibly) the earth's distance from the sun. Archimedes used converging infinite series to calculate the area of conic sections, approximating the calculus that Newton and Leibniz discovered in the 17th century.

An enormous leap of mind, though, separates Archimedes' approximations from the new mathematics of the 17th century, which opened a path to achievements undreamed of by the Greeks. Something changed in the way that the moderns thought about nature. But does the rubric "laws of nature" explain that change? Curzon is on to something, but the biblical roots of modern science go much deeper.

Before turning to the scientific issues as such, it is helpful to think about the differences in the way Greeks and Hebrews saw the world. The literary theorist Erich Auerbach famously contrasted Greek and Hebrew modes of thought [2] by comparing two stories: the binding of Isaac in Genesis 22, and the story of Odysseus' scar told in flashback (Odyssey, Book 19).

Homer's hero has returned incognito to his home on the island of Ithaca, fearful that prospective usurpers will murder him. An elderly serving woman washes his feet and sees a scar he had received on a boar hunt two decades earlier, before leaving for the Trojan War, and recognizes him. Homer then provides a detailed account of the boar hunt before returning to his narrative.

Homer seeks to bring all to the surface, Auerbach explained in his classic essay. "The separate elements of a phenomenon are most clearly placed in relation to one another; a large number of conjunctions, adverbs, particles, and other syntactical tools, all clearly circumscribed and delicately differentiated in meaning, delimit persons, things, and portions of incidents in respect to one another, and at the same time bring them together in a continuous and ever flexible connection; like the separate phenomena themselves, their relationships - their temporal, local, causal, final, consecutive, comparative, concessive, antithetical, and conditional limitations - are brought to light in perfect fullness; so that a continuous rhythmic procession of phenomena passes by, and never is there a form left fragmentary or half-illuminated, never a lacuna, never a gap, never a glimpse of unplumbed depths."

Auerbach adds, "And this procession of phenomena takes place in the foreground - that is, in a local and temporal present which is absolute. One might think that the many interpolations, the frequent moving back and forth, would create a sort of perspective in time and place; but the Homeric style never gives any such impression."

Stark and spare, by contrast, is the story of God's summons to Abraham to sacrifice his beloved son Isaac. Where Homer tells us everything, the Bible tells us very little. God speaks to Abraham, and Abraham says, "Here I am." Auerbach observes, "Where are the two speakers? We are not told. The reader, however, knows that they are not normally to be found together in one place on earth, that one of them, God, in order to speak to Abraham, must come from somewhere, must enter the earthly realm from some unknown heights or depths. Whence does he come, whence does he call to Abraham? We are not told."

Abraham and Isaac travel together. Auerbach writes, "Thus the journey is like a silent progress through the indeterminate and the contingent, a holding of the breath, a process which has no present, which is inserted, like a blank duration, between what has passed and what lies ahead, and which yet is measured: three days!" Auerbach concludes:
On the one hand, externalized, uniformly illuminated phenomena, at a definite time and in a definite place, connected together without lacunae in a perpetual foreground; thoughts and feeling completely expressed; events taking place in leisurely fashion and with very little of suspense. On the other hand, the externalization of only so much of the phenomena as is necessary for the purpose of the narrative, all else left in obscurity; the decisive points of the narrative alone are emphasized, what lies between is nonexistent; time and place are undefined and call for interpretation; thoughts and feeling remain unexpressed, are only suggested by the silence and the fragmentary speeches; the whole, permeated with the most unrelieved suspense and directed toward a single goal (and to that extent far more of a unity), remains mysterious and "fraught with background".
Literary analysis may seem an unlikely starting-point for a discussion of science. But the Hebrew Bible's embodiment of what Auerbach called "the indeterminate and the contingent" has everything to do with the spirit of modern science. This emerges most vividly in the difference between the Greek and Hebrew understanding of time, the medium through which we consider infinity and eternity.

What separates Archimedes' approximation from Leibniz' calculus? The answer lies in the concept of infinity itself. Infinity was a stumbling-block for the Greeks, for the concept was alien to what Auerbach called their "perpetual foreground." Aristotle taught that whatever was in the mind was first in the senses. But by definition infinity is impossible to perceive. In the very large, we can never finish counting it; in the very small (for example infinitely diminishing quantities), we cannot perceive it. Infinity and eternity are inseparable concepts, for we think of infinity as a count that never ends.

For the Greeks, time is merely the demarcation of events. Plato understands time as an effect of celestial mechanics in Timaeus, while Aristotle in the Physics thinks of time as nothing more than the faucet-drip of events. That is Homer's time, in Auerbach's account. Biblical time is an enigma. That is implicit in Genesis, as Auerbach notes, but explicit in the Book of Ecclesiastes. Greek time is an "absolute temporal present."

In Hebrew time, it is the moment itself that remains imperceptible. Here is Ecclesiastes 3:15 in the Koren translation (by the 19th-century rabbi Michael Friedländer): "That which is, already has been; and that which is to be has already been; and only God can find the fleeting moment." As I wrote in another context, [3] Rabbi Friedländer's translation probably drew upon the celebrated wager that Faust offered the Devil in Goethe's drama. Faust would lose his soul will if he attempted to hold on to the passing moment, that is, to try to grasp what only God can find. The impulse to grab the moment and hold onto it is idolatrous; it is an attempt to cheat eternity, to make ourselves into gods.

A red thread connects the biblical notion of time to modern science, and it is spun by St Augustine of Hippo, the 4th-century Church father and polymath. His reflection on time as relative rather than absolute appears in Book 11 of his Confessions. And his speculation on the nature of number in time takes us eventually to the modern conceptual world of Leibniz and the calculus Aristotle's description of time as a sequence of moments, in Augustine's view, leads to absurdities.

To consider durations in time, we must measure what is past, for the moment as such has no duration. Events that have passed no longer exist, which means that measuring past time is an attempt to measure something that is not there at all. Augustine argues instead that we measure the memory of past events rather than the past itself: ''It is in you, my mind, that I measure times,'' he writes. Our perception of past events thus depends on memory, and our thoughts about future events depend on expectation. Memory and expectation are linked by ''consideration.'' For ''the mind expects, it considers, it remembers; so that which it expects, through that which it considers, passes into that which it remembers.''

Time is not independent of the intellect in Augustine's reading. Expectation and memory, Augustine adds, determine our perception of distant past and future: ''It is not then future time that is long, for as yet it is not: But a long future, is 'a long expectation of the future,' nor is it time past, which now is not, that is long; but a long past is 'a long memory of the past.''' This is the insight that allows Augustine to link perception of time to the remembrance of revelation and the expectation of redemption.

A glimpse of what Augustine's theory of time implies for mathematics appears in his later book, Six Books on Music. I argued in a 2009 essay for First Things: [4]
In De Musica, Augustine seeks to portray ''consideration'' as a form of musical number, that is, numeri judiciales, ''numbers of judgment.'' These ''numbers of judgment'' bridge eternity and mortal time; they are eternal in character and lie outside of rhythm itself, but act as an ordering principle for all other rhythms. They stand at the head of a hierarchy of numbers that begins with ''sounding rhythms'' - the sounds as such - which are in turn inferior to ''memorized rhythms.''

Only the ''numbers of judgment'' are immortal, for the others pass away instantly as they sound, or fade gradually from memory over time. They are, moreover, a gift from God, for ''from where should we believe that the soul is given what is eternal and unchangeable, if not from the one, eternal, and unchangeable God?'' For that reason the ''numbers of judgment,'' by which the lower-order rhythms are ordered, do not exist in time but order time itself and are superior in beauty; without them there could be no perception of time. Memory and expectation are linked by the ''numbers of judgment,'' which themselves stand outside of time, are eternal, and come from God.
That is an intimation of a higher order of number. Because it is buried in a treatise on musical time, Augustine's idea about "numbers of judgment" has elicited scant scholarly interest. But it is clear that his "numbers of judgment" are consistent with his much-discussed theory of "divine illumination." He wrote in Confessions, "The mind needs to be enlightened by light from outside itself, so that it can participate in truth, because it is not itself the nature of truth. You will light my lamp, Lord."

Descartes' "innate ideas" and Kant's "synthetic reason" descend from Augustine, although Kant recast the concept in terms of hard-wiring of the brain rather than divine assistance. The founder of neo-Kantian philosophy, Hermann Cohen (1842-1918) built his career out of the insight that the fact that infinitesimals in the calculus add up to a definite sum proves the existence of something like synthetic reason. That is why Kant triumphed in philosophy and the Aristotelians were reduced to a grumpy band of exiled irredentists.

Augustine's idea finds its way into modern science through Cardinal Nicholas of Cusa (1401-1464). Theologian and mathematician, Cusa noticed that musicians were tuning their instruments to ratios that corresponded to irrational numbers. The "natural" intervals of music tuning clashed with the new counterpoint of the Renaissance, so the musicians adjusted (or "tempered") the intervals to fit their requirements.

The Greeks abhorred the notion of irrational number because they abhorred infinity. Aristotle understood that infinity lurked in the irrational numbers, for we can come infinitely close to an irrational number through an infinite series of approximations, but never quite get there. And the notion of an "actual infinity" offended the Greek notion of intelligibility. To medieval mathematicians, the irrationals were surds, or ''deaf'' numbers, that is, numbers that could not be heard in audible harmonic ratios. The association of rational numbers with musical tones was embedded so firmly in medieval thinking that the existence of an irrational harmonic number was unthinkable.

The practice of musicians, Cusa argued, overthrew Aristotle's objections. The human mind, Cusa argued, could not perceive such numbers through reason (ratio), ie the measuring and categorizing faculty of the mind, but only through the intellect (intellectus), which depended on participation (participatio) in the Mind of God.

Cusa's use of Augustinian terminology to describe the irrationals - numbers ''too simple for our mind to understand'' - heralded a problem that took four centuries to solve (and, according to the few remaining "Aristotelian realists," remains unsolved to this day).

Not until the 19th century did mathematicians arrive at a rigorous definition of irrational number, as the limit of an infinite converging sequence of rational numbers. That is simple, but our mind cannot understand it directly. Sense-perception fails us; instead, we require an intellectual leap to the seemingly paradoxical concept of a convergent infinite series of rational numbers whose limit is an irrational number.

The irrational numbers thus lead us out of the mathematics of sense-perception, the world of Euclid and Aristotle, into the higher mathematics foreshadowed by Augustine (see my article, ''Nicholas of Cusa's Contribution to Music Theory,'' in RivistaInternazionale di Musica Sacra, Vol 10, July-December 1989).

Once irrational numbers had forced their way into Western thinking, the agenda had changed. Professor Peter Pesic [5] recently published an excellent account of the impact of irrational numbers in musical tuning on mathematics and philosophy. [6]

Another two centuries passed before Leibniz averred, ''I am so in favor of the actual infinite that instead of admitting that nature abhors it, as is commonly said, I hold that nature makes frequent use of it everywhere, in order to show more effectively the perfections of its author.'' Theological concerns, one might add, also motivated Leibniz' work, as I sought to show in ''The God of the Mathematicians'' (First Things, August-September 2010).

Unlike Archimedes, who still thought in terms of approximations using rational numbers, Leibniz believed that he had discovered a new kind of calculation that embodied the infinite. Leibniz' infinitesimals (as I reported in ''God and the Mathematicians'') lead us eventually to George Cantor's discovery of different orders of infinity and the transfinite numbers that designate them; Cantor cited Cusa as well as Leibniz as his antecedents, explaining ''Transfinite integers themselves are, in a certain sense, new irrationalities. Indeed, in my opinion, the method for the definition of finite irrational numbers is quite analogous, I can say, is the same one as my method for introducing transfinite integers. It can be certainly said: transfinite integers stand and fall together with finite irrational numbers.''

Gilles DeLeuze (in Leibniz and the Baroque) reports that Leibniz ''took up in detail'' Cusa's idea of ''the most simple'' number: ''The question of harmonic unity becomes that of the 'most simple' number, as Nicolas of Cusa states, for whom the number is irrational. But, although Leibniz also happens to relate the irrational to the existent, or to consider the irrational as a number of the existent, he feels he can discover an infinite series of rationals enveloped or hidden in the incommensurable.'' Leibniz thus stands between Cusa in the fifteenth century and the flowering of the mathematics of infinite series in the nineteenth century. That is a triumph of the biblical viewpoint in modern science.

We can thus draw a red line from the Hebrew Bible (most clearly from Ecclesiastes) to Augustine, and through Nicholas of Cusa to G W Leibniz and the higher mathematics and physics of the modern world. The Hebrew Bible remains a force in modern science, despite the best efforts of rationalists and materialists to send it into exile.

Kurt Goedel, perhaps the greatest mathematician of the 20th century, approached all his work with the conviction that no adequate account of nature was possible without the presence of God. Inspired by Leibniz, Goedel destroyed all hope of a mechanistic ontology through his two Incompleteness Theorems as well as his work (with Paul Cohen) on the undecidability of the Continuum Hypothesis, as I reported in a recent First Things essay. [7]

There is always a temptation to offer simple homilies in honor of the Bible, for example, "intelligent design" theory, which in my view tells us nothing of real importance. An atheist like Spinoza also would contend that God designed the world, because in his philosophy God is the same thing as nature. Design contains no information about the unique and personal God of the Bible.

Curzon's discussion of the laws of nature is by no means wrong, but it would be wrong to leave the matter there. "The fear of God is the beginning of wisdom." As Ecclesiastes (3:11) said, "I have observed the task which God has given the sons of man to be concerned with: He made everything beautiful in its time; He also put an enigma [sometimes "eternity"] into their minds so that man cannot comprehend what God has done from beginning to end" (Ecclesiastes 3:11, Artscroll translation). Eternity is in our minds but the whole of creation is hidden from us. Steven Hawking has gone so far as to conjecture that something like Goedel's Incompleteness Principle might apply to physics as well as mathematics.

What divides Hebrews from Greeks, above all, is a sense of wonder at the infinitude of creation and human limitation. The Odyssey is intended to be heard and enjoyed; Genesis 22 is to be searched and searched again for layers of meaning that are withheld from the surface. The Greek gods were like men, only stronger, better-looking and longer lived, immortal but not eternal, and the Greeks emulated them by seeking become masters of a nature infested by gods. The Hebrews sought to be a junior partner in the unending work of creation. With due honor to the great achievements of the Greeks, modernity began at Mount Sinai.