Á¦ 9 Àå   ¿©·¯ °¡Áö DiscreteÇÑ ±¸Á¶µé       

       

     1.  ¿©·¯ °¡Áö ÇÔ¼ö °³³ä

     1.  ¿©·¯ °¡Áö ÇÔ¼ö °³³ä

 

 

  ÇÔ¼öÀÇ °³³ä Áß¿¡¼­ ´Ü»ç, Àü»ç, Àü´Ü»ç ÇÔ¼öÀÇ ¿¹¸¦ µé¾î º¸°í,  ±× ´ëÀÀµÇ´Â µÎ ÁýÇÕÀÇ Å©±â¸¦ ºñ±³ÇÏ¿© º¸½Ã¿À.

 

 

 

¿©·¯ °¡Áö DiscreteÇÑ ±¸Á¶µé¿¡ °üÇÑ ¿©·¯ ÀÌ·ÐÇнÀÀ» À§ÇÏ¿© ±âº»ÀûÀÎ functionÀÇ °³³äÀ» ¾Ë¾Æº¸°í computer À̷п¡¼­ ¸¹ÀÌ »ç¿ëµÇ´Â function¿¡ ´ëÇÏ¿© ÇнÀÇϵµ·Ï ÇÑ´Ù.

 

 

 

 

 

     ¿©·¯ °¡Áö ÇÔ¼ö °³³ä

 

¿©·¯ °¡Áö DiscreteÇÑ ±¸Á¶µé¿¡ °üÇÑ ¿©·¯ À̷еé ÇнÀÇϱ⠾ռ­¼­ ¸ÕÀú ±âº»ÀûÀÎ functionÀÇ °³³äÀ» ¾Ë¾Æº¸°í computer À̷п¡¼­ ¸¹ÀÌ »ç¿ëµÇ´Â function¿¡ ´ëÇÏ¿© ÇнÀÇϵµ·Ï ÇսôÙ.

±×¸®°í ´ÙÀ½ÀÇ °­ÀÇ ³»¿ëÀº B. Kolman, R.C. Bussy & S. RossÀÇ Àú¼­ÀÎ

Discrete Mathematical Structures,

Prentice Hall Inc., 1996.

ÀÇ 5ÀåÀÇ ³»¿ëÀ» Âü°íÇÏ¿© ÇнÀÇϱ⠹ٶø´Ï´Ù.

  

(1) Functions

 

¡ßLet A and B be nonempty sets. A function

f  from A to B which is denoted f : A ¡æ B  is a

relation from A to B such that for all

a¡ôDom(f ) ,f(a) contains just one element of

B .  Functions are also called mappings,

transformations or correspondences.

 

