1. Trang chủ
  2. » Luận Văn - Báo Cáo

Giáo trình bài tập dsp midterm hki 2010 2011

133 260 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 133
Dung lượng 882,92 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Huynh Tuong Nguyen, Vinh Tan Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of RelationsPower of Relations Definition Let R be a

Trang 1

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Chapter 5

Relations

Discrete Structures for Computing on 22 March 2012

Huynh Tuong Nguyen, Tran Huong Lan, Tran Vinh Tan

Faculty of Computer Science and Engineering

University of Technology - VNUHCM

Trang 2

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 3

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of RelationsIntroduction

Function?

Trang 4

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of RelationsIntroduction

Function?

Trang 5

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relation

Definition

Let A and B be sets Abinary relation(quan hệ hai ngôi ) from a

set A to a set B is a set

R ⊆ A × B

• Notations:

(a, b) ∈ R ←→ aRb

• n-ary relations?

Trang 6

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relation

Definition

Let A and B be sets Abinary relation(quan hệ hai ngôi ) from a

set A to a set B is a set

R ⊆ A × B

• Notations:

(a, b) ∈ R ←→ aRb

• n-ary relations?

Trang 7

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relation

Definition

Let A and B be sets Abinary relation(quan hệ hai ngôi ) from a

set A to a set B is a set

R ⊆ A × B

• Notations:

(a, b) ∈ R ←→ aRb

• n-ary relations?

Trang 8

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relation

Definition

Let A and B be sets Abinary relation(quan hệ hai ngôi ) from a

set A to a set B is a set

R ⊆ A × B

• Notations:

(a, b) ∈ R ←→ aRb

• n-ary relations?

Trang 9

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Example

Example

Let A = {a, b, c} be the set of students, B = {l, c, s, g} be the set

of the available optional courses We can have relation R that

consists of pairs (a, b), where a is a student enrolled in course b

