KA-0106Inferring a rule from examples
5 points, difficulty 3 of 3Level 5–6about 105sA machine turns 3 into 7, 5 into 11 and 8 into 17. What does it turn 12 into?
Hints
Take them one at a time. The first gives nothing away.
1A nudge
Compare each output with double its input.
2The strategy
Try the simplest families in order: add something, multiply by something, or multiply and then add. Whatever you find has to fit every example, not just the first two.
3The full solution
Double 3 is 6 and the output is 7. Double 5 is 10 and the output is 11. Double 8 is 16 and the output is 17. So the rule is double and add one, giving 25.
Solution— no shortcut on this one
Test the simple families in order. Adding a fixed amount fails: 3 to 7 is plus 4, but 5 to 11 is plus 6. Try doubling: 3 doubles to 6, one short of 7; 5 doubles to 10, one short of 11; 8 doubles to 16, one short of 17. So the rule is double and add one, and 12 becomes 25. The transferable idea: a candidate rule must fit every example given, and the awkward one is there precisely to kill the wrong rules.
Why this is on the test: Several rules fit two examples and only one fits three, so the discipline is testing against all of them before answering.