**One-to-one correspondence** is a basic idea used in math. One-to-one correspondence is simply paring one thing from one group of things to another thing from another group —- one by one.

This was *probably* invented when humans discovered that they had things. At least more than one thing. Like sheep (in the case of a sheep herder), or stolen wives (in the case of a caveman). Since the early sheepherders and cavemen of the world lacked the benefit of a public education, they did what all dumb people do —- they pulled out their fingers and started counting.

For the sheepherder, each finger symbolized a sheep. For the caveman, each finger symbolized a wife. Counting on your fingers like this is a type of one-to-one correspondence.

Soon they ran into trouble. One day the sheepherder got to his last finger and realized that he had at least one more sheep than he had fingers. With a loud *"DOH!"* he started counting again. The caveman came to the conclusion that he was, in fact, a complete numskull because he kept forgetting how many fingers he had used to count his wives. This naturally caused problems when he thought one had ran away or when sisters came to visit.

Both of these early mathematical geniuses probably came up with the same solution : they first counted on their toes as well, but when that didn't work, they resorted to counting each sheep (or wife) with stones they carried in their pocket when not counting. Since there is one stone for each sheep (or wife), this is also one-to-one correspondence.

## Other Examples of One-to-one correspondence

- Pairing off team members when choosing one by one.
- Two socks that make a pair. One left for one right.
- Smacking someone back when they smack you.
- Hostage and prisoner exchanges usually use a one-to-one correspondence. One hostage/prisoner for another hostage/prisoner.
- An eye for an eye, a tooth for a tooth…
- (your example here)

## Numbers Used

One-to-one correspondence implies the use of the natural number set. Naturally, if one is paired to one, there must be a unit of one. If the sheepherder finds only a half of a sheep, he blames it on the aliens and tosses a stone. If you lose one sock, you throw the other away —- unless you have another whole sock to match it with.

It also makes since that implicit natural numbers are used because when someone counts, they count *up*, even if the thing counted can be considered negative. For example, if you count how many times you've been pulled over for speeding, you count ( 1 , 2, 3, 4… ) not ( -1, -2 , -3, -4… ).

## One-to-One Correspondence in Game Programming

One-to-one correspondence is a very old mathematical principle. Yet it can be used in associative arrays and other ways that can surprise you.