Bijective Function — One-One and Onto, Examples

#Algebra
TL;DR
A bijective function is one that is both one-one (injective) and onto (surjective) — every output is reached by exactly one input, with no collisions and nothing left out. This article gives the definition, the two conditions, the one-to-one correspondence idea, the $n!$ counting formula, the link to inverses, and six worked examples
BT
Bhanzu TeamLast updated on July 1, 20268 min read

What Is A Bijective Function?

A bijective function $f: A \to B$ is one that is both injective (one-one) and surjective (onto) at the same time. Concretely, every element of the codomain $B$ is the image of exactly one element of the domain $A$ — not zero (that would fail onto), not two or more (that would fail one-one). Another name for it is a bijection, or a one-to-one correspondence.

The definition rests on two ideas covered separately: the injective function (no two inputs share an output) and the onto function (every output is reached). Bijective is the conjunction; you need both, not either.

What Are The Conditions For A Function To Be Bijective?

A function is bijective if and only if it satisfies both conditions below:

  • Condition 1 — one-one (injective): if $f(a) = f(b)$, then $a = b$. No two inputs collide.

  • Condition 2 — onto (surjective): for every $y \in B$, there exists $x \in A$ with $f(x) = y$. No output is left out.

Drop either one and the function stops being a bijection. A function can be one-one but not onto, onto but not one-one, or neither — only the functions clearing both bars are bijective.

How Is A Bijective Function Connected To Its Inverse?

This is the question that makes bijections matter: why does a function need to be bijective to have an inverse? Because the inverse has to send every output back to one input, with no ambiguity and no gaps.

  • Onto guarantees there's something to map back from — every codomain element has a preimage, so the reverse map is defined everywhere on $B$.

  • One-one guarantees the reverse choice is unique — each output came from a single input, so the reverse map knows exactly which one to return.

Put together, a function has a two-sided inverse function if and only if it is bijective. That biconditional is the whole reason the concept is taught: bijection is the precise condition for reversibility.

What Is The Number Of Bijective Functions Between Two Finite Sets?

A bijection can only exist between sets of the same size. If $A$ and $B$ each have $n$ elements, the number of bijective functions from $A$ to $B$ is:

$$n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1$$

Each symbol: $n$ is the common size of both sets. The first input has $n$ output choices; the second has $n-1$ remaining; the third $n-2$; down to the last input, which has only $1$ output left. If $|A| \neq |B|$, the number of bijections is 0. The $n!$ count is exactly the number of ways to rearrange $n$ items, which is why bijections from a set to itself are also called permutations.

Examples Of Bijective Functions

The six examples move from a finite check through proofs to a counting problem, with one deliberate wrong turn.

Example 1

Decide whether $f: {1, 2, 3} \to {a, b, c}$ given by $f(1)=b,\ f(2)=c,\ f(3)=a$ is bijective.

Check one-one: the outputs $b$, $c$, $a$ are all different, so no collision.

Check onto: $a$, $b$, $c$ are all reached.

Both conditions hold, so $f$ is bijective.

Example 2

Decide whether $f: \mathbb{R} \to \mathbb{R}$, $f(x) = x^2$, is bijective.

The tempting move is "$x^2$ maps reals to reals cleanly, so it pairs them off."

Check one-one first. Suppose $a^2 = b^2$; this allows $a = -b$, so $f(2) = f(-2) = 4$. One-one fails.

Check onto. The output $-1$ has no real preimage, since no square is negative. Onto fails too.

The function is not bijective — it breaks both conditions. The "clean formula must pair things off" instinct ignored the negative root and the negative outputs. Restricting to $f: [0,\infty) \to [0,\infty)$ repairs both and makes it bijective. The first instinct to trust a familiar formula is exactly where this one goes wrong.

Example 3

Prove that $f: \mathbb{R} \to \mathbb{R}$, $f(x) = 3x + 2$, is bijective.

One-one: assume $3a + 2 = 3b + 2$.

$3a = 3b$, so $a = b$. Injective holds.

Onto: take any $y \in \mathbb{R}$ and solve $3x + 2 = y$.

$x = \dfrac{y - 2}{3}$, which is real for every $y$. Surjective holds.

Both conditions hold, so $f$ is bijective.

Example 4

Decide whether $f: \mathbb{R} \to \mathbb{R}$, $f(x) = x^3$, is bijective.

One-one: $a^3 = b^3$ forces $a = b$ (one real cube root each). Injective holds.

Onto: every real $y$ has the real preimage $x = \sqrt[3]{y}$. Surjective holds.

So $f$ is bijective, which is why $x^3$ has the clean inverse $\sqrt[3]{x}$.

