2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세

17
2014 년 년년년 년년년년년 년년년년년년년 년년년 년년년년 (Discrete Mathematics) 년년년 년 년년 (Relations and Its Properties)

Upload: channing-melendez

Post on 31-Dec-2015

25 views

Category:

Documents


5 download

DESCRIPTION

이산수학 (Discrete Mathematics) 관계와 그 특성 (Relations and Its Properties). 2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세. Binary Relations ( 이진 관계 ). Relations & Its Properties. Let A , B be any two sets. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

2014 년 봄학기강원대학교 컴퓨터과학전공 문양세

이산수학 (Discrete Mathematics) 관계와 그 특성

(Relations and Its Properties)

Page 2: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 2

Binary Relations ( 이진 관계 )

Let A, B be any two sets.

A binary relation R from A to B, written R:A↔B, is a subset

of A×B. (A 에서 B 로의 이진 관계 R 은 R:A↔B 로 표기하며 A×B 의

부분집합이다 .)

• E.g., let < : N↔N :≡ {(n,m) | n < m}

The notation a R b or aRb means (a,b)R.

• E.g., a < b means (a,b) <

If aRb, we may say “a is related to b (by relation R).” (aRb 이면 , “a 는 ( 관계 R 에 의해서 ) b 에 관계된다”고 말한다 .)

Relations & Its Properties

Page 3: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 3

Complementary Relations ( 보수 관계 )

Let R:A↔B be any binary relation.

Then, R:A↔B, the complement of R, is the binary re-

lation defined by

R :≡ {(a,b) | (a,b)R} = (A×B) − R

Note the complement of R is R.

Example: < = {(a,b) | (a,b)<} = {(a,b) | ¬(a<b)} = ≥

Relations & Its Properties

Page 4: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 4

Complementary Relation Example

예제 :A = {0, 1, 2}, B = {a, b} 라 하면 , {(0,a), (0,b), (1,a), (2,b)} 는

A 에서 B 로의 관계 R 로 표현할 수 있다 . 이 때 ,

• (0,a)R 이므로 , 0Ra 라 할 수 있다 .

• 그러나 , (1,b)R 이므로 , 1Rb 라 할 수 있다 .

Relations & Its Properties

Page 5: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 5

Inverse Relations ( 역 관계 )

Any binary relation R:A↔B has an inverse relation

R−1:B↔A, defined by

R−1 :≡ {(b,a) | (a,b)R}.

E.g., if R:People↔Foods is defined by

aRb a eats b, then:

b R−1 a b is eaten by a. (Passive voice.)

(R−1 will be “is eaten by.”)

Relations & Its Properties

Page 6: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 6

Relations on a Set

A (binary) relation from a set A to itself is called a re-

lation on the set A. ( 집합 A 에서 A 로의 관계를 집합 A 상의 관계라

한다 .)

E.g., the “<” relation from earlier was defined as a

relation on the set N of natural numbers.(“<” 은 정수 집합 N 에 대한 관계이다 .)

The identity relation IA on a set A is the set {(a,a)|

aA}.( 집합 A 에 대한 항등 관계 IA 는 집합 {(a,a)|aA} 를 의미한다 .)

Relations & Its Properties

Page 7: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 7

Examples of Relations on a Set (1/2)

예제 :A = {1, 2, 3, 4} 라 할 때 , 관계 R = {(a,b)| a divides b} 에 속하는

순서쌍은 ?

• A x A 의 원소인 (a,b) 에 있어서 b 를 a 로 나눌 수 있는 순서쌍을 구한다 .

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

이다 .

Relations & Its Properties

Page 8: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 8

Examples of Relations on a Set (2/2)

예제 :n 개의 원소를 갖는 집합에는 몇 개의 관계가 있는가 ?

• 정의에 의해 , 집합 A 에 대한 관계는 A x A 의 부분집합이다 .

• A x A 의 원소 개수는 n2 이다 .

• 또한 , m 개의 원소를 가지는 집합의 부분집합 개수는 2m 개 이다 .

• 그러므로 , A x A 의 부분집합 개수는 이 된다 .

• 결국 , n 개 원소를 갖는 집합에 대한 가능한 관계의 수는 이다 .

22n

22n

Relations & Its Properties

Page 9: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 9

Reflexivity ( 반사성 )

A relation R on A is reflexive if aA, aRa.

• E.g., the relation ≥ :≡ {(a,b) | a≥b} is reflexive.

• 즉 , (a,a) 를 원소로 가지면 반사적 (reflexive) 이라고 이야기한다 .

A relation is irreflexive iff its complementary relation

is reflexive. ( 역관계가 반사이면 , 해당 관계는 비반사이다 )

• Example: < is irreflexive.

Relations & Its Properties

Page 10: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 10

Reflexivity Example

예제 :양의 정수 집합에 대해 “나누다” 관계는 반사적인가 ?

• 임의의 양의 정수 a 에 대해 a|a 가 성립한다 .

• 즉 , 양의 정수 a 는 자기 자신 a 로 나누어 떨어진다 .

• 따라서 , “ 나누다”는 양의 정수 집합에 대해 반사적이다 .

Relations & Its Properties

Page 11: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 11

Symmetry & Antisymmetry (대칭성 )

A binary relation R on A is symmetric iff R = R−1, that

is, if (a,b)R ↔ (b,a)R.

• E.g., = (equality) is symmetric. < is not.

• “is married to” is symmetric, but “likes” is not.

• 즉 , (a,b) 가 R 의 원소일 때 , 반드시 (b,a) 도 원소이면 대칭적이라 한다 .

A binary relation R is antisymmetric if (a,b)R →

(b,a)R.

• < is antisymmetric, “likes” is also antisymmetric.

Relations & Its Properties

Page 12: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 12

Symmetry & Antisymmetry Ex-ample

예제 :양의 정수 집합에 대한 “나누다” 관계는 대칭인가 ? 반대칭인가 ?

• 반례 (counterexample) 를 들어 반대칭임을 보인다 .

• 즉 , 1|2 이지만 2|1 이므로 , 반대칭이다 .

Relations & Its Properties

Page 13: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 13

Transitivity ( 전이성 )

A relation R is transitive iff (for all a,b,c)

(a,b)R (b,c)R → (a,c)R.

A relation is intransitive if it is not transitive.

Examples: “is an ancestor of” is transitive.

“likes” is intransitive.

Relations & Its Properties

Page 14: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 14

Transitivity Example

예제 :양의 정수 집합에 대한 “나누다” 관계가 전이적인가 ?

• 양의 정수 a, b, c 에 대해서 , a 가 b 를 나누고 , b 가 c 를 나눈다고 하자 .

• 즉 , a|b, b|c 가 성립한다고 가정하자 .

• 그러면 , b = ak, c = bl 인 양의 정수 k 와 l 이 있다 .

• 따라서 , c = a(kl) 이 성립하므로 , a 는 c 를 나눌 수 있다 .

• 즉 , a|c 가 성립하므로 , “ 나누다”는 전이적이다 .

Relations & Its Properties

Page 15: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 15

Composite Relations ( 관계 합성 / 결합 )

Let R:A↔B, and S:B↔C. Then the composite SR of R

and S is defined as:

SR = {(a,c) | b: aRb bSc}((a,b)R 이고 (b,c)S 이면 , SR 은 (a,c) 을 원소로 하는 관계이다 .)

Note function composition fg is an example.

The nth power Rn of a relation R on a set A (A 에 대한

관계 R 의 n 제곱 ) can be defined recursively by:

R0 :≡ IA ; Rn+1 :≡ RnR for all n≥0.

Relations & Its Properties

Page 16: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 16

Examples of Composite Relations (1/2)

예제 :{1, 2, 3} 에서 {1, 2, 3, 4} 로의 관계 R = {(1,1), (1,4), (2,3),

(3,1), (3,4)} 과 , {1, 2, 3, 4} 에서 {0, 1, 2} 로의 관계 S = {(1,0),

(2,0), (3,1), (3,2), (4,1)} 가 있을 때 , R 과 S 의 합성 SR 은 ?

• SR 의 구성을 위해서는 , R 에 속한 순서쌍의 두 번째 원소와 S 에 속한 순서쌍의 첫 번째 원소가 같은 것을 찾으면 된다 .

• 예를 들어 , R 의 (2,3) 과 S 의 (3,1) 을 바탕으로 SR 의 순서쌍 (2,1) 을 만든다 .

• 결국 , SR = {(1,0), (1,1), (2,1), (2,2), (3,0), (3,1)} 이 된다 .

Relations & Its Properties

Page 17: 2014 년  봄학기 강원대학교  컴퓨터과학전공  문양세

Discrete Mathemat-icsby Yang-Sae Moon

Page 17

Examples of Composite Relations (2/2)

예제 :R = {(1,1), (2,1), (3,2), (4,3)} 이라 하자 . n = 2, 3, 4, … 일 때 ,

거듭 제곱 Rn 을 구하라 .

• R2 = RR = {(1,1), (2,1), (3,1), (4,2)}

• R3 = R2R = {(1,1), (2,1), (3,1), (4,1)}

• R4 = R3R = {(1,1), (2,1), (3,1), (4,1)}

• …

• Rn = Rn-1R = {(1,1), (2,1), (3,1), (4,1)}

You can get Rn using “induction.”

Relations & Its Properties