Punchcard

A **punchcard** is a medium for storage of discrete data in a binary form where set binary digits are represented by punching holes in predetermined spots.

Punchcards are standardized as being half a royal hoof in width and a full royal hoof in length and having 16 rows and 32 columns, holding a total of 512 digits for a maximum possible value of

2

512

{\displaystyle 2^{512}}

.

## Terminology

A full card or doily is a card with all holes punched.

An empty card, new card or zero card is a card with no holes punched.

## Usage

Punchcards are used by the Equestrian Institute of Statistics to store the statistical data of companies and families.

The data in these punchcards is aggregated using statistical machines to compute province-level information.

It has been theorized that the bottom of documents storing the data in a written format could be punched so the documents themselves can also be used as punchcards and remove the need for documents and punchcards to be separate. However, the paper used for documents is not hard enough to be used as a punchcard. Currently, the best solution is to simply include the punchcard in the corresponding file.

## Operations

### Negation

There are two types of negation: logical and algebraic.

Logical negation, represented by the symbol

¬

{\displaystyle \neg}

, consists of using a card to produce another card where all the punched holes of the input card aren't punched in the output card and vice versa.

No commercially produced machine implements logical negations, but it is a simple operation to perform by hand.

Algebraic negation, represented by the symbol

−

{\displaystyle -}

, consists of the negation of a punchcard's number value. Punchcards only hold positive numbers, but it's possible to take advantage of ignoring calculation overflows to obtain a card which is functionally equivalent to a number's negative for addition purposes.

This can be done by means of a logical negation followed by the addition of the value 1.

### Replication

Replication of a punchcard be performed by resetting a statistical machine, inserting a card into the input slot, adding it, and then outputting the result to a new card. This creates a card which is the sum of a single card, effectively a copy of the card.

### Conjunction

Replication can be used to perform a logical conjunction (given two input cards, punch the holes that are punched in both cards) by overlapping the input cards and replicating the overlapped cards as if they were a single card.

### Disjunction

Replication can be used to perform a logical disjunction (given two input cards, punch the holes that are punched in either card) by replicating an input card and then replicating the other input card without replacing the output card, resulting in the output card having the holes of both input cards at the same time.

### Addition

Addition of an arbitrary amount of cards may be performed using a statistical machine.

### Subtraction

Newer models of statistical machines support an "undo" feature which subtracts the value of the input card from the accumulator instead of adding it. In these machines, it's possible to implement subtraction simply by undoing the addition without having done an addition prior.

Subtraction can be implemented on the basis of both logical and algebraic negation.

#### Using logical negation

Subtraction can be performed by negating the minuend, adding the subtrahend to it, and negating the result.

In other words,

A
−
# B
¬
(
¬
A
B
)

{\displaystyle A - B = \neg ( \neg A + B)}

.

This is demonstrated as the logical negation of a value is the equivalent of subtracting that value from the maximum possible value, that is,

¬
# A
M
−
A

{\displaystyle \neg A = M - A}

.

Hence, it can be proved that

¬
(
¬
A
B
# )
M
−
(
¬
A
B
# )
M
−
(
(
M
−
A
)
B
# )
M
−
M
A
−
# B
A
−
B

{\displaystyle \neg ( \neg A + B) = M - ( \neg A + B ) = M - ( ( M - A ) + B ) = M - M + A - B = A - B}

.

#### Using algebraic negation

Subtraction can be performed by negating the subtrahend and adding it to the minuend.

### Multiplication

Multiplication can be performed by the repeated addition of a card in an statistical machine without swapping the input card.