Вы находитесь на странице: 1из 13

FUNCTION, RECURSION AND FUZZY SET

A function f from a set X to a set Y, denoted f : X Y , is a relation from


X, the domain, to Y , the codomain, that satisfies two properties: (1) every
element in X is related to some element in Y , and (2) no element in X is
related to more than one element in Y .
The set of all values of f taken together is called the range of f or the image
of X under f.
Ex1:
A={1,2,3}, B={2,3,4,6,7}, f:AB sbb f(x) = 2x
Find the domain, codomain, and range=image(f). Draw the arrowdiagram.
1,2,3 each is called the preimage and 2,4,6 each is called the image.
How many functions are available from A to B?
How many functions are available from B to A?
Ex2:
Which one is a function?

Ex3:
Which one is a function? State the domain and range.

-4

-2

-2
-4

-4

-2

-2
-4

-2

-4

-2

4
2
4

-4

-2

-4

-2

-2
-4

-2

-4

-4

-2

-2

y
4

-4

-4

-2

-2

-4

2
-2

-2

-2

-4

-4

-4

-4

-2

-2

-2

-2

-4

-2

-4

-4

-2

-2
-4

Onetoone (injective) Function


Let F be a function from a set X to a set Y. F is onetoone (or injective) if,
and only if, for all elements x1 and x2 in X, if F(x1) = F(x2), then x1 = x2, or,
equivalently, if x1 x2, then F(x1) F(x2).
Symbolically, F: X Y is onetoone x1, x2 X, if F(x1) = F(x2) then x1 =
x2 .
Ex4:

F is onetoone but G is not.


Ex5: Which one is onetoone function?

Onto (Surjective) Function


Let F be a function from a set X to a set Y. F is onto (or surjective) if, and only
if, given any element y in Y, it is possible to find an element x in X with the
property that F(x) = y. Symbolically:
F: xY is onto yY, xX such
that F(x) = y
Ex6:
Which one is onto function?

Onetoone Correspondence
A onetoone correspondence (bijectivefunction) from a set X to a set Y is a
function F: X Y that is both onetoone and onto. So: bijective = injective +
surjective.
Ex7:

f
A

Ex8:
Which one is injective, surjective, bijective?

Ex9:
Which one is an injective, a surjective, or a bijective function?
y

-4

-2

-2
-4

-4

-2

-2
-4

-2

-4

-2

-4

-2

-4

-2

-2
-4

-2

-4

-4

-2

-2

y
4

-4

-4

-2

-2

-4

C
4

-2

-2

2
x

-2

-4

-4

-4

-4

-2

-2

-2

-2

-4

-2

-4

-4

-2

-2
-4

A onetoone (11) function (injective function) occurs if each


horizontal line cuts the function at most at one point.
An ontofunction (surjective function) occurs if range = codomain, or
each horizontal line cuts the function at least at one point.
A bijectivefunction (or onetoone correspondence) occurs if each
horizontal line cuts the function at exactly one point.

Ex10:
a. If A={1,2,3} and B={a,b,c}, how many onetoone correspondence are
there from A to B?
b. If n(A)=m and n(B) = m, how many onetoone correspondence are there
from A to B?

c. If A={x: x is a natural number}, B={x: x is an even positive integer} and


f: A B is given by f(x) = 2x. Is f a onetoone correspondence?
Inverse of a Function
F(x)=2x+1. G(x)=

x 1
. Find F(2) and G(5). What is your conclusion?
2

Steps for finding inverse function:


1. Write y=f(x)
2. Interchange x with y vice versa.
3. Write y as the function of x; this is the f1(x).
Ex11: Find the inverse function of:
1.

2.
3.
4.
5.
6.
7.
8.
9.

y 2x 3
y x2

y ( x 2) 3
y 2x
y 3 log x
y ex
y ln x
2x 3
y
5 x
y sin x

10. y x 2 4 x 3

Inverse of a function might not be a function. Inverse of a function


is again a function if and only if the function is a onetoone
correspondence.
Ex12: Which one of the functions in example11 has an inverse which is
also a function?
Composition of Functions
f:AB, g:BC, h:CD
f(x)=3x4, g(x)=2x, h(x)=9x
Is gof = fog ? (commutative?)
Is (hog)of (x) = ho(gof) (x) ? (associative?)
Property: (fog)1 = g1 of1.
Odd and Even Functions
Function y = f(x) is odd if f(x) = f(x). Function y = f(x) is even if f(x) = f(x).
Odd function: symmetric about (0, 0). Even function: symmetric about y axis.
Ex: Which one is odd and which one is even?

