arithmetic20 min

Addition and Subtraction

Addition as forward movement and subtraction as backward movement on the number line

0/9Not Started

Why This Matters

Addition and subtraction are the two most fundamental operations in all of mathematics. Every other arithmetic operation builds on them: multiplication is repeated addition, division is repeated subtraction. If you understand these two operations deeply, you have the foundation for everything else.

On the number line, addition means moving to the right and subtraction means moving to the left. Adding 3 to any number moves you three steps right. Subtracting 5 moves you five steps left. This physical metaphor makes negative results intuitive: subtracting a large number from a small one simply means you moved past zero into negative territory.

One of the most important properties of addition is that it is commutative: 3 + 5 equals 5 + 3. Order does not matter. Subtraction, however, is not commutative: 5 - 3 is not the same as 3 - 5. Understanding which operations preserve order and which do not is a key insight that carries through algebra and beyond.

Define Terms

Visual Model

Start: 2initial value
+3move right 3
Result: 52 + 3 = 5
-4move left 4
Result: 15 - 4 = 1
Commutativea + b = b + a
Not Commutativea - b != b - a
Associative(a+b)+c = a+(b+c)

The full process at a glance. Click Start tour to walk through each step.

Addition moves right on the number line, subtraction moves left. Addition is commutative and associative; subtraction is neither.

Code Example

Code
// Basic addition and subtraction
console.log(7 + 3);     // 10
console.log(7 - 3);     // 4
console.log(3 - 7);     // -4 (subtraction can go negative)
console.log(-5 + 8);    // 3
console.log(-5 + (-3)); // -8

// Commutative property of addition
const a = 15, b = 27;
console.log(a + b === b + a); // true (always!)

// Subtraction is NOT commutative
console.log(a - b === b - a); // false (unless a === b)
console.log(a - b);  // -12
console.log(b - a);  //  12

// Associative property of addition
const c = 10;
console.log((a + b) + c === a + (b + c)); // true

// Subtraction is NOT associative
console.log((10 - 5) - 2);   // 3
console.log(10 - (5 - 2));   // 7  (different!)

// Identity element: adding zero changes nothing
console.log(42 + 0);  // 42
console.log(0 + 42);  // 42

// Inverse: a + (-a) = 0
console.log(7 + (-7)); // 0

Interactive Experiment

Try these exercises:

  • Verify the commutative property: pick any two numbers and confirm that a + b === b + a. Then try a - b === b - a. When are they equal?
  • Start at -10 on the number line. Add 25. Where do you end up? Now start at 25 and subtract 35. Where are you?
  • Compute (8 - 3) - 2 and 8 - (3 - 2). Are they the same? This shows why subtraction is not associative.
  • What happens when you add a negative number? Try 10 + (-7). Is adding a negative the same as subtracting?
  • Find two numbers where a - b equals b - a. What must be true about a and b?

Quick Quiz

Coding Challenge

Property Verifier

Write a function called `verifyProperties` that takes three integers a, b, and c. It should return a string describing which properties hold. Check these three properties: (1) Commutative addition: a + b === b + a, (2) Commutative subtraction: a - b === b - a, (3) Associative addition: (a + b) + c === a + (b + c). Return a string with each property on a new line: 'commutative_add: true' or 'commutative_add: false', then 'commutative_sub: true/false', then 'associative_add: true/false'.

Loading editor...

Real-World Usage

Addition and subtraction power countless real-world systems:

  • Bank transactions: Every deposit is addition, every withdrawal is subtraction. Your balance is the running sum of all transactions.
  • Inventory management: Warehouses track stock by adding shipments received and subtracting items sold. Negative inventory signals a backorder.
  • Game scoring: Points earned are added, penalties are subtracted. Leaderboards rank players by their cumulative sum.
  • Network packets: Data transfer calculates bytes sent and bytes remaining. Subtraction tracks progress through a download.
  • Time calculations: Adding hours to a time, subtracting days from a date. Calendar apps perform date arithmetic constantly.

Connections