Mt263f-11 Discrete Structures Li Tak Sing( 李德成 ) Room A0936 27686816.

Slides:



Advertisements
Similar presentations
Prof. Johnnie Baker Module Basic Structures: Sets
Advertisements

Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
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.
Analytical Methods in CS (CIS 505)
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
SET.   A set is a collection of elements.   Sets are usually denoted by capital letters A, B, Ω, etc.   Elements are usually denoted by lower case.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
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.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
Intro to Set Theory. Sets and Their Elements A set A is a collection of elements. If x is an element of A, we write x  A; if not: x  A. Say: “x is a.
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Fall 2010 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
Chapter 3 – Set Theory  .
Homework Review notes Complete Worksheet #1. Homework Let A = {a,b,c,d}, B = {a,b,c,d,e}, C = {a,d}, D = {b, c} Describe any subset relationships. 1.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
Slides for CISC 2315: Discrete Structures Chapters CISC 2315 Discrete Structures Professor William G. Tanner, Jr. SPRING 2010 Slides created by James.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
CISC 2315 Discrete Structures Professor William G. Tanner, Jr. Spring 2011 Slides created by James L. Hein, author of Discrete Structures, Logic, and Computability,
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
ELEMENTARY SET THEORY.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
Mathematical Preliminaries
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sets Operations.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
Chapter 2 With Question/Answer Animations. Section 2.1.
Rosen 1.6, 1.7. Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by.
Introduction to Set theory. Ways of Describing Sets.
Discrete Mathematics Set.
1 Section 1.2 Sets A set is a collection of things. If S is a set and x is a member or element of S we write x  S. Othewise we write x  S. The set with.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
1 Topic Sets (5.1, 5.2, 5.3). 2 Original author of the slides: Vadim Bulitko University of Alberta Modified by.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
Sets and Basic Operations on Sets Notation A set will usually be denoted by a capital letter, such as, A,B,X, Y,..., whereas lower-case letters, a, b,
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
Discrete Mathematics Lecture # 10 Venn Diagram. Union  Let A and B be subsets of a universal set U. The union of sets A and B is the set of all elements.
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.
Notions & Notations - 1ICOM 4075 (Fall 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Fall 2010 ICOM.
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)
Section 6.1 Set and Set Operations. Set: A set is a collection of objects/elements. Ex. A = {w, a, r, d} Sets are often named with capital letters. Order.
Sets, Permutations, and Combinations. Lecture 4-1: Sets Sets: Powerful tool in computer science to solve real world problems. A set is a collection of.
Dr. Ameria Eldosoky Discrete mathematics
Sets Page 746.
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Set Theory.
Discrete Structures – CNS 2300
Discrete Mathematical The Set Theory
CSNB 143 Discrete Mathematical Structures
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
CISC 2315 Discrete Structures
Chapter 5, Set Theory 1.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
        { } Sets and Venn Diagrams Prime Numbers Even Numbers
Session – 2 SETS & Operations of SETS
Applied Discrete Mathematics Week 2: Proofs
COMPS263F Unit 1 Discrete Structures Li Tak Sing( 李德成 ) Room A
Lecture Sets 2.2 Set Operations.
Presentation transcript:

mt263f-11 Discrete Structures Li Tak Sing( 李德成 ) Room A

mt263f-12 Textbook:Discrete Structures, Logics, and Computability by James L. Hein (2nd Edition) On Fridays, the second hour will be tutorial and tutorial worksheets will be distributed. They will not be assessed. Test:Two Tests Examination:3 hr examination in late April to mid May Course result:Test(30%), Examination(70%) You must have at least 40 marks in both the total score.

mt263f-13 Syllabus Data types, functions, and data structures; Formal logic, recursion, proofs; Algorithms and analysis of algorithms; Formal languages, Turing machines.

mt263f-14 Web site You can find online materials at:

mt263f-15 Elementary Notions and Notations This is related to chapter one of the text book Logical Statements – statements that can either be true or false. For example, I am an OUHK student.

mt263f-16 Negation If S represents a logical statement, then negation of S represents the statement “not S”. If S is: I am a OUHK student, then “not S” is: I am not a OUHK student.

