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!n! counting formula, the link to inverses, and six worked examples
MV
Madhukar VLast updated on July 1, 20268 min read

What Is A Bijective Function?

A bijective function f:A→Bf: A \to B is one that is both injective (one-one) and surjective (onto) at the same time. Concretely, every element of the codomain BB is the image of exactly one element of the domain AA — 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)f(a) = f(b), then a=ba = b. No two inputs collide.

  • Condition 2 — onto (surjective): for every y∈By \in B, there exists x∈Ax \in A with f(x)=yf(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 BB.

  • 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 AA and BB each have nn elements, the number of bijective functions from AA to BB is:

n!=n×(n−1)×(n−2)×⋯×2×1n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1

Each symbol: nn is the common size of both sets. The first input has nn output choices; the second has n−1n-1 remaining; the third n−2n-2; down to the last input, which has only 11 output left. If ∣A∣≠∣B∣|A| \neq |B|, the number of bijections is 0. The n!n! count is exactly the number of ways to rearrange nn 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→a,b,cf: {1, 2, 3} \to {a, b, c} given by f(1)=b, f(2)=c, f(3)=af(1)=b,\ f(2)=c,\ f(3)=a is bijective.

Check one-one: the outputs bb, cc, aa are all different, so no collision.

Check onto: aa, bb, cc are all reached.

Both conditions hold, so ff is bijective.

Example 2

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

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

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

Check onto. The output −1-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,∞)→[0,∞)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:R→Rf: \mathbb{R} \to \mathbb{R}, f(x)=3x+2f(x) = 3x + 2, is bijective.

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

3a=3b3a = 3b, so a=ba = b. Injective holds.

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

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

Both conditions hold, so ff is bijective.

Example 4

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

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

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

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

Example 5

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

The map swaps each odd number with its even neighbour:

1↔21 \leftrightarrow 2

3↔43 \leftrightarrow 4

5↔65 \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 ff 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=4n = 4.

n!=4!=4×3×2×1=24n! = 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)=exf(x) = e^x bijective on R→R\mathbb{R}\to\mathbb{R} because it is one-one.

The correct way: check both. exe^x is injective, but its range is (0,∞)(0,\infty), so it misses every non-positive output and fails onto. Not bijective on R\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)=x2f(x) = x^2 without reading the codomain.

The correct way: f(x)=x2f(x) = x^2 is bijective as [0,∞)→[0,∞)[0,\infty) \to [0,\infty) but not as R→R\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 gg with f(g(x))=xf(g(x)) = x.

The correct way: a true two-sided inverse needs f(g(x))=xf(g(x)) = x and g(f(x))=xg(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 nn-element sets there are n!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 nn elements, there are n!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↦2nn \mapsto 2n), which is why they are considered the same size despite one sitting inside the other
✍️ Written By
Madhukar V
Madhukar V
Math Columnist & Analyst
I see mathematics as more than just numbers and formulas—it is a way of thinking, questioning, and understanding the world around us. I work at the intersection of mathematics, EdTech, technology, and AI-powered learning, I enjoy exploring how mathematical ideas can be made simple, meaningful, and relatable. Through my articles, I aim to present mathematics with curiosity and a practical perspective, helping readers see the beauty and relevance behind every concept in a Bhanzu way.
LinkedIn
Related Articles
Book a FREE Demo ClassBook Now →