Skip to main content
  1. Notes/
  2. Math/

What and Why of GCD

GCD explained to a 5-year-old
#

Imagine you have two piles of LEGO bricks. One pile has 12 bricks, and the
other has 18 bricks. You want to divide both piles into smaller groups so that:

All the groups have the same number of bricks.
Each group is as big as possible.
The GCD (Greatest Common Divisor) is the largest number of bricks you can
put in each group without leaving any leftover bricks.

Example:

For 12 and 18:

You can divide 12 into groups of 1, 2, 3, 4, 6, or 12 bricks.
You can divide 18 into groups of 1, 2, 3, 6, 9, or 18 bricks.
The largest group size that works for both is 6.
So, the GCD of 12 and 18 is 6.

Why is GCD useful?

Why Do We Need GCD?
Sharing Things Fairly: Suppose two kids want to share their LEGO piles equally
with the biggest possible group size. GCD helps figure out how to divide fairly.

GCD in Programming and Math
#

GCD is used in solving problems about patterns, grids, and even how machines
work together. For example:

Making schedules: If one bus comes every 12 minutes and another every 18
minutes, GCD helps find when both buses will come at the same time.
Think of GCD as a way to make things simple and organized!

Simplifying Fractions: If you have a fraction like 18/12, you can simplify
it to 3/2 by dividing the numerator (18) and denominator (12) by their GCD (6).