Binary Sand: Arabic Ilm al-Raml and the Forgotten Pre-Digital Logic of Geomancy
How 9th-century Arabic scholars invented four-bit binary parity trees centuries before Leibniz and Turing.
Centuries before Gottfried Wilhelm Leibniz published 'Explication de l'Arithmétique Binaire' (1703), Islamic practitioners of Ilm al-Raml (The Science of the Sand) developed a full 4-bit binary computational system with XOR parity gates to generate combinatorial court shield charts. We reconstruct this algorithm in code.
I. The Stochastic Generation of the Mothers
he geomantic procedure begins with an analog random number generator: the diviner makes 16 horizontal rows of rapid, uncounted dots in loose sand or on vellum. Each row is then counted: an odd count yields a single point (1 / binary 1), while an even count yields two points (2 / binary 0).
Grouping four rows together produces a 4-bit tetragram ($2^4 = 16$ possible figures). The first 16 rows generate the Four Mothers (M1, M2, M3, M4).
II. Boolean Operations in the Medieval Court
The generation of subsequent figures follows strict algorithmic logic. The Four Daughters (D1–D4) are generated by transposing the matrix: D1 takes the top bits of M1–M4, D2 takes the second bits, and so forth.
The Four Nephews (N1–N4) are generated by pairwise modulo-2 addition (the exact equivalent of modern computer XOR gates): $N1 = M1 \oplus M2$, $N2 = M3 \oplus M4$, $N3 = D1 \oplus D2$, $N4 = D3 \oplus D4$.
The two Witnesses ($W1 = N1 \oplus N2$, $W2 = N3 \oplus N4$) and the final Judge ($J = W1 \oplus W2$) represent a complete binary reduction tree.
Scholarly Citations & Epistemic ApparatusAPA 7th Edition
Detailed examination of Arabic geomantic mechanical brass calculators.
Anthropological and mathematical analysis of global geomantic systems.
The Tower XVI ⇄ Mars (Pe)