Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

16
Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007

Transcript of Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

Page 1: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

Functions Defined on General Sets

Lecture 35

Section 7.1

Fri, Mar 30, 2007

Page 2: 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.

Page 3: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

Examples: Relations

Let A = B = R and let x, y R. Define R on A B to mean that y = x2.

Describe the elements of R. Define R on A B to mean that y < x2.

Describe the elements of R.

Page 4: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

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.

Page 5: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

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.

Page 6: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

Examples: Functions

f : R R by f(x) = x2. g : R R R by g(x, y) = 1 – x – y. h : R R R R by h(x, y) = (-x, -y). For any set A, k : (A) (A) (A) by

k(X, Y) = X Y. For any sets A and B, m : (A) (B) by

m(X) = X B.

Page 7: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

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}.

Page 8: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

Inverse Images

In the previous examples, findf -1(4).g-1(0).m-1({a}), where A = {a, b, c}, B = {a, b}.

Page 9: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

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.

Page 10: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

Equality of Functions

Are f(x) = |x| and g(x) = x2 equal? Are f(x) = 1 and g(x) = sec2 x – tan2 x

equal? Are f(x) = log x2 and g(x) = 2 log x equal?

Page 11: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

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} 1111A = {a, b} 1100 = {} 0000

Describe this as a function.

Page 12: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

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.

Page 13: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

Well Defined

Why are the following “functions” not well defined?f : Q Z, f(a/b) = a.g : Z Z Q, g(a, b) = a/b.h : Q Z Z, h(a/b) = (a, b).k : Q Q, k(a/b) = b/a.

Can they be “repaired?”

Page 14: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

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 1

1 0 0

0 1 0

0 0 0

Page 15: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

The Number of Boolean Functions

How many Boolean functions are there in 2 variables?What are they?

How many Boolean functions are there in 3 variables?

How many Boolean functions are there in n variables?

Page 16: Functions Defined on General Sets Lecture 35 Section 7.1 Fri, Mar 30, 2007.

Boolean Functions

What Boolean function is defined byf(x, y) = xy?

What Boolean function is defined byf(x, y) = x + y – xy?

What Boolean function is defined byf(x) = 1 – x?

What Boolean function is defined byf(x, y, z) = 1 – xy – z + xyz?