Spring 2019–Winter 2020

Ingestion / A Manhattan Project

The libationary permutations of Hans Peter Luhn’s Cocktail Oracle

Daniel Rosenberg

“Ingestion” is a column that explores food within a framework informed by aesthetics, history, and philosophy.


What if you know what you’ve got but don’t know what you can make with it? This question was explored in a kind of manhattan project in 1933, when Hans Peter Luhn, who two decades later would achieve fame for innovations in information processing at IBM, filed a patent for a cocktail recipe guide.[1]

Hans Peter Luhn’s Cocktail Oracle at your service. Thirsty? Try an online interactive version of the Cocktail Oracle here! Courtesy Luhn family. All photos University of Oregon Libraries.

Born in Barmen, Germany, in 1896, Luhn’s first interest was not cocktails but printing, the trade that he studied in Switzerland until the start of his service in the German army during World War I. Back in Switzerland afterwards, he designed one of his first machines, a device for recording bookkeeping entries on ledger cards. In 1924, Luhn traveled to the United States representing a German textile firm that was trying to establish overseas factories. When that effort failed, he found work in the American industry, obtaining ten US patents for textile-related devices in three years. The most enduring of these, still widely used today, was a thread counter called the Lunometer. A marvel of simplicity, the Lunometer was nothing more than a clear acrylic strip the size of a small ruler on which fine patterned lines and numbers were printed. When laid on fabric, the device produced a moiré pattern that pointed to a number on the instrument’s edge indicating the thread count of the cloth. The optical effect was well known; Luhn’s insight was to employ it as a calculator.


In light of these successes, in the early 1930s Luhn established his own engineering consultancy, H. P. Luhn & Associates, in New York. In the 1940s, he went to work for IBM, where he would spend the rest of his career. By the time of his death in 1964, Luhn had earned more than eighty patents, often clever remixes of earlier inventions, or to use the language of the patent office, prior art. These included designs for calculators, code translators, switches, breakers, relays, and data storage devices, not to mention a hosiery hanger, a system for making toy furniture, a folding game table, and a disposable raincoat.


Luhn’s 1958 Keyword-in-Context (KWIC) index, toasted in academia and industry, offers a good example of his way of mixing ideas. To make a KWIC index, a computer breaks down a text into a list of words. Each instance of each word is then listed in alphabetical order along with the words that originally appeared before and after it in the source text, making it easy to visually scan the index for entries of interest. The approach put the capabilities of the new IBM computers of the 1950s to excellent use, and very soon it was widely employed in technical indexing. In addition to the American Meteorological Society, the American Chemical Society, and other scientific institutions, the KWIC index aroused the interest of the National Bureau of Standards and the Central Intelligence Agency. New as it was in its details, Luhn’s system was old in its basic premise. As he himself explained, it was really just a mechanical implementation of the “concordance indexing” approach that had been used for centuries for the study of literary texts, tracing back all the way to the Bible index designed by the thirteenth-century French Dominican monk Hugh of Saint-Cher.[2]

Another of Luhn’s beautifully simple insights was embodied in the checksum formula that he developed for validating identification numbers. Luhn patented what is commonly known as the “Luhn algorithm” or “modulus 10” in 1960, and it is still employed widely today for detecting transcription errors in everything from social security numbers to the digits on credit cards.


Though it did not seem particularly important at the time, the patent that Luhn filed in September 1933 for a cocktail “recipe guide” had stylistic ingredients similar to these other inventions: the insight and implementation were simple, while the implications were far-reaching. Luhn was granted the patent for his recipe guide in August 1935, less than two years after the repeal of Prohibition. When he had it manufactured, he called it the “Cocktail Oracle.” He also gave it a good slogan: “What you’ll get with what you’ve got.”[3] In time, the Oracle would, in fact, provide the basis for important aspects of his work in information processing and retrieval at IBM.[4]

The Cocktail Oracle is a modest device, just a small stack of transparent acrylic cards the size of playing cards, each printed with a grid and fastened together with a grommet. “Ingredient cards”—for liquors such as scotch, rye, and vermouth, and mixers such as lemon, lime, and egg—make up the bulk of the deck. On each ingredient card, some squares are transparent; others are “blackouts.” The grid on the “key card” at the top of the deck contains cocktail names. When all of the cards are aligned in a single stack, the blacked-out grid squares block light from passing through to the key card, and no cocktail names are visible. Removing cards from the stack allows light through to some, and eventually all, of the names.


