Download Discrete Maths hw3 solutions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Large numbers wikipedia , lookup

Abuse of notation wikipedia , lookup

Functional decomposition wikipedia , lookup

Big O notation wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Fundamental theorem of calculus wikipedia , lookup

Continuous function wikipedia , lookup

Dirac delta function wikipedia , lookup

Function (mathematics) wikipedia , lookup

History of the function concept wikipedia , lookup

Non-standard calculus wikipedia , lookup

Function of several real variables wikipedia , lookup

Transcript
DT6248 Discrete Maths
Functions
Homework
Solutions
1) What is a function from X to Y?
Answer: Let X and Y be sets. A function f from X to Y is a subset of the
Cartesian product X  Y having the property that for each x  X , there is
exactly one y  Y with ( x, y )  f .
2) Given a set of points in the plane, how can we tell whether it is a function?
Answer: A set S of points in the plane defines a function when each
vertical line intersects at most one point of S.
3) Define inverse function. Give an example of a function and its inverse. Given
the arrow diagram of a function, how can we find the arrow diagram of the
inverse function?
Answer: If f is a one-to-one, and onto function from X to Y, the inverse
function is
f 1  {( y, x) ( x, y)  f }
Example: f  {(a,1), (b,3), (c, 0)} for X  {a, b, c} and Y  {1,3, 0}
f 1  (1, a),(3, b),(0, c)
Given the arrow diagram of a one-to-one, onto function f from X to Y, we
can obtain the arrow diagram for f-1 by reversing the direction of each
arrow.
Page 1 of 4
4) Determine whether each set is a function from X = {1,2,3,4} to Y = {a,b,c,d}. If
it is a function, find its domain and range, draw its arrow diagram, and determine
if it is one-to-one, onto or both.
a) {(1,a,),(2,a),(3,c),(4,b)}
b) {(1,c),(2,a),(3,b),(4,c),(2,d)}
c) {(1,d),(2,d),(4,a)}
Answer: a) It is a function, It’s not one-to-one or onto.
1
a
2
3
b
c
4
d
b) It is not a function
c) It is a function. It’s not one-to-one or onto.
1
a
2
b
c
3
4
d
5) Determine whether each function is one-to-one. The domain of each function is
the set of all real numbers. If the function is not one-to-one, prove it. Also,
determine whether f is onto the set of all real numbers. If f is not onto, prove it.
a) f(x) = 6x – 9
b) f(x) = 2x3 - 4
Answer: a) f is both one-to-one and onto.
b) f is both one-to-one and onto.
Page 2 of 4
6) Given g = {(1,b),(2,c),(3,a)}, a function from X = {1,2,3} to Y = {a,b,c,d} and
f = {(a,x),(b,x),(c,z),(d,w)}, a function from Y to Z = {w,x,y,z} write f g as a
set of ordered pairs and draw the arrowed diagram of f g .
Answer: f g  (1, x),(2, z),(3, x)
1
2
3
w
x
y
z
7) Let f and g be functions from the positive real numbers to the positive real
numbers defined by the equations
f ( x)  2x  , g ( x)  x2
Find the compositions f f , g g , f g , and g f .
Answer:
f
f  2 2 x  , g g  x 4 , f g  2x 2  , and g f  2x  .
2
8) Decompose the following functions into simpler function:
a) f ( x)  log 2 ( x 2  2)
b) f ( x)  2sin x
Answer: a) Let g ( x)  log 2 x and h( x)  x 2  2. Then f ( x)  ( g h)( x).
b) Let g ( x)  2 x and h( x)  sin x. Then f ( x)  ( g h)( x).
9) Given f  {( x, x 2 ) | x  X }. a function from X to {-5,-4,….,4,5} to the set of
integers, write f as a set of ordered pairs and draw the arrow diagram of f. Is f
one-to-one or onto?
Answer: f = {(-5,25),(-4,16),(-3,9),(-2,4),
(-1,1),(0,0),(1,1),(2,4),(3,9),(4,16),(5,25)}. f is neither one-to-one nor
onto.
10) For the hash function show how the data would be inserted in the order given in
initially empty cells. Use the collision resolution policy.
h( x)  x mod11; cells indexed 0 to 10; data: 53,13,281,743,377,20,10,796
Answer: 53:9, 13:2, 281:6, 743:7, 377: 3, 20:10:10, 10:0, 796:4
Page 3 of 4
11) Let g be a function from X to Y and let f be a function from Y to Z, if the
statement is true, prove it.; otherwise, give a counterexample.
a) If g is one-to-one, then f g is one-to-one.
b) If f and g are onto, then f g is onto.
c) If f g is one-to-one, then g is one-to-one.
Answer: a) False, Take g  {(1, a), (2, b)} and f  {(a, z ), (b, z )}
b)
True. Let z  Z . Since f is onto, there exists y  Y such that f ( y )  z. Since,
g is onto, there exists x  X such that g ( x)  y. Now f ( g ( x))  f ( y )  z.
Therefore, f g is onto.
c)
True. Suppose that g ( x1 )  g ( x2 ). Then f ( g ( x1 ))  f ( g ( x2 )).
Since f g is one-to-one, x1  x2 . Therefore, g is one-to-one.
12) Let g = {(1,a),(2,c),(3,c)} be a function from X = {1,2,3} to Y = {a,b,c,d}. Let
S = {1}, T = {1,3}, U = {a}, and V = {a, c}. Find g(S), g(T), g-1(U), and g-1(V).
Answer:
g ( s)  {a}, g (T )  {a, c}, g 1 (U )  {1}, g is not one-to-one, so
g has no inverse.
Page 4 of 4