Which of these functions from N = {1, 2, 3, …} to N is one-one but not onto?
Af(n) = n + 1
Bf(n) = n
Cf(n) = ⌈n/2⌉ (the least integer ≥ n/2)
Df(n) = n − 1 for even n, n + 1 for odd n
Show answer & solution
Correct answer: A. f(n) = n + 1
Solution: f(n) = n + 1 is one-one (different n give different values), but 1 is never a value, so it is not onto. f(n) = n and the even/odd swap are bijections; ⌈n/2⌉ is onto but not one-one (f(1) = f(2) = 1).