2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics)  집합 연산 (Set Operations)

Slides:



Advertisements
Similar presentations
Set Operations. When sets are equal A equals B iff for all x, x is in A iff x is in B or … and this is what we do to prove sets equal.
Advertisements

Union Definition: The union of sets A and B, denoted by A B, contains those elements that are in A or B or both: Example: { 1, 2, 3} {3, 4, 5} = { 1,
 Union  Intersection  Relative Complement  Absolute Complement Likened to Logical Or and Logical And Likened to logical Negation.
Prof. Johnnie Baker Module Basic Structures: Sets
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Set Operators Goals Show how set identities are established Introduce some important identities.
1 Section 1.7 Set Operations. 2 Union The union of 2 sets A and B is the set containing elements found either in A, or in B, or in both The denotation.
1 Set Theory Rosen 6 th ed., § Introduction to Set Theory A set is a structure, representing an unordered collection (group, plurality) of zero.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Copyright © Zeph Grunschlag, Set Operations Zeph Grunschlag.
Sets 1.
Sets 1.
CSE115/ENGR160 Discrete Mathematics 02/14/12 Ming-Hsuan Yang UC Merced 1.
1 Set Operations CS/APMA 202, Spring 2005 Rosen, section 1.7 Aaron Bloomfield.
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
Operations on Sets – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Operations on Sets Reading: Kolman, Section 1.2.
2015 년 봄학기 강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics) 집합과 연산 (Sets and Operations)
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
Chapter 3 – Set Theory  .
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Chapter 7 Review Important Terms, Symbols, Concepts 7.1. Logic A proposition is a statement (not a question.
Discrete Structure Sets. 2 Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element.
CS201: Data Structures and Discrete Mathematics I
CompSci 102 Discrete Math for Computer Science
2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics)  집합 (Set)
Set Operators. Copyright © Peter Cappello Union Let A and B be sets. A union B, denoted A  B, is the set A  B = { x | x  A  x  B }. Draw a.
Mathematical Preliminaries
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sets Operations.
Chapter 2 With Question/Answer Animations. Section 2.1.
Introduction to Set theory. Ways of Describing Sets.
Discrete Mathematics SETS. What is a set? ^A set is a unordered collection of “objects”  People in a class: {A yşe, B arış, C anan }  Cities in Turkey.
Lecture # 12 Set Identities
Ch. 2 Basic Structures Section 1 Sets. Principles of Inclusion and Exclusion | A  B | = | A | + | B | – | A  B| | A  B  C | = | A | + | B | + | C.
Discrete Mathematics. Set Theory - Definitions and notation A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing.
Review 2 Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by lower.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
5.1 CompSci 102© Michael Frank Today’s topics SetsSets – –Definitions – –Operations –Proving Set Identities Reading: Sections Reading: Sections.
Thinking Mathematically Venn Diagrams and Set Operations.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
Set Operators Goals Show how set identities are established
Dr. Ameria Eldosoky Discrete mathematics
Discrete Structures – CNS 2300
Discrete Mathematical The Set Theory
COT 3100, Spring 2001 Applications of Discrete Structures
Sets Section 2.1.
Chapter 1 Logic and Proofs Homework 2 Given the statement “A valid password is necessary for you to log on to the campus server.” Express the statement.
CSE15 Discrete Mathematics 02/15/17
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Introduction to Set Theory
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Set Theory Rosen 6th ed., §
Set Operations Section 2.2.
Unit I: Part I Set Theory
Week #2 – 4/6 September 2002 Prof. Marie desJardins
L5 Set Operations.
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
CSC102 - Discrete Structures (Discrete Mathematics) Set Operations
Presentation transcript:

2014 년 봄학기 강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics)  집합 연산 (Set Operations)

Discrete Mathematics by Yang-Sae Moon Page 2 Union Operator ( 합집합 ) For sets A, B, their union A  B is the set containing all elements that are either in A, or (“  ”) in B (or, of course, in both). (A 또는 B 에 속하거나 양쪽에 모두 속하는 원소들의 집합 ) Formally, A  B = {x | x  A  x  B}. Note that A  B contains all the elements of A and it contains all the elements of B:  A, B: (A  B  A)  (A  B  B) 예제 : {a,b,c}  {2,3} = {a,b,c,2,3} {2,3,5}  {3,5,7} = {2,3,5,3,5,7} ={2,3,5,7} Set Operations