mt263f-17 Truth table A truth table list out all the possible values of different logical statements in different scenarios. So if we list S and “not S” in a true table, we would have: SNot S Truefalse Falsetrue

mt263f-18 Conjunction The conjunction of A and B is the statement “A and B” ABA and B True False TrueFalse

mt263f-19 Disjunction The disjunction of A and B is “A or B”. ABA or B True FalseTrue FalseTrue False

mt263f-110 Comparison of two logical statements Two logical statements are equal if and only if they have the same values as listed in a true table.

mt263f-111 “not (A and B)” and “(not A) or (not B)” ABA and BNot (A and B) TTTF TFFT FTFT FFFT ABNot ANot B(Not A) or (not B) TTFFF TFFTT FTTFT FFTTT This is also known as DeMorgan’s Thereom

mt263f-112 Other equivalent logical statements A and B = B and A (commutative) A or B = B or A (commutative) A and (B and C) = (A and B) and C (associative) A or (B or C) = (A or B) or C (associative) A and (B or C) = (A and B) or (A and C) (distributive)

mt263f-113 A or (B and C) = (A or B) and (A or C) (distributive) not (A and B) = (not A) or (not B) (DeMorgan’s theorem) not (A or B) = (not A) and (not B) (DeMorgan’s theorem) true and A = A false and A = false

mt263f-114 true or A = true false or A = A not (not A) = A A and (A or B) = A (absorption) A or (A and B) = A (absorption)

mt263f-115 Conditional statements If A then B.  If 3=3 then 2=2 (true)  If 3=3 then 2=1 (false)  If 3=2 then 2=2 (true)  If 3=2 then 2=1 (true) ABIf A then B True False True False True

mt263f-116 if and only if “A if and only if B” is actually “if A then B” and “if B then A”. “if and only if” is often written as iff ABif A then Bif B then AA iff B TTTTT TFFTF FTTFF FFTTT “A iff B” is true only if both A or B have the same value. A iff B if A is equivalent to B

mt263f-117 “If A then B” and “If not B then not A” ABNot ANot BIf not B then not A TTFFT TFFTF FTTFT FFTTT So we can see that “if A then B” and “if not B then not A” are equal logical statements.

mt263f-118 So the following statements are equivalent: If the room is available, then we can take it. If we cannot take the room, then it is not available.

mt263f-119 Other equivalent logical statements Not (A or B)(not A) and (not B) A and (B or C)(A and B) or (A and C) A or (B and C)(A or B) and (A or C) If A then B(not A) or B Not (if A then B)A and (not B)

mt263f-120 Proof techniques Proof by Exhaustive Checking  This means that you check every possible case to see that the statement is true.  This is only possible if the number of cases is finite.

mt263f-121 For example, we want to prove the statement: All integers between 10 and 15 exclusive are not square of another integer. Proof: The numbers between 10 and 15 exclusive are 11, 12, 13, 14. We can then check each of these numbers and find that Therefore, we have proved the statement

mt263f-122 Conditional Proof Many statements that we want to proof are in the form “if A then B”. We should start the argument from A and then we should arrive at B.

mt263f-123 Prove the statement: if n is an odd integer, then n 2 is also an odd integer. Proof: n is an odd integer. Let n=2k+1 where k is an integer. Therefore, n 2 =4k 2 +4k+1=2(k 2 +2k)+1 Now, 2(k 2 +2k) is an even number, therefore 2(k 2 +2)+1 is an odd number. Therefore n 2 is an odd number. There are more examples in the textbook.

mt263f-124 Set A set is a collection of things called its elements, members or objects. If S is a set and x is an element in S, then we write x  S If x is not an element in S, then we write x  S Every element in a set must be distinct. We are not interested in the order of its elements.

mt263f-125 Describing Sets List out the elements: A={a,b,c} B={0,1,....,100} C={0,1,1,2} : this is not a set as it has two elements that are equal to 1. Empty set: {}, 

mt263f-126 Equality of sets Two sets are equal if they have the same elements. {1,2,3}={3,2,1} A = B iff (x  A iff x  B) One consequence is that all empty sets are equal because they all contain no elements.