¡ßf is 'onto' if  Ran(f ) = B ,

  f is 'everywhere defined'Dom(f ) = A

  f is 'one to one'  if f(a) ¡Á f(a') for two

  distinct a' and a'

  f is an injection if   f is one to one;

  f is a surjection if   f is onto;

  f is a bijection if   f is one to one and onto.

     

¡ß  If f  is one to one, onto and everywhere defined, f  is called an one to one correspondence between A and B.

¡ßA function f : A ¡æ B  is invertible if its inverse relation  f-1 is also a function.

 

     

    Example 1.    f : Z ¡æ Z , where  Z  is the

    set of all integers.   Then

    f(x) = 2x + 1 is onto and one to one,

    f(x) = x2 is  not one to one.

     

 

 

 

Theorem 2. Let f : A ¡æ B  be any functions. Then

   (a)  f-1 º f = 1A

   (b) f º 1A = f

 

 

 

 

 

Theorem 4. Let A and B be two finite sets with the same number of elements and let f : A ¡æ B be an everywhere defined function.

  (a) If f is one to one, then f  is onto;

  (b) If f is onto, then f  is one to one.

 

 

 

(2)Functions for Computer Science

 

¡ßCharacteristic function of a set A

¡ßMod function

     when z = kn + r,

              z = r (mod n) 

¡ßFloor function

  f(g)  is the largest integer

less than or equal to

            

¡ßCeiling function

c(g)  is the smallest integer

greater than or equal to

         

¡ßf(z)=2z - base 2 exponential function

 

¡ßHashing function

- when we store and later examine a large number of data records

- attempt to assign an item to one of the lists at random

- hashing function is used to compute a list number from a key

 

 

(3) Permutation Functions

 

¡ßA bijection from a set to itself is called a permutation of A

 

    (example)  Let  A = {1, 2, 3}

  

¡ßLet  b1 , b2 , ... , br  be r district elements of the set  A = { a1 , a2 , ... , an}.

The permutation p : A ¡æ A defined by

      p (b1) = b2

      p (b2) = b3

        ...

      p (br-1) = br

      p (br) = b1

      p (bx) = x , if  x ¡ô A , x  {b1 , b2, ... , br }

is called a cyclic permutation of length  r  or simply a cycle of length   r denoted by (b1 , b2, ... , br )

 

    (example)  Let A = { 1, 2, 3, 4, 5 } Then the cycle (1, 3, 5 ) denotes the permutation

 

¡ßTwo cycles of a set A  are said to be disjoint if no element of A appears in both cycles.

 

 

Theorem 1. A permutation of a finite set that is not the identity or a cycle can be written as a product of disjoint cycles of  length ¡Ã 2.

 

 

 

    Example.

                     

P=( 7¡£8 )( 2¡£4¡£5 )( 1¡£3¡£6 )

 

 

 

¡ßA cycle of length 2 is called a

  transposition (ȣȯ)

- Every cycle can be written as a product of  transpositions.

  (b1,b2,...,br) = (b1,br)¡£(b1,br-1)¡£(b1,br-2)¡£...°¡£(b1,b3)¡£(b1,b2)


 

Corollary 1. Every permutation of a finite set with at least two elements can be written as a product of transposition.

 

 

 

     

    (Example)  P =(7,8)¡£  (2,4,5)¡£ (1,3,6)

       (1,3,6) = ( 1,6)¡£ (1,3),   

       (2,4,5)= (2,5)¡£ (2,4)

        P =(7,8)¡£ (2,5)¡£ (2,4)¡£  ( 1,6)¡£ (1,3)

 

 

¡ßA permutation of a finite set is called even if it can be written as a product of an even number of transposition and it is called odd if it can be written as a product of an odd number of transpositions.

 

    (Example)

    P=(3,5,6)¡£(1,2,4,7)

    P=(3,6)¡£ (3,5)¡£ (1,7)¡£ (1,4)¡£ (1,2)

    ¡ÅP is an odd permutation

     

 

 

 

(4) Growth of Functions

 

¡ß f is O(g) if there exist constants  c and k such that |f(n)|¡Âc . |g(n)| for all n¡Ãk

¡ß f  and g have the same order if f  is O(g) and g is O(f  )

- if f is O(g) but  g is not O(g) , is lower order than

- a relation   ¥èis defined as follows

¡ß f ¥èg  iff  f and  g have the same order (f  = ¥è(g )or g = ¥è(f ))

 

 

 

Theorem 1. The relation ¥è is an equivalence relation

 

 

 

¡ßA simple function in the equivalence class is used to represent the order of all functions in that class

¡ßRules for determining the ¥èclass  of a function

1. (1) functions are constant and have zero growth, the slowest growth posible.

2. (lg(n)) is lower than (nk ) if k > 0. This means that any logarithemic function

grows more slowly than any power function with positive exponent.

3. (na ) is lower than (nb) if and only if a<b.

4. (an ) is lower than (bn) if and only if a<b.

5. (nk) is lower than (an) for any power nk and a>1. This means that any exponential function with base greater than 1 grows more rapidly than any power function.

6. If r is not zero, than (nf ) = (f ) for any function f

7. If h is nonzero function and (f ) is lower than (or the same as) (g ). then (fh)is lower than (or the same as) (gh).

8. If  ( f) is lower than (g)than (f+g)= (g).

 

 

   

¿©·¯ °¡Áö DiscreteÇÑ ±¸Á¶µé¿¡ °üÇÑ ¿©·¯ ÀÌ·ÐÇнÀÀ» À§ÇÏ¿© ±âº»ÀûÀÎ functionÀÇ °³³äÀ» ¾Ë¾Æº¸°í computer À̷п¡¼­ ¸¹ÀÌ »ç¿ëµÇ´Â function¿¡ ´ëÇÏ¿© ÇнÀÇϵµ·Ï ÇÑ´Ù.

 

  

 

 

 

 

 

 

 

 

 

 

 

 Á¦ 9 Àå   ¿©·¯ °¡Áö DiscreteÇÑ ±¸Á¶µé       

      

      2.  Relations and Digraphs

     2.Relations and Digraphs

 

 

 equivalence relation À̶õ ¹«¾ùÀΰ¡ ¼³¸íÇÏ°í, ±× ¿¹¸¦ µé¾î º¸½Ã¿À.

 

 

 ¿©·¯ °¡Áö DiscreteÇÑ ±¸Á¶µé¿¡ °üÇÑ ¿©·¯ À̷еé Áß¿¡¼­ relation°ú digraph¿¡ °üÇÏ¿© ÇнÀÇϵµ·Ï ÇÑ´Ù.

 

 

 

    

     Relations and Digraphs

 

¿©·¯ °¡Áö DiscreteÇÑ ±¸Á¶µé¿¡ °üÇÑ ¿©·¯ À̷еé Áß¿¡¼­ ¸ÕÀú

relation°ú digraph¿¡ °üÇÏ¿© ÇнÀÇϵµ·Ï ÇսôÙ.

±×¸®°í ´ÙÀ½ÀÇ °­ÀÇ ³»¿ëÀº B. Kolman, R.C. Bussy & S. RossÀÇ Àú¼­ÀÎ

Discrete Mathematical Structures,

Prentice Hall Inc., 1996.

ÀÇ 5ÀåÀÇ ³»¿ëÀ» Âü°íÇÏ¿© ÇнÀÇϱ⠹ٶø´Ï´Ù.

 

(1) Product Sets and Partitions

 

¡ßOrdered pair (a,b) is a listing of objects a and b in a prescribed order

¡ßProduct Set (Cartesian Product):

    For two nonempty set A and B

    A x B = { (a,b) | a¡ôA ,b¡ôB }

 

     

    (Example)   Let  A = {1, 2, 3}, B = {r,s}; then

    A x B = {(1,r) , (1,s) , (2,r) , (2,s) , (3,r) ,(3,s)}

     

 

 

¡ßGeneralization of Cartesian product

A1 x A2 x , ..., x Am of the nonempty sets A1,

A2 , ..., Am  is defined as

{(a1, a2 , ..., an) | ai¡ôAi , i = 1, 2, ... ,m }

 

¡ßA Partition or quotient set of a nonempty set A is a collection P of nonempty subsets of A such that

    1. Each element of A belongs to one of the sets in P

    2. If A1 and  A2 are distinct element of  P then A1 ¡û A2 = ¨ª

    - P¡ö P(A) , that is a partition of a set A  is a subset of the power set of A

 

 

(2) Relations and Digraphs

 

¡ßA relation R from A to  B is a subset of

   A x B

 

- If R ¡öA x B  and , (a,b)¡öR , 

  a is related to b by R and we write

          a R b

 

     

    (Example) Let A = B = {1, 2, 3}.

    Define a relation R as follows

    a R b  iff   a < b

    Then R ={( 1, 2 )( 1, 3 )( 2, 3 )}

     

 

 

¡ßIf R ¡öA x A  then R is said to be a relation

   on A

¡ßLet R ¡öA x B

    - Domain of  R : the set of  elements in  A which are related to some elements in B

    - Range of R : the set of elements in B which are related to some elements in A

    -R-relative set of  x ,

      R(x) = { y¡ôB |x R y }

    - if A1 ¡ö A then R -relative set of A1 ,

    R(A1)={y¡ôB | x R y for  some x in A1}

 

     

    (Example)  A = B = {a,b,c,d}  ,

    R = {(a,b) (a,d) (b,c) (c,a)}

    Dom (R)={a,b,c}    Ran (R)={a,b,c,d}

    R(a)={b,d}             R{(b,c)} = {a,c}

     

 

¡ßThe matrix of a Relation

- If  A = {a1, a2, ..., an}    B = {b1, b2, ..., bn} and R ¡ö A x B

we can represent R by mxn matrix MR=[mij]

 

 

    (Example)  A = {a,b}  B={1,2,3}

     R={(a,1)(b,2)(b,3)}  then

     

 

 

¡ßLet  R ¡öA x A

- Digraph of   

 

¡ßLet a¡ô A then the indegree of a is the number of b¡ô A such that (b,a) ¡ôR     

the outdegree of a is the numberof b¡ô A  such that (b,a) ¡ôR  = |R(a)|

               

 

(3) Paths in Relations and Digraphs

 

¡ßLet R be a relation on a set A

A path of length n in R from a to b is a finite

sequence  ¥ð=a ,x1, x2 , ... , xn-1 , b   

such that   a R x1, x1 R x2 , ... , xn-1 R b

 

A path that begins and ends at the same vertex is called a cycle.

 

¡ßDefine Rn as follows : x Rn y  means that there is a path of length n from x to y in  R

    - R¡Ä is defined as follows :x R¡Ä y means that there is a path from x to y in  called "connectivity relation"

 

 

 

Theorem 1. Let's define the Boolean product of A and B (A¢ÁB ) to be

C=[cij] such that

        cij = 1    if  aik =1 and bkj = 1 for some k

              0   otherwise   

  Then    ( MR¢ÁMR = (MR)O2

 

 

 

 

 

Theorem2.

   

 

 

Proof :  By the induction, we can prove

Theorem 2.

 

 

¡ß

¡ßReachability relation R* of  R is defined as follows :

    x R*y means that x = y or x R¡Äy

    where In is the  n x n Identity matrix

 

 

(4) Properties of Relations

 

¡ßReflexive and irreflexive relations

- A relation R on a set A is reflexive if (a,a) ¡ô R  for all a ¡ô A

- A relation R on a set A is irreflexive if (a,a)  R  for all a ¡ô A

 

    (Example) A = {1,2,3,4}   

    a R b   iff   a¡Âb ¡æ reflexive

    a R b   iff    a<b  ¡æ irreflexive

 

         

¡ßSymmetric, asymmetric and antisymmetric relations

    - A relation R on a set A is symmetric

    if whenever a R b   then  b R a  

    - A relation on a set is asymmetric

    if whenever a R b then ~b R a  

    - relation R on a set A is antisymmetric if whenever a R b  and b R a   then  a = b

     

 

 

  (Example)  A = {1,2,3,4}

    R = {(1,2)(2,2)(3,4)(4,1)}

  R is not symmetric, not asymmetric

  since (2,2)¡ôR, but antisymmetric

 

 

 

¡ßProperties of matrix

    - The matrix MR = [mij] of a symmetric relation satisfies the property that

    if mij =1 then mji =1

    Therefore so that MR is a symmetric matrix

    - The matrix MR = [mij]  of an asymmetric relation R satisfies the property that if  mij =1  then mij =0

    - The matrix MR = [mij] of an antisymmetric relation R satisfies the property that if  i ¡Á j then mij =0 or mji =0

¡ß  In the digraph of a symmetric relation R , if two vertices are connected by an edge they must always be connected in both direction.

  If we replace these two edges with one undirected edge the resulting diagram is called graph of the symmetric relation.

 

¡ßsymmetric relation R on a set A will be called connected if there is a path from any element of A to any other element of A

¡ßTransitive relations

-A relation R on a set A is transitive if whenever aRb and  bRc  then aRc

 

 

   (Example) A=Z  

   aRb  iff a<b  then R is transitive

 

 

 

 

 

Theorem 1. A relation R is transitive iff it satisfies the following property :

If there is a path of length greater than 1 from a to b, then there is a path of length 1 from a to b.

 

 

 

(5) Equivalence Relations

 

¡ßA Relation R on a set A is called equivalence relation if it is reflexive. symmetric and transitive

Exampe.  Let A = and

          { (a,b) ¡ô A x B |2 divides a-b }

We write aRb as a¡Õb (mod 2) read "a is congruent to b mod 2"

Show that R is an equivalence relation

Proof. First a¡Õa  (mod 2) since 2 divide a-a = 0 second if a¡Õb (mod 2) then b-a = 2(-k) hence a¡Õb (mod 2) . Finally, suppose that a¡Õb (mod 2) and b¡Õc (mod 2)  then a-b = 2k1, and b-c = 2k2 adding the two equations yields a-c = 2( k1 + k2 ) Hence (mod 2)

 

 

 

Theorem 1. Let P be a partition of a set A ,

and aRb iff a and b are members of the same

block. Then R is an equivalence relation on

A¡æR is called the equivalence relation

determined by P

 

 

 

 

 

Lemma 1. Let R be an equivalence relation on

A and let a¡ôA, b¡ôA then

     aRb  iff  R(a) = R(b)

 

Proof. (i) Suppose R(a) = R(b), since R is reflexive b¡ôR(b),

therefore b¡ôR(a), so aRb

(ii) Suppose aRb , b¡ôR(a) and since R is symmetric a¡ôR(b), let x¡ôR(b) then since R is transitive and b¡ôR(a), x¡ôR(a) ¡æR(b)¡öR(a)

let x¡ôR(a) , in the similar way x¡ôR(b)¡æR(a)¡öR(b).  Therefore we have

R(a) = R(b).

 

 

Theorem 2. Let  R be an equivalence relation

on A and let P be the collection of all distinct

relative sets R(a) ,a¡ôA then P is a partition

of A and R is the equivalence relation

determined by P.

 

 

Proof. We must show the following Properties.

    (a) Every element of A belong to some relative set.

    (b) It R(a) and R(b) are not identical then R(a) ¡û R(b) = 0

    (a) is true since R(a) = 0 by reflexivity of  R

    (b) is equivalent to "If R(a) ¡û R(b) ¡Á0 then R(a) = R(b)."

      Assume that c¡ô R(a) ¡û R(b) then aRc and bRc, since R is symmetric cRb.

      By the transitivity aRb

      Then R(a) = R(b) by Lemma 1.

 

 

(6) Computer representation of Relations and Digraphs

 

Refer the pp. 136-145 of the book :

 

B. Kolman, R.C. Bussy & S. Ross,

Discrete Mathematical Structures,

Prentice Hall Inc., 1996.

 

 

(7) Manipulation of Relations

 

¡ßLet R and S be relations from A to B then R, S ¡öA x B

    - complement of is defined by if and only if a R b'

    - R¡ûS : Intersection of R and S

    - R¡úS : Union of R and S

    - inverse of R , R-1 is defined by b R-1a if and only if a R b

    Dom(R-1) = Ran(R) , Ran(R-1) = Dom(R)

    -MR¡ûS = MR¡ü MS

    -MR¡úS = MR ¡ýMS

    -MR-1 = (MR )T

    -

     

¡ßClosures

- The closure of  R with respect to a Property : the smallest relation R1 that contains R and possesses the Property

 

¡ßComposition

- Let R ¡öA x B, S ¡öB x C

composition of R  and S is defined as follows.

a(R°° S)b  if a R b and b R c for some b¡ôB

- Let R and S be relations on A

then  MR°° S= MR¢ÁMS

 

 

 

 Theorem 1.   Let  R¡öA x B, S ¡öB x C,

 T ¡öC x D.  Then

   T°°( S°° R ) = (T°° S)°°  R

 

 

Proof. MT°°( S°° R ) =MS°° R¢ÁMT =(MR¢Á MS)¢ÁMT

M(T°° S°)°° R =MR¢ÁMT °S¢ÁMT =MR¢Á( MS¢ÁMT)

 

 

(8) Transitive Closure and      Warshall's Algorithm

 

 

 

Theorem 1. Let R be a relation on A

then R¡Ä is the transitive closure of R.

 

 

Proof.R¡Ä is transitive since if a R¡Ä b and b R¡Ä c then a R¡Ä c

We must show that R¡Ä is the smallest transitive relation containing R

Let S be any transitive relation on A and R¡öS 

Since S is transitive,

Since R¡öS , R¡Ä¡öS¡Ä , Therefore R¡Ä¡öS¡Ä ¡öS

 

 

 

Theorem 2. Let  A be a set with |A| = n  and

let R be a relation on A.  Then

   R¡Ä= R ¡úR2 ¡ú... ¡úR*.

 

 

Proof. The length of the shortest path from i to j cannot be more than n-1.

 

¡ßWarshall's Algorithm

- an efficient method for finding the transitive closure of a relation R on a set A

- let  R be a relation on a set A = {a1 , a2 , ... , an}

- let x1 , x2 , ... , xm be a path in R then

 x2 ,x3 ,...,xm-1 are interior vertices of the  path.

- we define a Boolean matrix Wk as follows ; Wk[ij] = 1 iff there is a path from ai to aj in R whose interior vertices come from the set {a1 , a2 , ... , an}

then

- suppose that Wk [tij] and Wk-1 [sij]

tij = 1  iff    (1) sij = 1  or  

                 (2)sik = 1 and skj = 1

 

 

 

 

The Algorithm of Warshall

        1. closure ¡ç Mat

    2. For K= 1 to N

    3. For I = 1 to N

    For J = 1 to  N

    closure[I,J ] = closure[I,J]¡ý ( closure[I,K]¡ü closure[K,J] )

    end of algorithm Warshall.

 

 

 

 

 

 ¿©·¯ °¡Áö DiscreteÇÑ ±¸Á¶µé¿¡ °üÇÑ ¿©·¯ À̷еé Áß¿¡¼­ relation°ú digraph¿¡ °üÇÏ¿© ÇнÀÇϵµ·Ï ÇÑ´Ù.