*In looking to program a very simple baseball simulation game, I stumbled upon some cute relationships between baseball and binary arithmetic. None are Earth-shattering, but they may nonetheless provoke some enjoyment or further exploration.*

When a hitter comes up to bat, the bases may be loaded, empty, or anything in between. Using 1 and 0 in their usual on/off way, each of the possible configurations of runners and bases can be described as follows–

A few properties quickly become evident–

- Powers of 2 correspond to a single runner on base.
- Even numbers correspond to first base empty, hence no force play in effect.
- Odd numbers correspond to first base occupied, hence force plays in effect.

Utilizing this same mapping, we can now look at the effect of various baseball plays. The decimal equivalent of each binary expression will be indicated in parentheses.

**Infield Single – Each runner advances one base**

- 000 (0) → 001 (1)
- 001 (1) → 011 (3)
- 010 (2) → 101 (5)
- 011 (3) → 111 (7)
- 100 (4) → 001 (1)
- 101 (5) → 011 (3)
- 110 (6) → 101 (5)
- 111 (7) → 111 (7)

The effect of an infield single is the same as applying the function *N* → 2*N *+ 1 (mod 8).

**Outfield Single – Each runner advances two bases**

- 000 (0) → 001 (1)
- 001 (1) → 101 (5)
- 010 (2) → 001 (1)
- 011 (3) → 101 (5)
- 100 (4) → 001 (1)
- 101 (5) → 101 (5)
- 110 (6) → 001 (1)
- 111 (7) → 101 (5)

The effect of an outfield single is the same as applying the function *N* → 4*N *+ 1 (mod 8).

**Double – Each runner advances two bases**

- 000 (0) → 010 (2)
- 001 (1) → 110 (6)
- 010 (2) → 010 (2)
- 011 (3) → 110 (6)
- 100 (4) → 010 (2)
- 101 (5) → 110 (6)
- 110 (6) → 010 (2)
- 111 (7) → 110 (6)

The effect of a double is the same as applying the function *N* → 4*N *+ 2 (mod 8).

**Triple – Each runner advances three bases**

- 000 (0) → 100 (3)
- 001 (1) → 100 (3)
- 010 (2) → 100 (3)
- 011 (3) → 100 (3)
- 100 (4) → 100 (3)
- 101 (5) → 100 (3)
- 110 (6) → 100 (3)
- 111 (7) → 100 (3)

The effect of a triple is the same as applying the function *N* → 8*N *+ 3 (mod 8), which is the same as mapping all values to the constant function *N* → 3. By now the reader can quickly imagine home runs mapping all values to 0.

**Challenge Problems**

- What mathematical function corresponds to a sacrifice where the batter is out but all runners advance?
- What mathematical function would correspond to a double in which all runners advance three bases?
- Characterize the binary representations of base runner configurations where a walk has the same effect as a single advancing each runner one base.
- Imagine a variation of baseball played on an
*n*-gon rather than a diamond. Let*x*<=*y*<=*n.*What mathematical function corresponds to the batter getting an*x*-base hit with each runner advancing*y*bases?