Concept

What is a function?

Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk / Chapter 1

"One very, very important type of relation is called a function. Some mathematicians treat functions totally separately from relations, but I think it’s more useful to think of a function as a special kind of relation. Some relations have exactly one ordered pair for each wizard. For instance, the relation F which contains { (Harry, Dr. Pepper), (Ron, Mt. Dew), (Hermione, Mt. Dew) }. This kind of relation is a function. It associates each element of the first set with exactly one element of the second set. Obviously not all relations are functions: R, for example, is not (there’s no pair with Hermione) and neither is S (there’s more than one pair with Hermione). But those that do form a very special class of interest, and warrant a whole new terminology. When we have a function F between a set X and Y, we write F : X → Y to indicate this. The set X is called the domain of the function, and the set Y is called the codomain. The rule with functions is very simple: every element of the domain is related to exactly one element of the codomain. Sometimes we say that a domain element is “mapped” to its corresponding codomain element. Note very carefully that the reverse is not necessarily true. It’s also perfectly legit to have a function like { (Harry, Dr. Pepper), (Ron, Dr. Pepper), (Hermione, Dr. Pepper) }, where some element(s) of the codomain are left out altogether."

Related Ideas

What is a function? | Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk | Bifalgorithm | Bifalgorithm