Computer Science I / Functions
Practice question · Sort into groups

Sort each description by the property of a function it is describing.

Groups: A statement about injectivity · A statement about surjectivity

Hints
  1. Ask whether the description constrains the inputs or the codomain.
  2. Collisions are about the domain side; coverage is about the codomain side.
Show the answer

A statement about injectivity: No two different inputs share an output, If f(a) equals f(b) then a equals b, There are no collisions between inputs

A statement about surjectivity: Every element of the codomain is hit by some input, The image is the whole of the codomain, Nothing in the codomain is left uncovered

Why

Injectivity restricts the inputs, distinct inputs must give distinct outputs, so nothing collides. Surjectivity restricts the codomain, nothing may be left out, so the image fills it. A function can have either without the other, and a bijection is precisely one that has both, which is what makes it invertible.

Read the lesson: Functions →

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