What is 1 + 1? Two, with binary, Boolean and programming examples
In ordinary arithmetic, 1 + 1 = 2. Combining one object with another distinct object gives two objects. Binary notation, modular arithmetic and programming operators need their own definitions; they do not make ordinary counting inconsistent.
Start with the same unit
One red counter plus one blue counter makes two counters. Likewise, one metre plus one metre gives two metres. Keep the unit and the objects being counted clear. Mixing one metre with one second is not an ordinary same-unit addition problem.
For a beginner, use two separate objects, count them together and then write the equation. Physical mixtures such as two drops merging into one drop change what is counted; they do not disprove the arithmetic statement.
Why binary writes the answer as 10
Binary uses the digits 0 and 1. When a column reaches two units, it carries into the next column: 1₂ + 1₂ = 10₂. The binary numeral 10₂ represents the same quantity as decimal 2. This is a change in notation, not a different total.
When 0 or 1 can be a valid result
| Setting | Expression | Meaning |
|---|---|---|
| Integer addition | 1 + 1 = 2 | Count two units. |
| Arithmetic modulo 2 | (1 + 1) mod 2 = 0 | Take the remainder after division by 2. |
| Logical OR | true OR true = true | At least one input is true. Some Boolean notation writes OR as +. |
| Exclusive OR | true XOR true = false | Exactly one input must be true. |
State the operation before using a Boolean convention. In particular, ordinary programming addition is not automatically logical OR, and addition in a ring or field is not a noncommutative operation merely because the structure is abstract.
Reproduce the programming distinction
These small examples were executed locally for this revision. They use built-in values, read no files and make no network requests. Python's documentation describes numeric expressions and Boolean values and operations.
print(1 + 1) # 2
print(format(1 + 1, "b")) # 10
print((1 + 1) % 2) # 0
print(True + True) # 2
print(True or True) # True
print(True ^ True) # False
print("1" + "1") # 11
JavaScript also distinguishes numbers from strings. MDN's addition reference explains when + performs addition or string concatenation:
console.log(1 + 1); // 2
console.log("1" + "1"); // 11
console.log(Number("1") + 1); // 2
A useful check before accepting an unusual answer
- Identify whether the inputs are numbers, strings, logical values or physical objects.
- Name the operation and the number system.
- Distinguish a new representation, such as binary 10, from a new quantity.
- Keep ordinary counting as the default when no alternative setting is specified.
Continue with the self-study mathematics roadmap or the Hello World programming examples.
