Bijective Functions
Bijective Functions
by Jan Plaza
Exercise
Construct examples of functions from N to N which are:
1. 1-1 and onto N.
2. 1-1 but not onto N.
3. Not 1-1 but onto N.
4. Neither 1-1 nor onto N.
Bijections
Definition
1. Let f : X −→ Y . f is a bijection between X and Y or
f is a 1-1 correspondence between X and Y or
f is a one-to-one correspondence between X and Y , denoted
1-1, onto
f :X −→ Y , if f is both one-to-one and onto Y .
In the three phrases above we can replace “between X and Y ” by
“from X to Y ” or “from X onto Y ”.
Let f : X −→ Y .
1. f is an injection iff ∀x1 ,x2 ∈X (f (x1 ) = f (x2 ) → x1 = x2 ).
2. f is a surjection onto Y iff ∀y∈Y ∃x f (x) = y
3. f is a bijection between X and Y iff f is 1-1 and onto Y .
Notes
onto
f : X −→ Y f : X −→ Y
domain(f ) = X domain(f ) = X
range(f ) ⊆ Y range(f ) = Y
Horizontal line tests
Let f : R −→ R. Then,
1. f is 1-1 iff every horizontal line intersects the graph of f in at most one point.
2. f is onto R iff every horizontal line intersects the graph of f in at least one point.
3. f is a bijection between R and R iff every horizontal line intersects the graph of f
in exactly one point.
Exercise
1. Formulate vertical and horizontal line tests for functions f : X −→ Y where
X, Y ⊆ R.
2. Formulate vertical and horizontal line tests for functions visulized in discrete
Cartesian diagrams.
Exercise
True or false?
1-1
1. ∅ : ∅ −→ X ?
Exercise
True or false?
1-1
1. ∅ : ∅ −→ X ? True
Exercise
True or false?
1-1
1. ∅ : ∅ −→ X ? True
1-1, onto
2. ∅ : ∅ −→ ∅.
Exercise
True or false?
1-1
1. ∅ : ∅ −→ X ? True
1-1, onto
2. ∅ : ∅ −→ ∅. True
Fact
Every function f is onto range(f ).
Exercise
1-1
Complete: If f : X −→ Y then f is a bijection between X and ...
Character codes
1. ASCII code is a bijection between the set of ASCII characters and the integers in
the range 0 .. 27 −1, i.e 0..127. (ASCII characters include
a-z,A-Z,0-9, some punctuation marks and symbols, as well as some special
characters which do not have graphic representation but which can typed on a
computer keyboard.)
2. Extended ASCII code ISO Latin-1 is a bijection between the set of a set of
Latin-based characters of most European languages and the integers in the range
0 .. 28 −1, i.e 0 .. 255. It is an extension of the ASCII code.
3. Unicode is an injection from the set of all historic and contemporary characters
and symbols known used by humanity into the set of integers in the range
0 .. 17 · 216 , i.e. 0 .. 1,114,111. It is an extension of ISO Latin-1. Every next
version of Unicode covers more characters/symbols/glyphs but it is not a goal to
make any future version a bijection onto the range above.
Encryption and decryption fucntions
Password verification can be done using an encryption-like function that does not have
a corresponding decryption function. Such a function is usually not an injection and is
designed so that:
I For any string a, it is computationally easy to compute e(a);
I For any string b it is computationally infeasible to find an a s.t. e(a) = b;
I It is computationally infeasible to find a, a0 s.t a 6= a0 and e(a) = e(a0 ).
A function with these properties, is called a cryptographic hash function .
Identity verification and digital signatures