Discrete Mathematics by Yang-Sae Moon Page 3 Intersection Operator ( 교집합 ) For sets A, B, their intersection A  B is the set containing all elements that are simultaneously in A and (“  ”) in B. (A 와 B 양쪽 모두에 속하는 원소들의 집합 ) Formally, A  B = {x | x  A  x  B}. Note that A  B is a subset of A and it is a subset of B:  A, B: (A  B  A)  (A  B  B) 예제 : {a,b,c}  {2,3} =  {2,4,6}  {3,4,5} = {4} Set Operations

Discrete Mathematics by Yang-Sae Moon Page 4 Disjointedness ( 서로 소 ) Two sets A, B are called disjoint (i.e., unjoined) iff their intersection is empty. (A  B=  ) ( 교집합이 공집합이면 이들 두 집합은 서로 소라 한다.) Example: the set of even integers is disjoint with the set of odd integers. Set Operations

Discrete Mathematics by Yang-Sae Moon Page 5 Inclusion-Exclusion Principle ( 포함 - 배제 원리 ) How many elements are in A  B? |A  B| = |A|  |B|  |A  B| Example: How many students are on our class list? Consider set E  I  M, I = {s | s turned in an information sheet} M = {s | s sent the TAs their address} Some students did both! |E| = |I  M| = |I|  |M|  |I  M| 중복 제거 Set Operations

Discrete Mathematics by Yang-Sae Moon Page 6 Set Difference ( 차집합 ) For sets A, B, the difference of A and B, written A  B, is the set of all elements that are in A but not B. (A 에는 속하나 B 에는 속하지 않는 원소들의 집합 ) Formally, A  B =  x  x  A  x  B  예제 : {1, 2, 3, 4, 5, 6}  {2, 3, 5, 7, 11} = {1, 4, 6} Z  N  {…, -1, 0, 1, 2, … }  {0, 1, … } = {x | x is an integer but not a natural number} = {x | x is a negative integer} = {…, -3, -2, -1} Set Operations

Discrete Mathematics by Yang-Sae Moon Page 7 Set Difference – Venn Diagram A  B is what’s left after B “takes a bite out of A” Set A Set B Set A  B Chomp! ( 갉아먹어 !) Set Operations

Discrete Mathematics by Yang-Sae Moon Page 8 Set Complements ( 여집합 ) The domain can itself be considered a set, call it U. ( 정의역 자체도 집합이다.) We say that for any set A  U, the complement of A, written A, is the complement of A w.r.t. U, i.e., it is U  A. 예제 : If U=N, {3, 5} = {0, 1, 2, 4, 6, 7, …} An equivalent definition, when U is clear: A =  x  x  A  A U A Set Operations

Discrete Mathematics by Yang-Sae Moon Page 9 Set Identities ( 집합의 항등 ) (1/2) Identity Name A   = A A  U = A Identity laws A  U = U A   =  Domination laws A  A = A A  A = A Idempotent laws A = ADouble complement law A  B = B  AA  B = B  AA  B = B  AA  B = B  A Commutative laws A  (B  C) = (A  B)  C A  (B  C) = (A  B)  C Associative laws Set Operations

Discrete Mathematics by Yang-Sae Moon Page 10 Set Identities ( 집합의 항등 ) (2/2) Identity Name A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C) Distributive laws A  B = A  BA  B = A  BA  B = A  BA  B = A  B De Morgan’s laws A  (A  B) = A A  (A  B) = A Absorption laws A  A = U A  A =  Complement laws Set Operations

Discrete Mathematics by Yang-Sae Moon Page 11 Proving Identity Sets ( 항등의 증명 ) To prove statements about sets, of the form A = B, here are three useful techniques: ( 집합의 항등 증명 방법에는 …) Method 1: Prove A  B and B  A separately. Method 2: Use set builder notation & logical equivalences. ( 조건 제시법과 논리적 동치 관계 활용 ) Method 3: Use a membership table. ( 구성원 표를 사용 ) Set Operations

