Math Fundamentals18 sections · 814 units
Open in Course

Pattern - Even and Odd

Using modulo 2

The most common use of modulo is checking if a number is even or odd. If nmod2=0n \bmod 2 = 0, then nn is even. If nmod2=1n \bmod 2 = 1, then nn is odd.

For example, 8mod2=08 \bmod 2 = 0 (even) and 7mod2=17 \bmod 2 = 1 (odd). This works because even numbers are exactly those divisible by 22.

You'll use this pattern constantly. Any time you need to alternate behavior or split items into two groups, modulo 2 is your tool.