Functions Defined on General Sets Lecture 35 Section
















- Slides: 16
Functions Defined on General Sets Lecture 35 Section 7. 1 Fri, Mar 30, 2007
Relations A relation R from a set A to a set B is a subset of A B. ¢ If x A and y B, then x has the relation R to y if (x, y) R. ¢
Examples: Relations Let A = B = R and let x, y R. ¢ Define R on A B to mean that y = x 2. ¢ l ¢ Describe the elements of R. Define R on A B to mean that y < x 2. l Describe the elements of R.
Functions Let A and B be sets. ¢ A function from A to B is a relation from A to B with the property that for every x A, there exists exactly one y B such that (x, y) f. ¢ Write f : A B and f(x) = y. ¢ A is the domain of f. ¢ B is the co-domain (or range) of f. ¢
Functions Note that functions and algebraic expressions are two different things. ¢ For example, do not confuse the algebraic expression (x + 1)2 with the function f : R R defined by f(x) = (x + 1)2. ¢
Examples: Functions f : R R by f(x) = x 2. ¢ g : R R R by g(x, y) = 1 – x – y. ¢ h : R R by h(x, y) = (-x, -y). ¢ For any set A, k : (A) by k(X, Y) = X Y. ¢ For any sets A and B, m : (A) (B) by m(X) = X B. ¢
Inverse Images If f(x) = y, we say that y is the image of x and that x is an inverse image of y. ¢ The inverse image of y is the set f -1(y) = {x X | f(x) = y}. ¢
Inverse Images ¢ In the previous examples, find f -1(4). l g-1(0). l m-1({a}), where A = {a, b, c}, B = {a, b}. l
Equality of Functions Let f : X Y and g : X Y be two functions. ¢ Then f = g if f(x) = g(x) for all x X. ¢
Equality of Functions Are f(x) = |x| and g(x) = x 2 equal? ¢ Are f(x) = 1 and g(x) = sec 2 x – tan 2 x equal? ¢ Are f(x) = log x 2 and g(x) = 2 log x equal? ¢
Another Example Earlier we saw that a subset of a universal set could be represented as a binary string. ¢ For example, ¢ U = {a, b, c, d} 1111 l A = {a, b} 1100 l = {} 0000 l ¢ Describe this as a function.
Well Defined ¢ A function is well defined if for every x in the domain of the function, there is exactly one y in the codomain that is related to it.
Well Defined Why are the following “functions” not well defined? l f : Q Z, f(a/b) = a. l g : Z Z Q, g(a, b) = a/b. l h : Q Z Z, h(a/b) = (a, b). l k : Q Q, k(a/b) = b/a. ¢ Can they be “repaired? ” ¢
Boolean Functions A Boolean function is a function whose domain is {0, 1} … {0, 1} (or {0, 1}n) and codomain is {0, 1}. ¢ Example: Let p, q be Boolean variables and define f(p, q) = p q. ¢ p q f(p, q) 1 1 0 0 0 1 0 0
The Number of Boolean Functions ¢ How many Boolean functions are there in 2 variables? l What are they? How many Boolean functions are there in 3 variables? ¢ How many Boolean functions are there in n variables? ¢
Boolean Functions What Boolean function is defined by f(x, y) = xy? ¢ What Boolean function is defined by f(x, y) = x + y – xy? ¢ What Boolean function is defined by f(x) = 1 – x? ¢ What Boolean function is defined by f(x, y, z) = 1 – xy – z + xyz? ¢