Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Functions of Set
A function assigns to each element of a set, exactly one element of a related set. Functions find their application in various fields like representation of the computational complexity of algorithms, counting objects, study of sequences and strings, to name a few.
Function − Definition
A function or mapping (defined as f: X → Y) is a relationship from elements of one set X to elements of another set Y (X and Y are non-empty sets). X is called the Domain and Y is called the Codomain of function f.
Function f is a relation on X and Y such that for each x ∈ X, there exists a unique y ∈ Y such that (x, y) ∈ R. Here, x is called the pre-image and y is called the image of function f.
A function can be one-to-one or many-to-one, but never one-to-many.
Injective / One-to-One Function
A function f: A → B is injective (one-to-one) if for every b ∈ B, there exists at most one a ∈ A such that f(a) = b. This means f is injective if a1 ≠ a2 implies f(a1) ≠ f(a2) − different inputs always produce different outputs.
Examples
- f: N → N, f(x) = 5x is injective − if 5x1 = 5x2, then x1 = x2.
- f: N → N, f(x) = x2 is injective − over natural numbers, different inputs give different squares.
- f: R → R, f(x) = x2 is not injective since (−x)2 = x2 − two different inputs give the same output.
Surjective / Onto Function
A function f: A → B is surjective (onto) if the image of f equals its codomain. Equivalently, for every b ∈ B, there exists some a ∈ A such that f(a) = b. This means every element in B is mapped to by at least one element in A.
Examples
- f: N → N, f(x) = x + 2 is surjective.
- f: R → R, f(x) = x2 is not surjective since we cannot find a real number whose square is negative.
Bijective / One-to-One Correspondent
A function f: A → B is bijective (one-to-one correspondent) if and only if f is both injective and surjective. A bijective function establishes a perfect pairing between every element in the domain and codomain.
Problem
Prove that a function f: R → R defined by f(x) = 2x − 3 is a bijective function.
Proving injective − If f(x1) = f(x2), then −
2x? - 3 = 2x? - 3 2x? = 2x? x? = x?
Since f(x1) = f(x2) implies x1 = x2, the function f is injective.
Proving surjective − For any y ∈ R, we need to find x such that f(x) = y −
2x - 3 = y 2x = y + 3 x = (y + 3) / 2
Since x = (y + 3) / 2 belongs to R for every y ∈ R, and f(x) = y, the function f is surjective.
Since f is both injective and surjective, f is bijective.
Conclusion
Functions map elements from a domain to a codomain. An injective function maps distinct inputs to distinct outputs, a surjective function covers every element in the codomain, and a bijective function does both − creating a perfect one-to-one correspondence between the two sets.
