Tutorial-topic2-functions
Tutorial-topic2-functions
Discrete Mathematics
Tutorial sheet Funtions
Question 1.
Let A and B be two sets with A = {x, y, z} and B = {1, 2, 3, 4}. Which of
the following arrow diagrams define functions from A to B?
Question 2.
Let A and B be two sets with A = {x, y, z} and B = {1, 2, 3, 4}. Let f from
A to B defined by the following arrow diagram:
Question 3.
1
H : Sn × Sn → N ∪ {0}
(s, t) → H(s, t) = The number of positions in which s and t have different values.
For n = 5, Find H(11111, 00000), H(11000, 00000) , H(00101, 01110) and
H(10001, 01111) .
Question 4.
Digital messages consist of a finite sequence of 0’s and 1’s. When they are
communicated across a transmission channel, they are frequently coded in
special ways to reduce the chance that they will be garbled by interfering
noise in the transmission lines. A simple way to encode a message of 0’s and
1’s is to write each bit three times, for example: the message 0010111 would
be encoded as 000 000 111 000 111 111 111.
Let A be the set of all strings of 0’s and 1’s and let E and D be the encoding
and the decoding function on the set A defined for each string, s, in A as
follows:
E(s) = The string obtained from s by replacing each bit of s with the same
bit written three times.
D(s) = The string obtained from s by replacing each consecutive triple of
three identical bits of s by a single copy of that bit.
Find E(0110), E(0101), D(000111000111000111111) and
D(111111000111000111000000)
Question 5.
2
6. Show that g is both one to one and onto.
Question 6.
Suppose you read that a function f : Z × Z+ → Q is defined by the formula
f (m, n) = m
n
for all (m, n) ∈ Z × Z+ .
2. Is f an onto function?
Question 7.
3. Use the graph in (1) to show that f is not a one to one (not injective)
function.
Question 8.
Let S denote the set of all 3 bit binary strings and B = (0, 1, 2, 3). The
function f : S → B is defined by the rule
1. The domain of f .
4. The range of f .
5. Say whether or not f is one to one, giving a reason for your answer.
Question 9.
Let f (x) = x mod 3, where f (x) is the remainder when x is divided by 3,
and f : Z+ → {0, 1, 2}.
3
1. Find f (7) and f (12).
Question 10.
4
2. Is h a one to one function? Prove or give a counterexample.
3. Is h an onto function? Prove or give a counterexample.
4. Is h invertible? and why? if the answer yes define h−1 .
5. On the same graph, plot the curve of h and that of h−1 if it exists.
Question 14.
Consider the following function f : R → R+ with f (x) = 2x+3 .
1. Show that f is a bijective function.
2. Find the inverse function f −1 .
3. Plot the both curves of f and of f −1 on the same graph.
Question 15.
2x
Consider the following function f : R − {−1} → R with f (x) = x+1
.
1. Show that f is a one to one function.
2. Show that f is not an onto funcion.
Question 16.