A function is a relation between a set of inputs and set of outputs where each input is related to exactly one output. An example is given of a function that relates shapes to colors, where each shape maps to one unique color. A function can be written as a set of ordered pairs, where the input comes first and the output second. The domain is the set of inputs, the codomain is the set of possible outputs, and the range is the set of outputs the function actually produces. A function is one-to-one if no two distinct inputs map to the same output, and onto if every element in the codomain is mapped to by at least one input.