Data & Graphs

Depth · one concept from first principles · step 2 of 4

Count functions by multiplying output choices

A function here is a choice of one output from {1,2,3,4,5} for each input 1, 2, 3. Count the choices where every input plus its output is even.
FunctionsData & probability
Your answer
How to solve
Strategy Identify Subproblems — The condition for each input involves only that input's own output, so split the problem into three small ones: list the allowed outputs for f(1), f(2), f(3) separately, then multiply because the choices are independent.
1STEP 1

Turn even sums into matching parity

A sum is even exactly when both numbers are odd or both are even. So f(a) must have the same parity as a.

2STEP 2

List the allowed outputs

f(1) and f(3) must be odd, from {1,3,5}: 3 choices each. f(2) must be even, from {2,4}: 2 choices.

3STEP 3

Multiply the choices

Each function is one choice for f(1), one for f(2) and one for f(3), made independently.

3×2×3=18
Answer
18
Without the condition there are 5×5×5=125 functions. The condition keeps roughly half of each input's choices, and 18 is a small, sensible part of 125.
Takeaway

If each input's rule only looks at its own output, count each input's choices and multiply.

  • Turn even sums into matching parity
  • List the allowed outputs
  • Multiply the choices
Where next?
Another one like thissuggested

A parent dashboard for the family lives at sensimlab.com.

▶ Practice — 12 problems