Discrete Mathematics by Yang-Sae Moon Page 12 Proving Identity Sets (Example of Method 1) Example: Show A  (B  C)=(A  B)  (A  C). Show A  (B  C)  (A  B)  (A  C). Assume x  A  (B  C), & show x  (A  B)  (A  C). We know that x  A, and either x  B or x  C. (by assumption) −Case 1: x  B. Then x  A  B, so x  (A  B)  (A  C). −Case 2: x  C. Then x  A  C, so x  (A  B)  (A  C). Therefore, x  (A  B)  (A  C). Therefore, A  (B  C)  (A  B)  (A  C). Show (A  B)  (A  C)  A  (B  C). … Set Operations

Discrete Mathematics by Yang-Sae Moon Page 13 Proving Identity Sets (Example of Method 2) Example: Show (A  B)=A  B. (A  B)= {x | x  A  B} = {x | ¬(x  A  B)} = {x | ¬(x  A  x  B)} = {x | x  A  x  B} = {x | x  A  x  B} = {x | x  A  B} = A  B Set Operations

Discrete Mathematics by Yang-Sae Moon Page 14 Proving Identity Sets (Example of Method 3) Membership tables ( 구성원 표 ) Just like truth tables for propositional logic. ( 명제의 진리표와 유사 ) Columns for different set expressions. ( 열은 집합 표현을 나타냄 ) Rows for all combinations of memberships in constituent sets. Use “1” to indicate membership in the derived set, “0” for non-membership. ( 행에는 집합의 원소이면 1, 아니면 0 을 표시 ) Prove equivalence with identical columns. ( 두 컬럼이 동일함을 보임 ) Example: Prove (A  B)  B = A  B. Set Operations

Discrete Mathematics by Yang-Sae Moon Page 15 Generalized Unions and Intersections Since union & intersection are commutative and associative, we can extend them from operating on ordered pairs of sets (A, B) to operating on sequences of sets (A 1, …, A n ) ( 합집합 및 교집합은 교환 및 결합법칙이 성립하므로, 두 집합에 대한 연산을 확 장하여 세 개 이상의 집합에 대해서도 연산 적용이 가능하다.) Examples of generalized unions & intersections A = {0, 2, 4, 6, 8}, B = {0, 1, 2, 3, 4}, C = {0, 3, 6, 9} A  B  C = {0, 1, 2, 3, 4, 6, 8, 9} A  B  C = {0} Set Operations

Discrete Mathematics by Yang-Sae Moon Page 16 Generalized Union ( 합집합의 일반화 ) Binary union operator: A  B n-ary union: A 1  A 2  …  A n = ((…((A 1  A 2 )  …)  A n ) (grouping & order is irrelevant) “Big U” notation: Or for infinite sets of sets: Set Operations

Discrete Mathematics by Yang-Sae Moon Page 17 Generalized Intersection ( 교집합의 일반화 ) Binary intersection operator: A  B n-ary intersection: A 1  A 2  …  A n  ((…((A 1  A 2 )  …)  A n ) (grouping & order is irrelevant) “Big Arch” notation: Or for infinite sets of sets: Set Operations

Discrete Mathematics by Yang-Sae Moon Page 18 컴퓨터에서 집합의 표현 표현 방법 전체 집합 U 가 유한집합이라 가정하고, U 의 원소들을 a 1, a 2, …, a n 과 같이 순 서를 매긴다. U 의 부분집합 A 를 길이 n 의 비트열 (bit string) 로 표현한다. −i th bit = 1 if a i  A, 0 otherwise 예제 : U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} 홀수 정수를 포함하는 부분집합을 표현하는 비트열 = 짝수 정수를 포함하는 부분집합을 나타내는 비트열 = 집합 연산과 컴퓨터 연산의 관계 합집합 (union) = Bitwise OR 교집합 (intersection) = Bitwise AND 여집합 (complement) = Bitwise NOT Set Operations