Example 5

Decide whether $f: \mathbb{N} \to \mathbb{N}$ defined by $f(x) = x + 1$ if $x$ is odd and $f(x) = x - 1$ if $x$ is even is bijective. (Take $\mathbb{N} = {1, 2, 3, \dots}$.)

The map swaps each odd number with its even neighbour:

$1 \leftrightarrow 2$

$3 \leftrightarrow 4$

$5 \leftrightarrow 6$, and so on.

One-one: distinct numbers land on distinct partners — no collision.

Onto: every natural number is the partner of some other, so all outputs are reached.

So $f$ is bijective (it is its own inverse).

Example 6

Count the bijective functions from a 4-element set to a 4-element set.

Both sets have size $n = 4$.

$$n! = 4! = 4 \times 3 \times 2 \times 1 = 24$$

There are 24 bijections — equivalently, 24 ways to permute 4 items.

Why Bijections Matter: "A Bijection Is A Perfect Translation"

Bijections exist because mathematics needed a precise way to say two sets are interchangeable — every element of one matched with exactly one of the other, losing nothing.

  • They define "same size." Two sets have the same number of elements precisely when a bijection exists between them. For infinite sets, this is the only definition that works, and it is how we know the integers and the rationals are the "same size" while the reals are strictly larger.

  • They guarantee reversibility. Encryption that must decrypt, a coordinate change that must reverse, a rotation matrix that must undo a rotation — each needs a bijection so the operation can be cleanly inverted.

  • They are the permutations. Every reshuffling of a deck of cards is a bijection from the deck to itself.

The destination this opens is set theory's comparison of infinities. Georg Cantor (1845–1918, Germany) used bijections to prove that no bijection exists between the integers and the real numbers — the famous diagonal argument — establishing that some infinities are bigger than others.

Where Bijectivity Breaks Down

Three mistakes account for most wrong "is it bijective?" answers.

Mistake 1: Checking only one condition

Where it slips in: problems where a function clears one bar and the student stops.

Don't do this: declare $f(x) = e^x$ bijective on $\mathbb{R}\to\mathbb{R}$ because it is one-one.

The correct way: check both. $e^x$ is injective, but its range is $(0,\infty)$, so it misses every non-positive output and fails onto. Not bijective on $\mathbb{R}$. The rusher who confirms injectivity and moves on trips here.

Mistake 2: Ignoring the codomain

Where it slips in: the same formula declared with different target sets.

Don't do this: answer "bijective" for $f(x) = x^2$ without reading the codomain.

The correct way: $f(x) = x^2$ is bijective as $[0,\infty) \to [0,\infty)$ but not as $\mathbb{R} \to \mathbb{R}$. Bijectivity is a statement about the function and its declared domain and codomain together, not the formula alone.

Mistake 3: Assuming any inverse-looking formula proves a bijection

Where it slips in: problems where a candidate inverse is written down without checking it works both ways.

Don't do this: claim a bijection just because you can write some $g$ with $f(g(x)) = x$.

The correct way: a true two-sided inverse needs $f(g(x)) = x$ and $g(f(x)) = x$. A one-sided inverse alone signals one-one or onto, not both. The memorizer who recalls "has an inverse $\Rightarrow$ bijective" without verifying both compositions can be misled.

Conclusion

  • A bijective function is both one-one and onto: every output is reached by exactly one input.

  • Both conditions are required — checking only injectivity or only surjectivity is the most common mistake.

  • A function has a two-sided inverse if and only if it is bijective.

  • A bijection exists only between sets of equal size; for two $n$-element sets there are $n!$ of them.

  • Bijections define what it means for two sets to have the same size, even for infinite sets.

To take bijections further with a teacher who builds the reasoning step by step, explore Bhanzu's algebra tutor, find help with algebra, or browse math classes online. Want a live Bhanzu trainer to walk through bijection proofs with your child? Book a free demo class.

Read More

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

Is a bijective function the same as a one-to-one correspondence?
Yes. "Bijection," "bijective function," and "one-to-one correspondence" all name the same thing: a function that is both one-one and onto
Does every bijective function have an inverse?
Yes — and this is the headline fact. A function has a two-sided inverse if and only if it is bijective
Can a constant function be bijective?
No. A constant function sends every input to one output, so it fails one-one (unless the domain has a single element) and usually fails onto as well
How many bijections are there from a set to itself?
For a set of $n$ elements, there are $n!$ bijections — these are exactly its permutations
Can two infinite sets have a bijection between them?
Yes. The integers and the even integers have a bijection ($n \mapsto 2n$), which is why they are considered the same size despite one sitting inside the other
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →