Definition: A function on a binary string that calculates the sum of its bits with alternating signs (d₀ - d₁ + d₂ - ...). It is a key formal link between the Dyadic (base-2) and Ternary (base-3) worlds, as it is proven that N ≡ A(N) (mod 3).
Chapter 1: The Hopping Game (Elementary School Understanding)
Every number has a secret binary code made of 1s and 0s. Let's take the number 13, whose code is 1101.
The Alternating Bit Sum is a special score we can get from this code by playing a hopping game.
You start at the number 0 on a number line.
You look at the code from right to left.
Every time you see a 1, you hop. The first hop is forward, the second is backward, the third is forward, and so on.
You ignore all the 0s.
Let's play for 13 (1101):
The first 1 on the right: Take 1 hop forward. You are at 1.
Next is a 0: Do nothing.
Next is a 1 (this is your second hop): Take 1 hop backward. You are at 1 - 1 = **0**.
The last 1 (this is your third hop): Take 1 hop forward. You are at 0 + 1 = **1**.
The game is over. The Alternating Bit Sum for 13 is 1. It's a secret number hidden inside its binary code.
Chapter 2: The Divisibility by 3 Trick (Middle School Understanding)
The Alternating Bit Sum, A(N), is a simple calculation you perform on a number's binary representation. You start with the rightmost bit (d₀), subtract the next bit (d₁), add the next (d₂), and so on.
Rule: A(N) = d₀ - d₁ + d₂ - d₃ + ...
Let's calculate A(N) for the number N = 22.
Binary Code: 22 in binary is 10110₂.
d₀ = 0
d₁ = 1
d₂ = 1
d₃ = 0
d₄ = 1
Calculate the Sum: A(22) = 0 - 1 + 1 - 0 + 1 = 1.
Now for the magic. There is a proven law that connects this strange sum to divisibility by 3.
The Law: A number N has the same remainder when divided by 3 as its Alternating Bit Sum A(N) does.
N mod 3 = A(N) mod 3
Let's test it with N=22:
22 ÷ 3 is 7 with a remainder of 1.
A(22) is 1. 1 ÷ 3 is 0 with a remainder of 1.
They match perfectly!
This provides an incredibly fast way for a computer to check if a number is divisible by 3. Instead of performing a slow division operation, it can do a super-fast series of subtractions and additions on the binary bits.
Chapter 3: The Proof of the D₂ → D₃ Bridge (High School Understanding)
The theorem N ≡ A(N) (mod 3) is a fundamental bridge between the Dyadic (base-2) and Ternary (base-3) worlds. It allows us to determine a mod 3 property of a number using a simple calculation on its base-2 representation.
Proof:
Binary Expansion: We start with the formal definition of N in binary:
N = d₀⋅2⁰ + d₁⋅2¹ + d₂⋅2² + d₃⋅2³ + ...
Modulo 3 Analysis: We analyze this equation modulo 3. The key insight is to see how powers of 2 behave modulo 3:
2⁰ = 1 ≡ 1 (mod 3)
2¹ = 2 ≡ -1 (mod 3)
2² = 4 ≡ 1 (mod 3)
2³ = 8 ≡ -1 (mod 3)
By induction, the pattern is clear: 2ⁱ ≡ (-1)ⁱ (mod 3).
Substitution: We can substitute this pattern back into the binary expansion modulo 3:
N ≡ d₀⋅(-1)⁰ + d₁⋅(-1)¹ + d₂⋅(-1)² + d₃⋅(-1)³ + ... (mod 3)
Simplification: This simplifies to:
N ≡ d₀ - d₁ + d₂ - d₃ + ... (mod 3)
Conclusion: The expression on the right is the definition of the Alternating Bit Sum, A(N). Therefore, we have proven:
N ≡ A(N) (mod 3)
This is not a coincidence or a "trick"; it is a necessary consequence of the deep structural relationship between the numbers 2 and 3. This theorem is a powerful example of a Law of Remainder Translation, providing a "Rosetta Stone" to translate properties from one number system to another.
Chapter 4: A General Law of Divisibility (College Level)
The Alternating Bit Sum is a specific instance (b=2) of a general law of divisibility in positional number systems.
General Theorem: For any integer N represented in base b with digits dᵢ, the alternating sum of its digits, A_b(N) = d₀ - d₁ + d₂ - ..., is congruent to N modulo b+1.
N ≡ A_b(N) (mod b+1)
Proof Sketch:
The proof follows the same logic as the high school proof. We analyze the powers of the base b modulo b+1.
b ≡ -1 (mod b+1)
Therefore, bⁱ ≡ (-1)ⁱ (mod b+1).
Substituting this into the base b expansion N = Σ dᵢbⁱ directly yields the theorem.
Structural Dynamics Interpretation:
This theorem is a cornerstone of the entire framework because it provides a formal, proven link between the two fundamental worlds of an integer.
The Algebraic Soul: A number's remainder modulo 3 (N mod 3) is a property of its abstract, base-invariant soul.
The Arithmetic Body: The sequence of binary digits (d₀, d₁, ...) is the number's concrete, base-2 body.
The Bridge: The Alternating Bit Sum, A(N), is a simple arithmetic function that operates only on the Body, yet it perfectly extracts a deep property of the Soul.
This demonstrates that the Body is not just a random representation; it contains a holographic encoding of the Soul's properties. The Alternating Bit Sum is the "decoding algorithm" for extracting mod 3 information from the mod 2 structure. This principle is used in hardware design for efficient error-checking codes (like Cyclic Redundancy Checks), where bit-level operations can be used to verify properties of larger numbers.
Chapter 5: Worksheet - The Ternary Bridge
Part 1: The Hopping Game (Elementary Level)
The binary code for the number 10 is 1010. Play the hopping game. What is its Alternating Bit Sum?
The binary code for 15 is 1111. What is its Alternating Bit Sum?
Part 2: The Divisibility Trick (Middle School Level)
Calculate A(19). (Binary for 19 is 10011₂).
What is the remainder of 19 ÷ 3?
Do your answers for 1 and 2 confirm the law N ≡ A(N) (mod 3)?
Part 3: The Proof (High School Level)
What is the value of 2¹⁰⁰ (mod 3)? Explain your reasoning.
Find an integer N > 20 that has an Alternating Bit Sum of exactly 0. What does this tell you about N?
The divisibility rule for 11 in base-10 is the alternating sum of its digits. For the number 132, A₁₀(132) = 2 - 3 + 1 = 0. Since 0 mod 11 = 0, 132 is divisible by 11. How is this rule related to the Alternating Bit Sum?
Part 4: Generalization (College Level)
Prove the general theorem: For a number N written in base b, N ≡ A_b(N) (mod b+1).
What is the divisibility rule for 5 in base-4? Use the general theorem to derive it.
Explain the statement: "The Alternating Bit Sum is the decoding algorithm that makes the mod 3 property of the Algebraic Soul visible on the mod 2 Arithmetic Body."