Types of Functions (Simple Definitions with Examples)
1. One-One Function (Injective)
Each input has a different output.
Example: f(x) = x + 1 for x in {1, 2, 3} -> outputs are {2, 3, 4}.
2. Onto Function (Surjective)
Every output has at least one input pointing to it.
Example: f(x) = x^2 for x in {-1, 1} -> outputs are {1} (covers all values in codomain {1}).
3. One-One and Onto (Bijective)
Each input has a unique output, and all outputs are used.
Example: f(x) = x for x in {1, 2, 3} -> outputs are {1, 2, 3}.
4. Many-One Function
Two or more inputs can have the same output.
Example: f(x) = x^2 for x in {-2, 2} -> both give output 4.
5. Into Function
Some outputs in the codomain are not used.
Example: f(x) = x for x in {1, 2}, codomain is {1, 2, 3} -> 3 is not used.
6. Constant Function
Every input gives the same output.
Example: f(x) = 5 for all x -> output is always 5.
7. Identity Function
Every input is mapped to itself.
Example: f(x) = x -> input 2 gives output 2.
8. Polynomial Function
A function like ax^n + bx^(n-1) + ... + c.
Example: f(x) = x^2 + 2x + 1.
9. Rational Function
A ratio of two polynomials.
Example: f(x) = (x + 1)/(x - 1).
10. Modulus Function
Gives the absolute value of x.
Example: f(x) = |x| -> f(-3) = 3.