a. f(x) = x2, b. f(x) = x3,


tan x,
f. f(x) = x3.cos 2x.

c. f(x) = sin x,

d. f(x) = cos x,

e. f(x) =

Piecewise (Piecemeal) Function


Ex: Draw the piecewise (piecemeal) function:

f ( x)

x2 , x 1

2 x, x 1
x 1, for x 1

g ( x ) 1, for 1 x 1
x 1, for x 1

Absolute Function
Ex: Draw: y x
Ex: Draw: y 2 x 3
Ex: Draw: y 5 4 2 x
Ex: Draw: y

x
x

Floor and Ceiling Functions


Ex: Draw floor function y x , 2 x 2.
Ex: Draw ceiling function y x , 2 x 2.
Recursively Defined Sequences
Fibonacci sequence: 1, 1, 2, 3, 5, 8, 13, ..
How to get the general term of Fibonacci sequence using recursive notation?
Factorial: 0! =1, 1! = 1, 2! = 2, 3! = 6, 4! = 24, ..
How to get the general term of factorial function?
Ex: a1 = 4, an = an1 + 5
Ex: a1 = 2, a2 = 3, an = an1 + 2an2
Fuzzy Set
Fuzzy Set Theory was formalized by Professor Lofti Zadeh at the University of
California in 1965.
Ordinary Set = Crisp Set
A= {1, 2, 3},
2 A,
4 A
P= {Ali, Badu, Charli}, Ali P, Dadi P
Fuzzy Set
A = 0.9/Ali + 0.8/Badu + 0.6/Charli
Ali, Badu, Charli A, but Dadi A
Membership Function of a Fuzzy Set

X = universal set
A = fuzzy set
A = membership function
0 < A 1, so A : X [0, 1]
1
If A ( x) 2
find (0), (10), (100)
x 1
Discrete Fuzzy Set
A = 1 /x1+2/x2+..+n/xn

x1 ,x2 , .. xn : members of the set A


1, 2,..n : degree of membership
Ex:
Universal set X={5,4,3,2,1,0,1,2,3,4,5} with degree of membership are
0, 0.1, 0.3, 0.5, 0.7, 1, 0.7, 0.5, 0.3, 0.1, 0. Write the set notation of set
A={real number close to zero} !
Continuous Fuzzy Set

Support of a Fuzzy Set


Support A = supp A = set of members of universal set whose degrees
are positive.
Ex: X={1,2,6,13,17,21,35,50}= set of people with various ages.
Ages\
Categori
es

Baby

0.8

0.8

Child Teenager

Adults

Young

Old

0.8

0.1

13

0.2

0.9

17

0.5

0.8

21

35

0.2

0.2

50

Find supp{baby}, supp{child}, supp{teenager}, supp{adult},


supp{young}, supp{old}
cut of a Fuzzy Set
A = members of universal set whose degrees are greater than or equal to .

Ex:

Fuzzy set of teenagers, find teenagers 0.5, teenagers 0.7, teenagers 1.


Find young0.2, young0.8, young1
Scalar Cardinality: A =the sum of degree of membership of X in A.
Ex: Find baby , child , teenager , adult , young , old
Operations in Fuzzy Set
1. Set inclusion
A=B if and only if deg(A)=deg(B)
AB if and only if deg(A)deg(B)
Ex:
A = 0.1/1 + 0.3/2 + 0.5/3
B = 0.2/1 + 0.3/2 + 0.5/3
Is A = B? Is AB?
2.
Complement =A=Ac
A=set of members with degree = 1deg(A)
Ex: X={1,2,6,13,17,21,35,50}. Old=0.2/35 + 1/50. Find the set of not
old.
Young=1/1+1/2+1/6+1/13+1/17+1/21+0.2/35. Find the set of not
young.
Is not old means young? Is not young means old?
3. Union AB: find the maximum degree of A or B.
Ex:
A = 0.1/1 + 0.3/2 + 0.4/3 + 0.2/4
B = 0.2/1 + 0.5/2 + 0.3/3 + 0.1/5
Find AB
Ages\
Categori
es

