PUMaC 2015 · 代数(B 组) · 第 2 题
PUMaC 2015 — Algebra (Division B) — Problem 2
题目详情
- [ 3 ] Let f be a function which takes in 0 , 1 , 2 and returns 0 , 1 , or 2. The values need not be distinct: for instance we could have f (0) = 1 , f (1) = 1 , f (2) = 2. How many such functions are there which satisfy: f (2) + f ( f (0)) + f ( f ( f (1))) = 5
解析
- [ 3 ] Let f be a function which takes in 0 , 1 , 2 and returns 0 , 1 , or 2. The values need not be distinct: for instance we could have f (0) = 1 , f (1) = 1 , f (2) = 2. How many such functions are there which satisfy: f (2) + f ( f (0)) + f ( f ( f (1))) = 5 Solution: Since f must return 0 , 1 , or 2, we know that of the three values f (2) , f ( f (0)) , f ( f ( f (1))), 2 of them must be 2 and one must be 1 because that is the only way to obtain 5. Case 1: f (2) = 1. Then f ( f (0)) = 2 and we can verify that this means that f (0) = 1 and f (1) = 2. And then f ( f ( f (1))) = 2 as required. So this is 1 function. Case 2: f ( f (0)) = 1. Then f (2) = 2. If f (0) = 0, then f ( f (0)) = 0 so we must have f (0) = 1 and f (1) = 1. But then f ( f ( f (1))) = 1 and f (2) + f ( f (0)) + f ( f ( f (1))) = 4 so there are no functions with f ( f (0)) = 1. Case 3: f ( f ( f (1))) = 1. Then f (2) = 2 and f ( f (0)) = 2. So f (0) is 1 or 2. If f (0) = 1, then f (1) = f ( f (0)) = 2 and f ( f ( f (1))) = 2 which isn’t the case. So f (0) = 2 as well. Then f ( f ( f (1))) = 1 and this can only happen if f (1) = 1. So this is another such function. In total there are only 2 such functions, namely ( f (0) , f (1) , f (2)) = (1 , 2 , 1) , (2 , 1 , 2). Author: Roy Zhao