What is the rule?¶
Algebra · level 1, lesson 5 of 5
A question to start¶
Someone sorted some socks into two groups using a secret rule. The socks that follow the rule went into the YES group. The socks that do not follow the rule went into the NO group.
What is the secret rule? And here is a harder question: how could you make sure you have guessed it right? (It is not as easy as it looks. The answer is in the worked examples.)
The idea¶
A secret rule¶
A rule is a way of deciding YES or NO for each thing. "Is it red?" is a rule. "Does it have 4 legs?" is a rule. "Is the number bigger than 5?" is a rule. Each thing either follows the rule (YES) or does not (NO).
In the game Guess my rule, one player thinks of a rule and keeps it secret. Then they sort some things into a YES group and a NO group. The other players look carefully and try to work out the rule.
This is a mystery game, just like "I'm thinking of a number". But now the mystery is not a number. The mystery is the rule. Finding a hidden rule from examples is one of the most important things mathematicians (and scientists) do.
Look for what is the same, and what is different¶
Here is how a good detective finds a rule.
- Look at the YES group. What do all the things in it have in common? Something is the same about all of them.
- Look at the NO group. Which of those same things is missing in every NO thing?
- The rule is something every YES thing has and no NO thing has.
In the socks, the YES socks are orange, blue and green. The NO socks are also orange, blue and green. So colour cannot be the rule: there is an orange sock in YES and an orange sock in NO. What do all the YES socks have that none of the NO socks has? Stripes. A good guess is: "Socks with stripes go in YES."
Try a picture of shapes¶
Look at the YES group: an orange, a blue and a green triangle. Look at the NO group: an orange circle, a blue square, a green circle. Colour cannot be the rule (orange is in both groups). What do all the YES shapes have in common? They are all triangles. And no NO shape is a triangle. So a good guess is: "Triangles go in YES."
Number rules¶
Numbers can be sorted by secret rules too.
| YES | NO |
|---|---|
| 2, 4, 8, 10 | 1, 3, 7, 9 |
What do 2, 4, 8 and 10 have in common? Try to share each of them into two equal piles. 2 is 1 and 1. 4 is 2 and 2. 8 is 4 and 4. 10 is 5 and 5. Every one shares fairly. Now try the NO numbers: 3 cannot be shared into two equal piles (one pile gets an extra). Nor can 1, 7 or 9. Numbers that share into two equal piles are called even. The rule is "even numbers".
Other number rules children like: "bigger than 5", "has a 1 in it", "the numbers we say when we count by tens".
Test your guess with a new thing¶
Once you have a guess, test it. Pick a new thing that is not sorted yet, and say which group your rule puts it in. Then ask the rule-keeper. If they agree, your rule passed the test. If they disagree, your rule is wrong.
For the even numbers, you could test 6. Your rule says YES (3 and 3). If the rule-keeper says YES, your guess passed.
Two rules can fit the same examples¶
Here is the surprise. Look at these.
| YES | NO |
|---|---|
| 10, 12, 14 | 1, 3, 5 |
Guess 1: "even numbers". 10, 12, 14 are even ✓, and 1, 3, 5 are not ✓. It fits!
Guess 2: "numbers bigger than 9". 10, 12, 14 are bigger than 9 ✓, and 1, 3, 5 are not ✓. It also fits!
Both guesses fit every example. So the examples cannot tell us which rule is the secret one. We need a test that the two guesses disagree on. Try 2. "Even" says YES (1 and 1). "Bigger than 9" says NO. Ask the rule-keeper about 2, and the answer tells you which guess to throw away. Testing 11 works too: "even" says NO, "bigger than 9" says YES.
But testing 7 would not help: both guesses say NO. A good test is one where your guesses disagree.
Why one NO is stronger than many YESes¶
This is the deepest idea in this lesson, so read it slowly.
Suppose your guess is "even numbers", and you test 4, 6, 8, 20 and 100, and the rule-keeper says YES every time. Does that prove your rule is right? No! The secret rule might be something different that happens to agree on those numbers. (Maybe the secret rule is "even numbers, but not 50". You did not test 50.) Lots of tests that pass make you more sure, but they never make you completely sure.
But suppose you test 6 and the rule-keeper says NO. Then your guess is definitely wrong, because your rule said YES. Just one thing that breaks your rule is enough to throw it out. A thing like that is called a counterexample ("an example against").
So: many passed tests make a guess stronger. One failed test makes it wrong. Mathematicians love this idea. Later in math, to be completely sure a rule is always right, they write a proof: a reason that works for every number at once, not only the ones they tried.
A rule with two parts¶
Some rules have two parts that must both be true. "Orange and a circle." Then an orange triangle is NO (it is orange, but not a circle), a blue circle is NO (a circle, but not orange), and only orange circles are YES. These rules are harder to guess, so look at the NO things very carefully: each one is missing at least one part.
Worked examples¶
1. The socks. YES: striped orange, striped blue, striped green. NO: plain orange, plain blue, plain green.
Colour is in both groups, so colour is not the rule. Every YES sock has stripes, and no NO sock does. Guess: "socks with stripes". To make sure, you cannot. You can only test more socks. Show a striped red sock: the rule says YES. Show a plain yellow sock: the rule says NO. If the rule-keeper agrees each time, your guess is looking good. (And if they say "NO" to a striped sock with spots, maybe the rule was "stripes and no spots"!)
2. A number rule. YES: 6, 7, 8, 9. NO: 1, 2, 3, 4.
All the YES numbers are big, all the NO numbers are small. A guess: "bigger than 5". But "bigger than 4" also fits, because 5 is not sorted yet. Test 5. If 5 is YES, the rule is "bigger than 4". If 5 is NO, it could be "bigger than 5". One test, and one of the guesses is gone.
3. A counterexample. Tom's rule guess is "all animals with 4 legs go in YES". The rule-keeper puts a dog and a cat in YES. Then she puts a horse, which has 4 legs, in NO. The horse is a counterexample: Tom's rule said YES, but it is NO. Tom's guess is wrong, even though the dog and the cat fitted. Maybe the rule is "pets that live in a house".
4. A two-part rule. YES: orange circle, small orange circle. NO: blue circle, orange square, green triangle.
"Circles"? No: the blue circle is a circle but is NO. "Orange"? No: the orange square is orange but is NO. "Orange and a circle"? The YES things are both. The blue circle is not orange, the orange square is not a circle, the green triangle is neither. ✓ Everything fits.
Try it¶
- YES: 1, 3, 5, 7. NO: 2, 4, 6, 8. What is a rule that fits?
- YES: ball, orange, coin, wheel. NO: book, box, door. What is a rule that fits?
- YES: 10, 20, 30, 40. NO: 15, 22, 7, 31. Guess the rule. Is 50 YES or NO with your rule?
- YES: 11, 12, 13. NO: 2, 5, 9. Find two different rules that fit.
- For your two rules in question 4, find a number they disagree on.
- Jo's guess is "numbers with a 1 in them". The rule-keeper's YES group has 1, 10, 12, 21. Then the rule-keeper says that 31 is NO. What does that tell Jo?
- Make a secret rule for the numbers 1 to 10. Sort them into YES and NO. Can someone at home guess it?
Answers
- "Odd numbers": the numbers that cannot be shared into two equal piles. Each YES number has one left over when you make pairs; each NO number makes pairs exactly.
- "Round things" (shaped like a circle or a ball). The book, box and door all have flat sides and corners.
- "Count by tens" (10, 20, 30, ...), or "numbers that end in 0". 15, 22, 7 and 31 do not. With this rule, 50 is YES.
- Many answers. For example "bigger than 10" (11, 12, 13 are; 2, 5, 9 are not), and "two-digit numbers" (written with two digits). Another: "numbers that start with 1 and have two digits".
- "Bigger than 10" and "two-digit numbers" disagree on 10: 10 is two digits (YES), but 10 is not bigger than 10 (NO). Asking about 10 tells you which rule to keep. (Any good test is a number the two rules disagree on.)
- 31 has a 1 in it, so Jo's rule says YES, but the rule-keeper said NO. 31 is a counterexample, so Jo's guess is wrong, even though 1, 10, 12 and 21 fitted. Maybe the rule is "numbers smaller than 30 with a 1 in them", or something else. Jo needs more tests.
- Any rule works if every number from 1 to 10 is sorted by it. For example "bigger than 7" gives YES: 8, 9, 10 and NO: 1 to 7. A sneaky one: "you say it with one syllable" (YES: 1, 2, 3, 4, 5, 6, 8, 9, 10; NO: 7, which is "se-ven").
Common mistake¶
Thinking that a few examples that fit prove the rule. If your rule fits every example so far, it is a good guess, not a sure thing. Another rule may fit them too. Keep testing, and choose tests where your guesses disagree.
Looking only at the YES group. "They are all orange!" might be true of the YES group, but if there are orange things in the NO group too, then "orange" cannot be the whole rule. Always check the NO group.
Where it leads¶
- Previous: Missing numbers · Next level: Level 2: boxes and machines, where a number machine follows a secret rule and you find it from what goes in and what comes out.
- Level 1 page · Algebra topic page
- Sorting shapes by a rule you choose: Sorting and matching shapes in Geometry.
- Finding the rule that makes a pattern grow is the heart of Patterns and sequences.
- Even and odd numbers have much more to say in Number theory.
- Counterexamples and "how can you be sure?" are the start of Logic and puzzles.