Baby

0.8

0.8

Child Teenager

Adults

Young

Old

0.8

0.1

13

0.2

0.9

17

0.5

0.8

21

35

0.2

0.2

50

Find: young old


4. Intersection AB: find the minimum degree of A and B.
Ex:
A = 0.1/1 + 0.3/2 + 0.4/3 + 0.2/4

B = 0.2/1 + 0.5/2 + 0.3/3 + 0.1/5


Find AB
Find young old.
Ex:

X={1,2,3,4,5,6,7}
A=0.6/3+0.6/5+0.2/6
B=0.7/3+1/4+0.7/6
Find AB, AB, A, B, AB. AB

Continuous Fuzzy Set


Giving two fuzzy utilities expressed in the followings (x is real number)
0, x 4
0, x 3

x 4, 4 x 5
x-3

2 , 3 x 5

B ( x) 1, 5 x 6
A ( x)
8-x
10 x , 6 x 10

, 5 x 8

3
4

0, x 8
0, x 10
1. Draw their figures
2. Draw AB, AB, Ac, Bc, AcBc, AcBc and support of them.
Ans:
Supp (A) = 3 < x < 8, Supp (B) = 4 < x < 10
Supp (AB) = 4 < x < 8, Supp (AB) = 3 < x < 10
Supp (Ac) = x 5, Supp (Bc) = x < 5, x > 6
Supp (AcBc) = x 5, Supp (AcBc) = x < 5, x > 6
Exercise:
1. Let Fuzzy set Z= 0.2/A + 0.4/B + 0.6/C +0.7/D. U = {A, B, C, D, E, F}.
Determine
a. Zc = Z
b. | Zc|= | Z|
c. support of Z
d. Z0.5
2. Let fuzzy set A and B given by (x is real number)

x6
1
, for 2 x 10
A( x)
4
0,
for x 2 or x 10

x 8

B ( x) 1 4 , for 4 x 12
0,
for x 4 or x 12

a. Draw fuzzy set A and B


b. Determine fuzzy set Ac and Bc ?
c. Determine and draw support of AUB, AB, AcUBc, AcBc

3. a1 = 2, a2 = 1, an = an1 + 2an2
Find the first 5 terms.
4. Examine the following: 2,5,7,12,19,31,..
Determine the recursive formula for an+2.
5. Draw the piecemeal function:
2 x 1, x 2

f ( x) 1, 3 x 2
2 x 1, x 3

6. If u n (1) n 1 3u n 1 2 and u1 = 2, find the first 5 terms.


7. X = {1,2,3,4.5,6,7}
A=1/1 + 0.6/2 + 0.2/3 + 0.6/5 + 1/6
B=0.2/1 + 0.4/2 + 0.8/3 + 1/4 + 0.8/5+ 0.4/6 + 0.2/7
Find AB, AB, Ac, Bc, AcBc,AcBc
Exercise:
1. U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
A = {2, 4, 6, 8, 10}
B = {1, 3, 6, 7, 8}
C = {3, 7}
(a) Illustrate the sets U, A, B and C in a Venn diagram, marking all the elements in the
appropriate places. (Note: if any region in your diagram does not contain any elements, redraw
the set loops to correct this.)
(b) Using your Venn diagram, list the elements in each of the following sets:
B A, B C, A B
(c) Complete the statement using a single symbol: C B = ... .
2. What can you say about two sets P and Q if:
(a) P Q =
(b) P Q = P?
3. A survey of 100 students revealed
18 like to eat chicken,
40 like to eat beef,
20 like to eat lamb,
12 like to eat both chicken and beef,
5 like to eat both chicken and lamb,
4 like to eat both beef and lamb,
3 like to eat all three.
Classify a student who does not like to eat any of the three kinds of meat as a nonmeat
eater.
(i) How many students like to eat at least one of the kinds of meat?
(ii) How many nonmeat eaters are there?
(iii) How many students like to eat only lamb?
4.

Given f ( x) 9 x 2 ,

g ( x)

5 x

, h( x )

x2
.
2x 1

a. find domain and range of each.


b. If m(x)=2x+3, Find mog (x) and gomof (x)

c. Find h1(x)
Exercise

1. Universal set is real numbers. Define fuzzy sets A and B with


membership functions:
A ( x)

