« previous section | next section » |
Definition 3.2.1
We say that function f : X → Y is a one-to-one mapping, shortly f : X → 1-1Y, if distinct arguments have distinct values, i.e.
if x1 ≠ x2, to f(x1) ≠ f(x2) for arbitrary x1, x2 ∈ X.
We can reword the same property differently in a form of the following condition: for any x1, x2 ∈ X,
if f(x1) = f(x2), then x1= x2 for every x1, x2 ∈ X.
The one-to-one functions are also called injections. The exmple of such function is presented in Fig 3.1.3. Contrary to this, the functions shown in Fig 3.1.4 are not one-to-one mappings, e.g. the function 3.1.4(b) takes the same value for all arguments from the interval (0,1].
Please note, that to prove a given function to be an injection we must show that for any pair of elements x1, x2 of the function's domain, f(x1) has different values than f(x2). However, the proof that a function is not a one-to-one mapping, requires finding just one pair (so called contrexample), which does not fulfill the condition mentioned in the definition.
Question 3.2.1 Which of the functions shown in the example 3.1.1 are injections?
Definition 3.2.2
We say that a function f : X → Y is a mapping onto Y if and only if each element of the set Y is the value of the function, i.e.
for any y ∈ Y there is x ∈ X, such that f(x) = y.
In other words, the function is onto, if the set of its values is the set Y, Im(f) = Y. Such a function we call a surjection and we denote it shortly as f : X → ontoY.
Example 3.2.1
-(x2 + 1) ≤ 2x and 2x ≤ x2 + 1
of what we conclude that -1 ≤ 2x/(x2
+1) ≤ 1. Because 2x/(x2 +1) is a
continuous funcion, then it takes all the values of the interval [-1,
1].
Remark. Function f: X → Y, which is at the same time one-to-one mapping and onto Y is called bijection.
Example 3.2.2
Each natural number can be presented as a sequence of digits in the decimal system, or octagonal, or binary system. For example 12 = (1100) 2 = (14) 8 = (110) 3. Function bin : N → {0,1}*, which associates each natural number to its representation in a binary system, is a bijection:
begin
if n=0 then bin(n) := 0 else
i := 0; while n >0 do ai
:= n mod 2; n := n div 2; i := i+1 od;
bin(n) := (ai-1,ai-2,...,a0);
fi
end
Further down this course we will be interested in some functions that are one-to-one correspondence of a set X onto itself. For example the sequence p = (3,4,5,6,0,1,2) is a function defined in the set {0,1,2,...,6}, whose values are derrived from the formulae p(i) = (i+3) mod 7 and who fulfill the set {0,1,2,...,6}. Functions of this type are called permutations.
Question 3.2.2 Is f : N\{0} → N defined by the formulae f(n) = n * ⎣ lg n ⎦ for n>0 a mapping onto the set of natural numbers ( ⎣ lg n ⎦ denotes the integer part of the 2-based logarithm of n)?
Problem 3.2.1
Design an algorithm which would find a triangular representation of
any natural number.
« previous section | next section » |