To operate the Cocktail Oracle, the user pivots out from the deck, one by one, cards that designate ingredients they would like to use. Then they hold the deck up to the light so that the names of the cocktails that can be made with those ingredients glow. For example, they might rotate out the cards for gin, lime, bitters, and soda to reveal the gin rickey. Pulling out sugar next would reveal the gin toddy as well. Italian vermouth would add the dry martini. Mint would be needed to get to the mint fizz. Lemon would add the gin sour, and then only an egg is required to add to the selection both the golden fizz and gin flip, and an orange for the gin smash. If it turned out that, in fact, there were no sugar in the cupboard, and that card were pushed back into the main deck, the gin flip, gin smash, gin sour, gin toddy, and golden fizz would no longer be visible, but the mint fizz, gin rickey, and dry martini would all still show.


It was a clever device that broke with expectations about both recipes and sorting systems. Instead of choosing a recipe and then finding the ingredients for it, Luhn’s invention allowed the user to choose ingredients first. Instead of indicating the names of drinks the given ingredients could be used to make, the cards blocked them. Instead of punched cards, Luhn’s cards were solid acrylic, so they were unlikely to snag or tear.


In his patent application, Luhn touted the broad applicability of the “optical coincidence” method modeled in the Cocktail Oracle: “It is obvious that there are possible modifications without departing from the spirit of the invention. For example, it is applicable to any recipes for mixing drinks, to recipes for food, to chemical formulae, or to any code by which it is desired to ascertain readily different combinations resulting from various designated components.” It was to the third of these, chemical formulae, that Luhn applied the principle again at IBM in the 1940s with his photoelectric Luhn Scanner. The scanner worked by shining light through punched cards; when the resulting shadow matched a target pattern on a master card, the punched card being read was selected for sorting.


Tempting as it is to see the subject matter of the Cocktail Oracle—ornamented by Luhn’s bon vivant wordplay—as just a diversion, his choice of the cocktail as an experimental problem was not frivolous. Because of the formality of its conventions, the cocktail has offered all through its history a neat articulation of a combinatorial—or mixological—information system. You see this already in early cocktail recipe books, which engage the complexity of the information problem as much as does Luhn’s Oracle. In guidebooks published prior to Luhn’s, cocktails were organized alphabetically, or by base liquor, technique, temperature, season, physical effect (restorative and temperate, for example), or other factors. And it is as often for their systems and their finding aids, rather than their recipes per se, that these books made claims to utility and originality.


From left to right: The full range of cocktails in the Luhn deck for the person stocked with all fifteen ingredients; the gin card, whose removal allows light through the panels that had blocked gin-based drinks; all the drinks possible if your bar includes gin, Italian vermouth, bitters, sugar, lemon, lime, mint, and soda.

In the combinatorial universe of the cocktail, the addition, omission, or exchange of a single ingredient can change the identity of a drink entirely. Substitute scotch for rye and a manhattan becomes a Rob Roy. Swap the olive in a martini for a cocktail onion and you have a Gibson. As the language of the Oracle suggests, there is something incantatory about a cocktail, as if it were a product of well-chosen words as much as of liquors. Here, the martini is exemplary. The basic recipe for the drink could not be simpler: gin, vermouth, and an olive. Variations on the classic dry martini mostly have to do with the amount of vermouth employed. Of course, to make a martini a martini, vermouth is required, otherwise, you only have gin. So, over time, as aficionados reduced the amount of vermouth allowed in the drink, the importance of words in it increased. One approach calls for the bottle of vermouth to be kept in another room, with the bartender merely whispering the word “vermouth” over the top of the gin.[5] Another storied recipe, devised by surrealist Luis Buñuel, 
kept the amount of vermouth in the martini to a minimum by leaving the bottle of Noilly Prat corked and allowing only a ray of sunlight to pass through it and then on into the gin.[6] In 1966, Bertram Stanleigh, an engineer at the American Standards Association, proposed the use of an electric light bulb in an update of Buñuel’s recipe, a method for which he provided a diagram as well as instructions.[7]

Luhn might well have written his original patent around chemical formulae, which, too, employ a codified nomenclature. But his aims in his 1933 patent were general, and the example of the cocktail made this wonderfully self-evident. It also provided some insight into Luhn’s playful way of mixing ideas, not to mention his old-fashioned descriptions and how-tos, a taste of which can be had here from his list of ingredients for the Bronx cocktail, golden fizz, New Deal cocktail, rye cobbler, and the others:


Grenadine     If not, pretend you have it and use any other fruit syrup


Lemons     You really should have these


Limes     Pretend you have them and use lemons


Oranges     You can’t fake this flavor … try pineapple juice


Mint     If not fresh, forget it and weep


Sugar     Bachelors! Watch this item!


Eggs     Get ’em young and healthy


Bitters     Ground nutmeg and cloves will do in a pinch


Soda     Watch for the bubbles


Bacardi     This is not a soft drink


Gin     What! No gin?


Rye     Good old rye!


Scotch     Don’t be stingy with this one


Vermouth, French     Frenchmen can’t
 be wrong!


Vermouth, Ital.     Be sure you know the 
difference

Wry humor notwithstanding, Luhn’s recipe guide deserves its place in the history of information technology; in this respect, the standard history is not wrong but too dilute. The experiments that produced US patent 2,011,722 for a “recipe guide” stirred Luhn’s interest in information design. From the Oracle came the scanner, and an allegory of invention, with a twist.



All this reading got you thirsty? Not sure what you can make with what you have lying around? Try the interactive online version of Luhn’s Cocktail Oracle.


  1. H. P. Luhn, Recipe Guide, US Patent 2,011,722, filed 16 September 1933, and issued 20 August 1935. An earlier version of this essay appears in the Festschrift for Lorraine Daston, Surprise: 100 Variations on the Unexpected, eds. Mechthild Fend, Anke te Heesen, Christine von Oertzen, and Fernando Vidal (Berlin: Max Planck Institute for the History of Science, 2019).

  2. Daniel Rosenberg, “An Archive of Words,” in Science in the Archives: Pasts, Presents, Futures, ed. Lorraine Daston (Chicago: The University of Chicago Press, 2017), and Daniel Rosenberg, “Keyword,” in Information Keywords, eds. Eric Hayot, Samuel Frederick, Jonathan E. Abel, and Michele Kennerly (New York: Columbia University Press, 2020).

  3. In fact, Luhn had a copyright for the slogan (US Copyright 20570, 1933) before he received a patent for the device. A copy of the Cocktail Oracle with a 4 × 9 grid, as depicted in Luhn’s original patent is preserved by his son, Christopher Luhn, for whose assistance I am grateful. A different version of the Oracle, with a grid of 3 × 8 and the slightly different slogan, “What you can make with what you’ve got,” is depicted in Claire K. Schultz, “H. P. Luhn,” in Encyclopedia of Computer Science and Technology, vol. 10, ed. Jack Belzer, Albert G. Holzman, and Allen Kent (New York: Marcel Dekker, 1978).

  4. H. P. Luhn, H. P. Luhn: Pioneer of Information Science; Selected Works, ed. Claire K. Schultz (New York: Spartan, 1968).

  5. Lowell Edmunds, Martini, Straight Up: The Classic American Cocktail (Baltimore: Johns Hopkins University Press, 1998), p. 33.

  6. Luis Buñuel, My Last Sigh: The Autobiography of Luis Bunuel, trans. Abigail Israel (New York: Knopf, 2013), p. 44. 

  7. American Standards Association, 
American Standard Safety Code and Requirements for Dry Martinis (New York: American Standards Association, 1966). Though it 
does not list him as the author, this pamphlet was in fact written by Bertram Stanleigh, himself a remarkable, unsung character. From the 1940s onward, he wrote album liner notes for jazz and related music genres, as for example, Calypso with Gerald Clark and his Original Calypsos (1946). During his career at the American Standards Association, he was an advocate for transparency in the formulation of standards. See Stephen H. Unger, “Role of Engineering Societies in Controlling Hazardous Technology,” Journal of Professional Issues 
in Engineering, vol. 112, no. 3 (July 1986), 
p. 154. Stanleigh’s magazine publications include a review of the first live concert performance with a Moog synthesizer: “Jazz—Moog Music in the Garden,” Audio, vol. 53, no. 11 (November 1969).


Daniel Rosenberg is a professor of history at the University of Oregon. His books include Cartographies of Time with Anthony Grafton (Princeton Architectural Press, 2010) and Histories of the Future with Susan Harding (Duke University Press, 2005). His current work concerns the history of data.

If you’ve enjoyed the free articles that we offer on our site, please consider subscribing to our nonprofit magazine. You get twelve online issues and unlimited access to all our archives.