1
1
and B ( x )
.
1 x
1 2x

a. Is A B? Explain.
b. Is A B = A? Explain.
y
4
3
2
1
-3

-2

-1

-1
-2
-3

2. Given:
3 1x , x ( R {0})
f ( x)
3,
x0

Find the inverse of f(x).


3. Given f(x) = 4x3 5, x R, and g(x) = 2

1
, x R {0}.
2x

Find: fog(x) and gof(x).


4. Valid/invalid?
( p q) (r s )
pr

q s

5. Verify valid or invalid of the following using truth table:


ad

d c
d b
a
b c

6. There are 4 Indonesians and 4 Indians sitting around a round table.


a. How many ways of sitting are there?
b. What is the probability that they sit according to their nationality?
c. What is the probability that they sit alternately?
7. Find the domain and range of:
a. y x 2

b. y x 3

c. y

16 x

d.

16 x 2

e. y

2x 4
x 1

8. Find the domain and range of:


a. y 2 x

b. y 2 log x

c. y

x 1
x2

d. y

x 1
x2

9. Draw a.
b.
, for 2 x 2.
10.
Find the inverse of f(x) = x2, x0.
11.
Find the inverse of f(x) = 3(x 1)2 + 4, for x 1.
12.
Find the inverse of f(x) = 2x2+6x+12, for x 1.5.
13.
Determine odd or even or neither:
a.
y=x.sin x
b.
y=x2.tan x
c.
y=x3.cos 5x
d.
y=2x
14.
Draw: x y 1
EXERCISE
y 2x 1

1.
a.

y 2 x

Test the validity of:


p q r
q p r

pr

b. If a is an odd number and b is an even number then (a + b) is ans odd number.


2.
a.

Find the conclusion of the followings.


pq
p q
q
qr

b.

q
p
p q
pq

3.
a.
b.

Given:
f(w,x,y,z) = wxyz + wxyz + wxyz + wxyz + wxyz + wxyz + wxyz + wxyz
Draw the logic gate
Simplify

4.
a.
b.

Use direct proof:


The sum of an even number and an odd number is an odd number.
If (a2) is a multiple of 5 then (a2 4) is a multiple of 5.

5.

Use mathematical induction to prove:

a.

1
1
1
1
n

....

, for n 1
1 3 3 5 5 7
( 2n 1) ( 2n 1) 2n 1

b.
n3 + 5n is divisible by 6 for n 1
c.
42n1 is divisible by 3 for n 1
6. Prove using mathematical induction:
a.

1
1
1
1
3
1
1
2
2
....

, n is positive integer.
2
2 1 3 1 4 1
(n 1) 1 4 2(n 1) 2(n 2)

b.

1
1
1 2 3
2
2

7.
a.
b.
c.
d.

1
4
2

1
..... n
2

n 1

n2
, n is positive integer.
2 n 1

If C(x,2)= 6 , find x
How many item codes can be built from 3 letter and 4 numbers (repetition are
allowed
How many PIN numbers are there if he PIN consists of at least 4 number and at
most 6 numbers without repetition.
There are 4 men and 4 women. Four of them are given scholarship. How many
ways are there if at least 2 men must get the scholarships?

8.

2x
y
Find the 7 term and find the terms containing x of 3 3
y
4
x

9.
a.
b.
c.

Draw the Venns diagram for:


(A B) (A B C ) where A B C
(A B ) U (B C) where A C =
(Ac B ) U C where B C

th

15

10. If | S | denotes the number of members of universal set S, where S = { x | 1 x


100, x is integer}. There are 3 subsets of S, i.e. A, B, C. If | A | = (10 + k),
| B | = (7 + 2k), | C | = (8 + 2k), | A B | = (2 + k), | A C | = (3 + k),
| B C | = 2k, | A B C | = k, and |(A B C )| = 40.
Find k and find the number of elements of A, B, and C.
11.

Given S is the universal set with 3 subsets, i.e. A, B and C, where C AB ,


| A B | = k + 6, | A B | = 15, | B A | = 10 + k, | (AB) C | = 5,
| S (AB) | = 20. If | S | = 4k + 1, find k, |A| |B|, |C| dan |S|.

12. There are 3 varieties of ice cream: chocolate, vanilla and strawberry. If someone
buys three scoops of ice cream, how many choices does he have?

Вам также может понравиться