Multiplying and dividing: groups
Why this matters
Multiplying is counting equal groups fast. Dividing is the reverse: sharing things out into equal groups. Training an AI model leans on both: thousands of examples are cut into equal batches, with a few left over. This lesson shows what multiplying and dividing mean as groups, what a remainder is, and the four Python signs that do this work.
- Read multiplication as equal groups and division as sharing into groups
- Split a number into a quotient and a remainder, and check it by multiplying back
- Use *, /, // and % in Python, and tell a whole-number answer from a decimal one
- Work out how many batches a training set makes, and how many are left over
The math: equal groups, and what's left over
Purpose. Counting one at a time is slow. If you know the things come in equal groups, you can count the groups instead.
Picture a tray of trail cookies laid out in rows: 4 rows of 6 cookies. That's 6 + 6 + 6 + 6, or 4 × 6 = 24.
Dividing asks the question backward: 24 cookies, 6 per bag, how many bags? 24 ÷ 6 = 4. Division undoes multiplication, so you can check a division by multiplying back: 4 × 6 = 24.
Now turn the tray sideways. It's 6 rows of 4: still 24. The order of a multiplication doesn't change the answer.
The picture draws the tray as squares, one per cookie. Press Next to bag the cookies, then again to turn the tray sideways.