1. Trang chủ
  2. » Tất cả

06 quan hệ

118 3 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

Tiêu đề Relations
Tác giả Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang
Trường học University of Technology - VNUHCM
Chuyên ngành Computer Science and Engineering
Thể loại lecture notes
Năm xuất bản 2017
Thành phố Ho Chi Minh City
Định dạng
Số trang 118
Dung lượng 0,95 MB

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

Nội dung

Relations Relations Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Contents Properties of Relations Combining Relations Representing Relations Closures of Relations Types of Relations 5 1 Chapter 5 Re[.]

Trang 1

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Chapter 5

Relations

Discrete Structures for Computing on September 20, 2017

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

Faculty of Computer Science and Engineering

Trang 2

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 3

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Course outcomes

Course learning outcomes

L.O.1.1 – Describe definition of propositional and predicate logic

L.O.1.2 – Define basic discrete structures: set, mapping, graphs

L.O.2.1 – Logically describe some problems arising in Computing

L.O.2.2 – Use proving methods: direct, contrapositive, induction

L.O.3.1 – Define basic probability theory

L.O.3.2 – Explain discrete random variables

L.O.4.1 – Operate (compute/ optimize) on discrete structures

L.O.4.2 – Compute probabilities of various events, conditional

ones, Bayes theorem

Trang 4

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Function?

Trang 5

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Function?

Trang 6

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 10

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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, d} 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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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, d} 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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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, d} 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 13

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 14

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 15

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 16

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 17

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 18

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 19

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 20

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 21

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 22

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 24

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Properties of Relations

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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

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

Trang 27

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 28

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 29

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 30

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 31

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 32

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 33

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 34

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 35

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 36

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 37

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 38

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 39

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 40

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 41

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

DefinitionLet R berelationsfrom A to B and S be from B to C Then thecomposite (hợp thành) of S and R is

Trang 42

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 43

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 44

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 45

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Trang 46

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

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

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

Trang 47

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 48

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 49

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 50

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 51

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 54

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 55

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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 56

Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang

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

Example

Given a relation on A = {1, 2, 3, 4},

R = {(1, 1), (1, 3), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (4, 1)}Draw corresponding digraph

Ngày đăng: 27/02/2023, 22:07

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

TÀI LIỆU LIÊN QUAN

w