R = {(a, l), (a, s), (a, g), (b, c),

Trang 10

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Example

Example

Let A = {a, b, c} be the set of students, B = {l, c, s, g} be the set

of the available optional courses We can have relation R that

consists of pairs (a, b), where a is a student enrolled in course b

R = {(a, l), (a, s), (a, g), (b, c),

Trang 11

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Example

Example

Let A = {a, b, c} be the set of students, B = {l, c, s, g} be the set

of the available optional courses We can have relation R that

consists of pairs (a, b), where a is a student enrolled in course b

R = {(a, l), (a, s), (a, g), (b, c),

Trang 12

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 13

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 14

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 15

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 16

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 17

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 18

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 19

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 20

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 21

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relations on a Set

Definition

Arelation on the set A is a relation from A to A

Example

Let A be the set {1, 2, 3, 4} Which ordered pairs are in the

relation R = {(a, b) | a divides b} (a là ước số của b)?

Trang 22

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relations on a Set

Definition

Arelation on the set A is a relation from A to A

Example

Let A be the set {1, 2, 3, 4} Which ordered pairs are in the

relation R = {(a, b) | a divides b} (a là ước số của b)?

Trang 23

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

———————————————————–

Trang 24

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of RelationsRelations can have special properties

Reflexive xRx, ∀x ∈ A(phản xạ)

Symmetric xRy →yRx, ∀x, y ∈ A(đối xứng )

Antisymmetric (xRy∧yRx) →x=y, ∀x, y ∈ A(phản đối xứng )

Transitive (xRy∧yRz) →xRz, ∀x, y, z ∈ A(bắc cầu)

Trang 25

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relations can have special properties

Reflexive xRx, ∀x ∈ A

(phản xạ)

Symmetric xRy →yRx, ∀x, y ∈ A(đối xứng )

Antisymmetric (xRy∧yRx) →x=y, ∀x, y ∈ A(phản đối xứng )

Transitive (xRy∧yRz) →xRz, ∀x, y, z ∈ A(bắc cầu)

Trang 26

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relations can have special properties

Transitive (xRy∧yRz) →xRz, ∀x, y, z ∈ A(bắc cầu)

Trang 27

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relations can have special properties

Trang 28

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Relations can have special properties

Trang 29

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 30

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 31

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 32

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 33

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 34

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 35

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 36

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 37

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 38

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 39

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 40

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

———————————————————–

Trang 41

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Combining Relations

Because relations from A to B are subsetsof A × B, two

relations from A to B can be combined in any way two sets can

Trang 42

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Combining Relations

Because relations from A to B are subsetsof A × B, two

relations from A to B can be combined in any way two sets can

Trang 43

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Combining Relations

Because relations from A to B are subsetsof A × B, two

relations from A to B can be combined in any way two sets can

Trang 44

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Combining Relations

Because relations from A to B are subsetsof A × B, two

relations from A to B can be combined in any way two sets can

Let A and B be the set of all students and the set of all courses at

school, respectively SupposeR1= {(a, b) | a has taken the course

b}andR2= {(a, b) | a requires course b to graduate} What are

the relations R1∪ R2, R1∩ R2, R1− R2, R2− R1?

Trang 45

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of RelationsComposition of Relations

Trang 46

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 47

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 48

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 49

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 50

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of RelationsPower of Relations

Definition

Let R be a relation on the set A Thepowers(lũy thừa)

Rn, n = 1, 2, 3, are defined recursively by

Trang 51

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Power of Relations

Definition

Let R be a relation on the set A Thepowers(lũy thừa)

Rn, n = 1, 2, 3, are defined recursively by

Trang 52

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Power of Relations

Definition

Let R be a relation on the set A Thepowers(lũy thừa)

Rn, n = 1, 2, 3, are defined recursively by

Trang 53

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Power of Relations

Definition

Let R be a relation on the set A Thepowers(lũy thừa)

Rn, n = 1, 2, 3, are defined recursively by

Trang 54

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Power of Relations

Definition

Let R be a relation on the set A Thepowers(lũy thừa)

Rn, n = 1, 2, 3, are defined recursively by

Trang 55

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Power of Relations

Definition

Let R be a relation on the set A Thepowers(lũy thừa)

Rn, n = 1, 2, 3, are defined recursively by

Trang 56

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Power of Relations

Definition

Let R be a relation on the set A Thepowers(lũy thừa)

Rn, n = 1, 2, 3, are defined recursively by

Trang 57

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Trang 58

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Representing Relations Using Matrices

Definition

Suppose R is a relation from A = {a1, a2, , am} to

B = {b1, b2, , bn}, R can be represented by thematrix

R is relation from A = {1, 2, 3} to B = {1, 2} Let

R = {(2, 1), (3, 1), (3, 2)}, the matrix for R is

Trang 59

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Representing Relations Using Matrices

Definition

Suppose R is a relation from A = {a1, a2, , am} to

B = {b1, b2, , bn}, R can be represented by thematrix

R is relation from A = {1, 2, 3} to B = {1, 2} Let

R = {(2, 1), (3, 1), (3, 2)}, the matrix for R is

Trang 60

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Representing Relations Using Matrices

Definition

Suppose R is a relation on A = {a1, a2, , am}, R can be

represented by thematrix MR= [mij], where

Trang 61

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Representing Relations Using Matrices

Definition

Suppose R is a relation on A = {a1, a2, , am}, R can be

represented by thematrix MR= [mij], where

Trang 62

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Representing Relations Using Matrices

Definition

Suppose R is a relation on A = {a1, a2, , am}, R can be

represented by thematrix MR= [mij], where

Can we determine whether the relation has certain properties

(reflexive, symmetric, antisymmetric, ) by investigating its

Trang 63

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Representing Relations Using Matrices

Examples

Determine if the relations represented by the following matrices

have special properties?

Trang 64

Huynh Tuong Nguyen, Vinh Tan

Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations

Representing Relations Using Digraphs

Definition

Suppose R is a relation in A = {a1, a2, , am}, R can be

represented by thedigraph(đồ thị có hướng ) G = (V, E), where

V = A(ai, aj) ∈ E if (ai, aj) ∈ R

Ngày đăng: 08/12/2016, 20:46

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN