Practice question · Select all that apply
Each option lists a set of ordered pairs from {1, 2, 3} to {a, b}. Select every one that is a function on the whole of {1, 2, 3}.
Hints
- A function must assign to EACH element of the domain EXACTLY ONE output, so check both halves of that requirement.
- One option gives an input two outputs, and one option leaves an input with none.
Show the answer
- A. {(1,b), (2,b), (3,b)}
- D. {(1,a), (2,a), (3,b)}
- E. {(1,a), (2,b), (3,a)}
Why
Options 1, 3 and 5 assign exactly one output to each of 1, 2 and 3. Option 2 gives 1 two outputs, so it is a relation but not a function; option 3 leaves 3 unassigned, so it is not defined on the whole domain. Several inputs sharing one output is perfectly allowed, that only costs injectivity, not functionhood.
Practise Functions
The app has 4 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Functions
- A hash function maps a large key space into a small one, so collisions are guaranteed. Which mathematical…
- Order the steps of evaluating the composition h after g after f, applied to an input x.
- A function has an inverse exactly when it is bijective. Why do both injectivity and surjectivity turn out to…
- Sort each description by the property of a function it is describing.