mt263f-127 Finite and infinite sets Finite sets are sets that contain finite number of elements. For example A={1,2,3} Infinite sets are sets with in infinite number of elements. For example: N={0,1,2,3,...}, Z={....-2,-1,0,1,2,3...}

mt263f-128 Describing sets by properties S={x| x has property P}  A={x| x is an even number}  R={x| x is a real number}

mt263f-129 Subsets If every element of A can be found in B, then A is a subset of B, and is written as: A  B If A is not a subset of B, we write: A  B Venn diagram is a graphical representation of sets. The following Venn diagram represents A  B.

mt263f-130 A B A

mt263f-131 Consequence: if A is a set, then A  A. Proof: if A is a set, then every element in A is in A, therefore A  A. Consequence: if A is a set, then  A. Proof: the condition of  A is that every element of  should be in A. The other way to put it is: you cannot find any element that is in  but not in A. Now, this statement is true because you cannot find any element in .

mt263f-132 Example  Prove that A  B where A={x|x>4}, B={x|x 2 >1}  For every x  A,  x>4  x 2 >16  x 2 >1  x  B  So every x in A is also in B, so A  B

mt263f-133 Power set A power set of S is the set that contains all the subsets of S. The power set is denoted as power(S). If S={a,b,c}, then power(S)={ ,{a},{b},{c},{a,b},{b,c},{c,a}, {a,b,c}} If S is a set with n elements, then power(S) is a set with 2 n elements.

mt263f-134 Equality of sets A=B means A  B and B  A

mt263f-135 Union The union of two sets A and B is the set of all the elements that are either in A or in B. It is denoted as A  B. A  B={x| x  A or x  B} The following figure represents A  B.

mt263f-136 A B

mt263f-137 Properties of Union A  =A A  B=B  A (commutative) A  (B  C)=(A  B)  C (associative) A  A=A A  B if and only if A  B=B.

Proof of A  =A Obviously, A  A  Now, we want to prove that A   A. For every x  A   x  A or x   x  A or false  x  A Therefore, A   A Therefore A  =A mt263f-138

Proof of A  B if and only if A  B=B If A  B, x  A  x  B Now, B  A  B, we want to prove that A  B  B. x  A  B  x  A or x  B  x  B or x  B (since x  A  x  B)  x  B Therefore A  B  B Therefore A  B=B mt263f-139

Proof of A  B if and only if A  B=B (Cont.) Assume A  B=B x  A  x  A or x  B  x  A  B  x  B (since A  B=B ) Therefore A  B mt263f-140

mt263f-141 Intersection of sets The intersection of two sets A and B is the set of all elements that are in both A and B. It is denoted as A  B. A  B={x| x  A and x  B} The following figure represents A  B.

mt263f-142 A B

mt263f-143 Properties of Intersection A  =  A  B=B  A (commutative) A  (B  C)=(A  B)  C (associative) A  A=A A  B if and only if A  B=A

Proof of A  =  Obviously,  A . Now, we just have to prove that A . x  A   x  A and x    x  A and false  false  x   Therefore, A   Therefore A  =  mt263f-144

Proof of A  B if and only if A  B=A Assume that A  B, we want to prove that A  B=A. Obviously, A  B  A x  A  x  A and x  B (since A  B)  x  A  B Therefore A  B=A mt263f-145

Proof of A  B if and only if A  B=A(cont.) Assume that A  B=A x  A  x  A  B (since A  B=A)  x  A and x  B  x  B Therefore A  B mt263f-146

mt263f-147 Difference of sets If A and B are sets, then the different A-B is the set of elements in A that are not in B. A-B={x| x  A and x  B}

mt263f-148 A B

mt263f-149 Symmetric Difference of Sets The symmetric difference of sets A and B is the set A  B of elements that are either in A or in B but not both. A  B={x| (x  A or x  B) and not (x  A and x  B) }

mt263f-150 A B

mt263f-151 Complement of a Set The complement of A is the set that contain all elements except those in A. A’={x| x  A}

mt263f-152 Combining properties A  (B  C)=(A  B)  (A  C) (distributive) A  (B  C)=(A  B)  (A  C) (distributive) A  (A  B)=A (absorption) A  (A  B)=A (absorption) (A’)’=A (A  B)’=A’  B’ (DeMorgan’s theorem)