- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# 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. The third and final chapter of this part highlights the important aspects of functions.

## 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 Domain and Y is called 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. ‘x’ is called pre-image and ‘y’ is called image of function f.

A function can be one to one or many to one but not one to many.

## Injective / One-to-one function

A function f: A → B is injective or one-to-one function if for every b ∊ B, there exists at most one a ∊ A such that f(s) = t.

This means a function **f** is injective if a_{1} ≠ a_{2} implies f(a1) ≠ f(a2).

## Example

f: N → N, f(x) = 5x is injective.

f: N → N, f(x) = x

^{2}is injective.f: R → R, f(x) = x

^{2}is not injective as (-x)^{2}= x^{2}

## Surjective / Onto function

A function f: A → B is surjective (onto) if the image of f equals its range. Equivalently, for every b ∊ B, there exists some a ∊ A such that f(a) = b. This means that for any y in B, there exists some x in A such that y = f(x).

## Example

f : N → N, f(x) = x + 2 is surjective.

f : R → R, f(x) = x

^{2}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 or one-to-one correspondent if and only if **f** is both injective and surjective.

### Problem

Prove that a function f: R → R defined by f(x) = 2x – 3 is a bijective function.

**Explanation** − We have to prove this function is both injective and surjective.

If f(x_{1}) = f(x_{2}), then 2x_{1} – 3 = 2x_{2} – 3 and it implies that x_{1} = x_{2}.

Hence, f is **injective**.

Here, 2x – 3 = y

So, x = (y+5)/3 which belongs to R and f(x) = y.

Hence, f is **surjective**.

Since **f** is both **surjective** and **injective**, we can say **f** is **bijective**.

- Related Questions & Answers
- Composition of Functions of Set
- Calendar Functions in Python | Set 1( calendar(), month(), isleap()…)
- Functions of the Network Layer
- Z-Transform of Exponential Functions
- Benefits of inline functions in C++?
- Exclusive Time of Functions in C++
- Explain the functions of Session Layer.
- Explain the functions of Presentation Layer.
- Examples of String Functions in Ruby
- Regular functions vs Arrow functions in JavaScript?
- Does use of anonymous functions affect performance?
- Builtin functions of GCC compiler in C++
- What are the functions of Network Management?
- Explain the functions of a Physical Layer
- What are the functions of Network Layer?