1. Trang chủ
  2. » Giáo án - Bài giảng

Discrrete mathematics for computer science 10relations

15 83 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 15
Dung lượng 185,9 KB

Nội dung

Relations Between Sets 2/13/12 Relations Students Courses Sam EC 10 Mary CS20 The “is-taking” relation A relation is a set of ordered pairs: {(Sam,Ec10), (Sam, CS20), (Mary, CS20)} 2/13/12 Function: A → B AT MOST ONE ARROW OUT OF EACH ELEMENT OF A domain f codomain A B Each element of A is associated with at most one element of B 2/13/12 a⟼b f(a) = b Total Function: A → B EXACTLY ONE ARROW OUT OF EACH ELEMENT OF A domain f codomain A B Each element of A is associated with ONE AND ONLY one element of B 2/13/12 a⟼b f(a) = b A Function that is “Partial,” Not Total domain f R×R codomain R f: R ×R → R f(x,y) = x/y Defined for all pairs (x,y) except when y=0! 2/13/12 A Function that is “Partial,” Not Total domain f R×R codomain R f: R ×R → R f(x,y) = x/y Defined for all pairs (x,y) except when y=0! Or: f is a total function: R×(R-{0})→R 2/13/12 Injective Function “at most one arrow in” domain f A codomain B (∀b∈B)(∃≤1a∈A) f(a)=b 2/13/12 Surjective Function “at least one arrow in” domain f A codomain B (∀b∈B)(∃≥1a∈A) f(a)=b 2/13/12 Bijection = Total + Injective + Surjective “exactly one arrow out of each element of A and exactly one arrow in to each element of B” domain f A codomain B (∀a∈A) f(a) is defined and 2/13/12 (∀b∈B)(∃=1a∈A) f(a)=b Cardinality or “Size” For finite sets, a bijection exists iff A and B have the same number of elements domain A 2/13/12 f codomain B 10 Cardinality or “Size” Use the same as a definition of “same size” for infinite sets: Sets A and B have the same size iff there is a bijection between A and B Theorem: The set of even integers has the same size as the set of all integers [f(2n) = n] …, -4, -3, -2, -1, 0, 1, 2, 3, … …, -8, -6, -4, -2, 0, 2, 4, 6, … 2/13/12 11 Cardinality or “Size” There are as many natural numbers as integers 8… 0, -1, 1, -2, 2, -3, 3, -4, … f(n) = n/2 if n is even, -(n+1)/2 if n is odd Defn: A set is countably infinite if it has the same size as the set of natural numbers 2/13/12 12 An Infinite Set May Have the Same Size as a Proper Subset! ⋮ 5 4 3 2 1 0 Hilton 2/13/12 ⋮ Every room of both hotels is full! Suppose the Sheraton has to be evacuated Sheraton 13 An Infinite Set May Have the Same Size as a Proper Subset! ⋮ ⋮ 5 4 Step 1: Tell the resident of room n in the Hilton to go to room 2n 3 2 This leaves all the odd-numbered rooms of the Hilton unoccupied 1 0 Hilton 2/13/12 Sheraton 14 An Infinite Set May Have the Same Size as a Proper Subset! ⋮ ⋮ 5 4 Step 2: Tell the resident of room n in the Sheraton to go to room 2n+1 of the Hilton 3 2 1 0 Hilton 2/13/12 Everyone gets a room! Sheraton 15 ... → R f(x,y) = x/y Defined for all pairs (x,y) except when y=0! 2/13/12 A Function that is “Partial,” Not Total domain f R×R codomain R f: R ×R → R f(x,y) = x/y Defined for all pairs (x,y) except... “Size” For finite sets, a bijection exists iff A and B have the same number of elements domain A 2/13/12 f codomain B 10 Cardinality or “Size” Use the same as a definition of “same size” for infinite

Ngày đăng: 22/03/2019, 10:47