# Elephant in Cairo

﻿
Elephant in Cairo

An elephant in Cairo is a term used in computer programming to describe a piece of test data that is designed to ensure that an algorithm is working. The term derives from a humorous essay circulated on the Internet and published in "Byte" magazine in September 1989 that described how various professions would go about hunting elephants, with programmers following the algorithm:

:# Go to Africa.:# Start at the Cape of Good Hope.:# Work northward in an orderly manner, traversing the continent alternately east and west until you get to Cairo,:# During each traverse pass,:#:* Catch each animal seen.:#:* Compare each animal caught to a known elephant.:#:* Stop when a match is detected.

:Experienced programmers modify Algorithm A by placing a known elephant in Cairo to ensure that the algorithm will terminate.:# Go to Africa.:# Put an elephant in Cairo.:# Start at the Cape of Good Hope.:# Work northward in an orderly manner, traversing the continent alternately east and west until an elephant is found,:# During each traverse pass,:#:* Catch each animal seen.:#:* Compare each animal caught to the elephant in Cairo.:# If the elephant is in Cairo, you put it there.

This simplifies the algorithm a little. It dates back to the 1970s.

References

Olsen, Peter C. (1989) "Pachydermic Personnel Prediction", Byte Magazine, "Stop Bit" column, September 1989.

ee also

*Elephant test

* [http://www-users.cs.york.ac.uk/susan/joke/elephant.htm Transcript] of Stop Bit, Byte magazine, September 1989, p.404
* [http://www.cl.cam.ac.uk/~fms27/door/elephant.pdf List of the other elephant hunting techniques] (PDF)

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Elephant test — The term elephant test refers to the ability to recognize something while being unable to describe it. It may be derived from a version of the Indian tale of the Blind Men and an Elephant, possibly from the John Godfrey Saxe poem . The poem… …   Wikipedia

• Cairo Apartment Building — Infobox nrhp name = Cairo Apartment Building caption = location = Washington, D. C. lat degrees = lat minutes = lat seconds = lat direction = N long degrees = long minutes = long seconds = long direction = W area = built = 1894 architect = Thomas …   Wikipedia

• The Great Elephant Chase — is a 1992 children s novel by Gillian Cross It won the Nestlé Smarties Book Prize and the Whitbread Children s Book Award. It takes place around the end of the nineteenth century, although a specific year is never stated. It follows the… …   Wikipedia

• Category:Computer humor — Subcategories This category has the following 2 subcategories, out of 2 total. E [×] Esoteric programming languages‎ (17 P) W …   Wikipedia

• literature — /lit euhr euh cheuhr, choor , li treuh /, n. 1. writings in which expression and form, in connection with ideas of permanent and universal interest, are characteristic or essential features, as poetry, novels, history, biography, and essays. 2.… …   Universalium

• Disasters — ▪ 2009 Introduction Aviation       January 23, Poland. A Spanish built CASA transport plane carrying members of the Polish air force home from a conference on flight safety in Warsaw crashes near the town of Miroslawiec; all 20 aboard are killed …   Universalium

• Éditions de Magic : l'assemblée — Cette page détaille les éditions du jeu de cartes à collectionner Magic : l assemblée. Wizards of the Coast a édité les cartes Magic sous forme d’éditions de base et d’extensions. Les éditions de base sont largement constituées de cartes… …   Wikipédia en Français

• Africa — /af ri keuh/, n. 1. a continent S of Europe and between the Atlantic and Indian oceans. 551,000,000; ab. 11,700,000 sq. mi. (30,303,000 sq. km). adj. 2. African. * * * I Second largest continent on Earth. It is bounded by the Mediterranean Sea,… …   Universalium

• Inventions in medieval Islam — A significant number of inventions were developed in the medieval Islamic world, a geopolitical region that has at various times extended from Al Andalus and Africa in the west to the Indian subcontinent and Malay Archipelago in the east.… …   Wikipedia

• Calendar of 2000 — ▪ 2001 January We are fortunate to be alive at this moment in history. Never before has our nation enjoyed, at once, so much prosperity and social progress with so little internal crisis and so few external threats. Never before have we had such… …   Universalium