Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation...

100
Definition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your Turn Set Theory Definitions E. Wenderholm Department of Computer Science SUNY Oswego c 2016 Elaine Wenderholm All rights Reserved E. Wenderholm Set Theory

Transcript of Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation...

Page 1: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set TheoryDefinitions

E. Wenderholm

Department of Computer ScienceSUNY Oswego

c© 2016 Elaine Wenderholm All rights Reserved

E. Wenderholm Set Theory

Page 2: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Outline1 Definition2 Denotation3 Operations

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

4 Special Sets5 Set Operations that Create New Sets

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

6 Tuples7 DeMorgan’s Laws8 Your Turn

E. Wenderholm Set Theory

Page 3: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Definition

A Set is a collection of entities (things).

The entities in a set are called its members, or elements.

Example: A set can be a collection of 4 letters.

E. Wenderholm Set Theory

Page 4: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Definition

A Set is a collection of entities (things).

The entities in a set are called its members, or elements.

Example: A set can be a collection of 4 letters.

E. Wenderholm Set Theory

Page 5: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Definition

A Set is a collection of entities (things).

The entities in a set are called its members, or elements.

Example: A set can be a collection of 4 letters.

E. Wenderholm Set Theory

Page 6: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Multiset DefinitionA Set that contains duplicate elements.

We use multisets only if we want to keep multiple instances ofof identical elements in the set.

Example: {1, 3, 5, 5, 7} is a multiset.

If we have a multiset, and want to view it as a set, we simplyignore the duplicate elements.

Example: {1, 3, 5, 5, 7} 6= {1, 3, 5, 7} as multisets, but they areequal as sets.

We will only use sets in this class. If we generate a multiset,we will rewrite it as a set.

Example: {20, 20} becomes {20}

E. Wenderholm Set Theory

Page 7: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Multiset DefinitionA Set that contains duplicate elements.

We use multisets only if we want to keep multiple instances ofof identical elements in the set.

Example: {1, 3, 5, 5, 7} is a multiset.

If we have a multiset, and want to view it as a set, we simplyignore the duplicate elements.

Example: {1, 3, 5, 5, 7} 6= {1, 3, 5, 7} as multisets, but they areequal as sets.

We will only use sets in this class. If we generate a multiset,we will rewrite it as a set.

Example: {20, 20} becomes {20}

E. Wenderholm Set Theory

Page 8: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Multiset DefinitionA Set that contains duplicate elements.

We use multisets only if we want to keep multiple instances ofof identical elements in the set.

Example: {1, 3, 5, 5, 7} is a multiset.

If we have a multiset, and want to view it as a set, we simplyignore the duplicate elements.

Example: {1, 3, 5, 5, 7} 6= {1, 3, 5, 7} as multisets, but they areequal as sets.

We will only use sets in this class. If we generate a multiset,we will rewrite it as a set.

Example: {20, 20} becomes {20}

E. Wenderholm Set Theory

Page 9: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Multiset DefinitionA Set that contains duplicate elements.

We use multisets only if we want to keep multiple instances ofof identical elements in the set.

Example: {1, 3, 5, 5, 7} is a multiset.

If we have a multiset, and want to view it as a set, we simplyignore the duplicate elements.

Example: {1, 3, 5, 5, 7} 6= {1, 3, 5, 7} as multisets, but they areequal as sets.

We will only use sets in this class. If we generate a multiset,we will rewrite it as a set.

Example: {20, 20} becomes {20}

E. Wenderholm Set Theory

Page 10: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set DenotationHow do we define the elements in a set?

A set has a name. By convention we use an upper-case letter.

S =

“Curly braces”, { and }, are used to delimit the elements.

S = { }The elements are listed, separated by commas (for a finiteset).

S = {a, b, c , d}This statement says that a set named S contains the letters a,b, c , and d .

A set may also be drawn as a picture, known as a VennDiagram.

E. Wenderholm Set Theory

Page 11: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set DenotationHow do we define the elements in a set?

A set has a name. By convention we use an upper-case letter.

S =

“Curly braces”, { and }, are used to delimit the elements.

S = { }

The elements are listed, separated by commas (for a finiteset).

S = {a, b, c , d}This statement says that a set named S contains the letters a,b, c , and d .

A set may also be drawn as a picture, known as a VennDiagram.

E. Wenderholm Set Theory

Page 12: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set DenotationHow do we define the elements in a set?

A set has a name. By convention we use an upper-case letter.

S =

“Curly braces”, { and }, are used to delimit the elements.

S = { }The elements are listed, separated by commas (for a finiteset).

S = {a, b, c , d}This statement says that a set named S contains the letters a,b, c , and d .

A set may also be drawn as a picture, known as a VennDiagram.

E. Wenderholm Set Theory

Page 13: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set DenotationHow do we define the elements in a set?

A set has a name. By convention we use an upper-case letter.

S =

“Curly braces”, { and }, are used to delimit the elements.

S = { }The elements are listed, separated by commas (for a finiteset).

S = {a, b, c , d}This statement says that a set named S contains the letters a,b, c , and d .

A set may also be drawn as a picture, known as a VennDiagram.

E. Wenderholm Set Theory

Page 14: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Venn Diagrams

A Venn Diagram provides a visual depiction of sets and setoperations.Here is a web link for learning about Venn Diagrams.

E. Wenderholm Set Theory

Page 15: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set DenotationImplicit definitions of sets

We use an Ellipsis (a comma and three dots) to denote“missing” elements in a set when the number of elements istoo numerous to list. The reader fills in the blanks.

Here is the set of the natural (counting) numbersN = {1, 2, 3, . . .}and the integersZ = {. . . ,−2,−1, 0, 1, 2, . . .}Notice we do not use this notation for R, the Real numbers.

Ellipsis are shorthand for finite setsC = {2, 4, 6, . . . , 100}

E. Wenderholm Set Theory

Page 16: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set DenotationImplicit definitions of sets

We use an Ellipsis (a comma and three dots) to denote“missing” elements in a set when the number of elements istoo numerous to list. The reader fills in the blanks.

Here is the set of the natural (counting) numbersN = {1, 2, 3, . . .}

and the integersZ = {. . . ,−2,−1, 0, 1, 2, . . .}Notice we do not use this notation for R, the Real numbers.

Ellipsis are shorthand for finite setsC = {2, 4, 6, . . . , 100}

E. Wenderholm Set Theory

Page 17: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set DenotationImplicit definitions of sets

We use an Ellipsis (a comma and three dots) to denote“missing” elements in a set when the number of elements istoo numerous to list. The reader fills in the blanks.

Here is the set of the natural (counting) numbersN = {1, 2, 3, . . .}and the integersZ = {. . . ,−2,−1, 0, 1, 2, . . .}

Notice we do not use this notation for R, the Real numbers.

Ellipsis are shorthand for finite setsC = {2, 4, 6, . . . , 100}

E. Wenderholm Set Theory

Page 18: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set DenotationImplicit definitions of sets

We use an Ellipsis (a comma and three dots) to denote“missing” elements in a set when the number of elements istoo numerous to list. The reader fills in the blanks.

Here is the set of the natural (counting) numbersN = {1, 2, 3, . . .}and the integersZ = {. . . ,−2,−1, 0, 1, 2, . . .}Notice we do not use this notation for R, the Real numbers.

Ellipsis are shorthand for finite setsC = {2, 4, 6, . . . , 100}

E. Wenderholm Set Theory

Page 19: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Using rules to define the elements of a set

A rule is some property that is true for all the elements inthe set.S = {n | a rule about n}n is a “variable name”, sort of like a formal parameter. It isused to refer to all the elements in the set.

The notation “P(x)” is often used, meaning “some propertyof x”S = {n | P(n)}Example: E = {n|n = 2×m, m ∈ N}We read “E = {n | ” as“E is the set of all elements n, where”n and m are variable names (like in a “for” statement) andare used to refer to elements in the set.

E. Wenderholm Set Theory

Page 20: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Using rules to define the elements of a set

A rule is some property that is true for all the elements inthe set.S = {n | a rule about n}n is a “variable name”, sort of like a formal parameter. It isused to refer to all the elements in the set.The notation “P(x)” is often used, meaning “some propertyof x”S = {n | P(n)}

Example: E = {n|n = 2×m, m ∈ N}We read “E = {n | ” as“E is the set of all elements n, where”n and m are variable names (like in a “for” statement) andare used to refer to elements in the set.

E. Wenderholm Set Theory

Page 21: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Using rules to define the elements of a set

A rule is some property that is true for all the elements inthe set.S = {n | a rule about n}n is a “variable name”, sort of like a formal parameter. It isused to refer to all the elements in the set.The notation “P(x)” is often used, meaning “some propertyof x”S = {n | P(n)}Example: E = {n|n = 2×m, m ∈ N}

We read “E = {n | ” as“E is the set of all elements n, where”n and m are variable names (like in a “for” statement) andare used to refer to elements in the set.

E. Wenderholm Set Theory

Page 22: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Using rules to define the elements of a set

A rule is some property that is true for all the elements inthe set.S = {n | a rule about n}n is a “variable name”, sort of like a formal parameter. It isused to refer to all the elements in the set.The notation “P(x)” is often used, meaning “some propertyof x”S = {n | P(n)}Example: E = {n|n = 2×m, m ∈ N}We read “E = {n | ” as“E is the set of all elements n, where”

n and m are variable names (like in a “for” statement) andare used to refer to elements in the set.

E. Wenderholm Set Theory

Page 23: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Using rules to define the elements of a set

A rule is some property that is true for all the elements inthe set.S = {n | a rule about n}n is a “variable name”, sort of like a formal parameter. It isused to refer to all the elements in the set.The notation “P(x)” is often used, meaning “some propertyof x”S = {n | P(n)}Example: E = {n|n = 2×m, m ∈ N}We read “E = {n | ” as“E is the set of all elements n, where”n and m are variable names (like in a “for” statement) andare used to refer to elements in the set.

E. Wenderholm Set Theory

Page 24: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Operations, Operators, OperandsWhat ARE these??

Example: 3 + 5operation : additionoperator (symbol) : +operands : 3 and 5; left operand 3, right operand 5.operator type : binary (2 operands) and infix (written

in-between the operands)

Example: −45 “-” operator is the prefix (unary) minusoperator.

Any arithmetic expression can be written in postfix notation.The benefit: parentheses are NOT needed! Postfix was usedin the first HP calculators (They didn’t have parentheses.)

E. Wenderholm Set Theory

Page 25: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Operations, Operators, OperandsWhat ARE these??

Example: 3 + 5operation : additionoperator (symbol) : +operands : 3 and 5; left operand 3, right operand 5.operator type : binary (2 operands) and infix (written

in-between the operands)

Example: −45 “-” operator is the prefix (unary) minusoperator.

Any arithmetic expression can be written in postfix notation.The benefit: parentheses are NOT needed! Postfix was usedin the first HP calculators (They didn’t have parentheses.)

E. Wenderholm Set Theory

Page 26: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Operations, Operators, OperandsWhat ARE these??

Example: 3 + 5operation : additionoperator (symbol) : +operands : 3 and 5; left operand 3, right operand 5.operator type : binary (2 operands) and infix (written

in-between the operands)

Example: −45 “-” operator is the prefix (unary) minusoperator.

Any arithmetic expression can be written in postfix notation.The benefit: parentheses are NOT needed! Postfix was usedin the first HP calculators (They didn’t have parentheses.)

E. Wenderholm Set Theory

Page 27: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Basic Operations on SetsSet Equality and Set Membership

Set Equality.Two sets S and T are equal, S = T if and only if they containthe same elements. Otherwise they are unequal, S 6= T .

Set Membership.p is a member of (an element of) a set S (or, that set Scontains p) is denoted p ∈ S .p is not an element of S is denoted p 6∈ S .Notice that ∈ is a infix operator. The left operand is of typeelement. The right operand is of type set.

E. Wenderholm Set Theory

Page 28: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Basic Operations on SetsSet Equality and Set Membership

Set Equality.Two sets S and T are equal, S = T if and only if they containthe same elements. Otherwise they are unequal, S 6= T .

Set Membership.p is a member of (an element of) a set S (or, that set Scontains p) is denoted p ∈ S .p is not an element of S is denoted p 6∈ S .

Notice that ∈ is a infix operator. The left operand is of typeelement. The right operand is of type set.

E. Wenderholm Set Theory

Page 29: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Basic Operations on SetsSet Equality and Set Membership

Set Equality.Two sets S and T are equal, S = T if and only if they containthe same elements. Otherwise they are unequal, S 6= T .

Set Membership.p is a member of (an element of) a set S (or, that set Scontains p) is denoted p ∈ S .p is not an element of S is denoted p 6∈ S .Notice that ∈ is a infix operator. The left operand is of typeelement. The right operand is of type set.

E. Wenderholm Set Theory

Page 30: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Some Properties of Sets

The order of elements in a set is unimportant.{a, b, c , d} = {d , a, b, c}

We can define (or test) sets for equality or inequality.{a, b} 6= {b}

We can define (or test) for membership with the ∈ operator4 ∈ {2, 4, 6, 8} 1 6∈ {a, b}

The elements of a set need not be the same “type”, but theyoften are.

T = {1, sally , red , r}We can count the number of elements in a finite set. It isdenoted with vertical bars | |

| S | = 4A set may be an element of (a member of) another set!

{1, {sam, july}, {{ocean}}}

E. Wenderholm Set Theory

Page 31: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Some Properties of Sets

The order of elements in a set is unimportant.{a, b, c , d} = {d , a, b, c}

We can define (or test) sets for equality or inequality.{a, b} 6= {b}

We can define (or test) for membership with the ∈ operator4 ∈ {2, 4, 6, 8} 1 6∈ {a, b}

The elements of a set need not be the same “type”, but theyoften are.

T = {1, sally , red , r}We can count the number of elements in a finite set. It isdenoted with vertical bars | |

| S | = 4A set may be an element of (a member of) another set!

{1, {sam, july}, {{ocean}}}

E. Wenderholm Set Theory

Page 32: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Some Properties of Sets

The order of elements in a set is unimportant.{a, b, c , d} = {d , a, b, c}

We can define (or test) sets for equality or inequality.{a, b} 6= {b}

We can define (or test) for membership with the ∈ operator4 ∈ {2, 4, 6, 8} 1 6∈ {a, b}

The elements of a set need not be the same “type”, but theyoften are.

T = {1, sally , red , r}We can count the number of elements in a finite set. It isdenoted with vertical bars | |

| S | = 4A set may be an element of (a member of) another set!

{1, {sam, july}, {{ocean}}}

E. Wenderholm Set Theory

Page 33: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Some Properties of Sets

The order of elements in a set is unimportant.{a, b, c , d} = {d , a, b, c}

We can define (or test) sets for equality or inequality.{a, b} 6= {b}

We can define (or test) for membership with the ∈ operator4 ∈ {2, 4, 6, 8} 1 6∈ {a, b}

The elements of a set need not be the same “type”, but theyoften are.

T = {1, sally , red , r}

We can count the number of elements in a finite set. It isdenoted with vertical bars | |

| S | = 4A set may be an element of (a member of) another set!

{1, {sam, july}, {{ocean}}}

E. Wenderholm Set Theory

Page 34: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Some Properties of Sets

The order of elements in a set is unimportant.{a, b, c , d} = {d , a, b, c}

We can define (or test) sets for equality or inequality.{a, b} 6= {b}

We can define (or test) for membership with the ∈ operator4 ∈ {2, 4, 6, 8} 1 6∈ {a, b}

The elements of a set need not be the same “type”, but theyoften are.

T = {1, sally , red , r}We can count the number of elements in a finite set. It isdenoted with vertical bars | |

| S | = 4

A set may be an element of (a member of) another set!{1, {sam, july}, {{ocean}}}

E. Wenderholm Set Theory

Page 35: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Some Properties of Sets

The order of elements in a set is unimportant.{a, b, c , d} = {d , a, b, c}

We can define (or test) sets for equality or inequality.{a, b} 6= {b}

We can define (or test) for membership with the ∈ operator4 ∈ {2, 4, 6, 8} 1 6∈ {a, b}

The elements of a set need not be the same “type”, but theyoften are.

T = {1, sally , red , r}We can count the number of elements in a finite set. It isdenoted with vertical bars | |

| S | = 4A set may be an element of (a member of) another set!

{1, {sam, july}, {{ocean}}}E. Wenderholm Set Theory

Page 36: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Subset Operator

Assume we have two sets A and B.

We say that A is a subset of B, written as A ⊆ B, if everymember of A is also a member of B.

We can also write this as A ⊆ B ≡ {a | a ∈ A→ a ∈ B}A is a proper subset of B, written A ⊂ B, if A ⊆ B andA 6= B.

E. Wenderholm Set Theory

Page 37: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Subset Operator

Assume we have two sets A and B.We say that A is a subset of B, written as A ⊆ B, if everymember of A is also a member of B.

We can also write this as A ⊆ B ≡ {a | a ∈ A→ a ∈ B}A is a proper subset of B, written A ⊂ B, if A ⊆ B andA 6= B.

E. Wenderholm Set Theory

Page 38: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Subset Operator

Assume we have two sets A and B.We say that A is a subset of B, written as A ⊆ B, if everymember of A is also a member of B.

We can also write this as A ⊆ B ≡ {a | a ∈ A→ a ∈ B}

A is a proper subset of B, written A ⊂ B, if A ⊆ B andA 6= B.

E. Wenderholm Set Theory

Page 39: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

What are operations?Set Equality and Set MembershipTesting Set PropertiesSubsets

Subset Operator

Assume we have two sets A and B.We say that A is a subset of B, written as A ⊆ B, if everymember of A is also a member of B.

We can also write this as A ⊆ B ≡ {a | a ∈ A→ a ∈ B}A is a proper subset of B, written A ⊂ B, if A ⊆ B andA 6= B.

E. Wenderholm Set Theory

Page 40: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

The Empty Setcontains no elements

The empty set is a unique set.

The empty set contains no elements.

The empty set is denoted ∅, or sometimes as {}.| ∅ | = 0

E. Wenderholm Set Theory

Page 41: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

The Empty Setcontains no elements

The empty set is a unique set.

The empty set contains no elements.

The empty set is denoted ∅, or sometimes as {}.| ∅ | = 0

E. Wenderholm Set Theory

Page 42: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

The Empty Setcontains no elements

The empty set is a unique set.

The empty set contains no elements.

The empty set is denoted ∅, or sometimes as {}.

| ∅ | = 0

E. Wenderholm Set Theory

Page 43: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

The Empty Setcontains no elements

The empty set is a unique set.

The empty set contains no elements.

The empty set is denoted ∅, or sometimes as {}.| ∅ | = 0

E. Wenderholm Set Theory

Page 44: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

The Universal Set

The Universal Set U is a set that contains all elements.

This set is often called the Domain of Discourse.

E. Wenderholm Set Theory

Page 45: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsCreating new sets from existing sets

A ∪ B, A union B (all the elements)

A ∪ B = {x | x ∈ A or x ∈ B}

A ∩ B, A intersect B (only the elements in common)

A ∩ B = {y | y ∈ A and y ∈ B}

A, complement of A (with respect to some Universe A ⊆ U)

A = {z ‖ z 6∈ A and z ∈ U}

E. Wenderholm Set Theory

Page 46: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsCreating new sets from existing sets

A ∪ B, A union B (all the elements)

A ∪ B = {x | x ∈ A or x ∈ B}

A ∩ B, A intersect B (only the elements in common)

A ∩ B = {y | y ∈ A and y ∈ B}

A, complement of A (with respect to some Universe A ⊆ U)

A = {z ‖ z 6∈ A and z ∈ U}

E. Wenderholm Set Theory

Page 47: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsCreating new sets from existing sets

A ∪ B, A union B (all the elements)

A ∪ B = {x | x ∈ A or x ∈ B}

A ∩ B, A intersect B (only the elements in common)

A ∩ B = {y | y ∈ A and y ∈ B}

A, complement of A (with respect to some Universe A ⊆ U)

A = {z ‖ z 6∈ A and z ∈ U}E. Wenderholm Set Theory

Page 48: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsThe Power Set of a Set

The Power Set of a finite set A consists of all the subsets ofA.

It is denoted as either P(A) or 2A

P(A) = {S | S ⊆ A}Example : B = {a, b, c}P(B) = {∅, {a}, {b}, {c}, {a, b}, {b, c}, {a, c}, B}The empty set and the set itself are always elements of thepower set, and so |P(A)| = 2|A| (A is finite).

E. Wenderholm Set Theory

Page 49: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsThe Power Set of a Set

The Power Set of a finite set A consists of all the subsets ofA.

It is denoted as either P(A) or 2A

P(A) = {S | S ⊆ A}Example : B = {a, b, c}P(B) = {∅, {a}, {b}, {c}, {a, b}, {b, c}, {a, c}, B}The empty set and the set itself are always elements of thepower set, and so |P(A)| = 2|A| (A is finite).

E. Wenderholm Set Theory

Page 50: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsThe Power Set of a Set

The Power Set of a finite set A consists of all the subsets ofA.

It is denoted as either P(A) or 2A

P(A) = {S | S ⊆ A}

Example : B = {a, b, c}P(B) = {∅, {a}, {b}, {c}, {a, b}, {b, c}, {a, c}, B}The empty set and the set itself are always elements of thepower set, and so |P(A)| = 2|A| (A is finite).

E. Wenderholm Set Theory

Page 51: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsThe Power Set of a Set

The Power Set of a finite set A consists of all the subsets ofA.

It is denoted as either P(A) or 2A

P(A) = {S | S ⊆ A}Example : B = {a, b, c}P(B) = {∅, {a}, {b}, {c}, {a, b}, {b, c}, {a, c}, B}

The empty set and the set itself are always elements of thepower set, and so |P(A)| = 2|A| (A is finite).

E. Wenderholm Set Theory

Page 52: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsThe Power Set of a Set

The Power Set of a finite set A consists of all the subsets ofA.

It is denoted as either P(A) or 2A

P(A) = {S | S ⊆ A}Example : B = {a, b, c}P(B) = {∅, {a}, {b}, {c}, {a, b}, {b, c}, {a, c}, B}The empty set and the set itself are always elements of thepower set, and so |P(A)| = 2|A| (A is finite).

E. Wenderholm Set Theory

Page 53: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsCartesian Product of 2 Sets

Cartesian product of two sets, A and B, written as A× B, isthe set of all ordered pairs (a, b), where the first element a isfrom set A, and the second element b is from the set B.

The Cartesian product is also called the cross product.

Question: How would you write this definition using formal setnotation? Answer: A× B = {(a, b) | a ∈ A, b ∈ B}Example: A = {4, 5}, B = {x , y , z}A× B = {(4, x), (4, y), (4, z), (5, x), (5, y), (5, z)}Why do you think it’s called “Cartesian”?

E. Wenderholm Set Theory

Page 54: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsCartesian Product of 2 Sets

Cartesian product of two sets, A and B, written as A× B, isthe set of all ordered pairs (a, b), where the first element a isfrom set A, and the second element b is from the set B.

The Cartesian product is also called the cross product.

Question: How would you write this definition using formal setnotation? Answer: A× B = {(a, b) | a ∈ A, b ∈ B}Example: A = {4, 5}, B = {x , y , z}A× B = {(4, x), (4, y), (4, z), (5, x), (5, y), (5, z)}Why do you think it’s called “Cartesian”?

E. Wenderholm Set Theory

Page 55: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsCartesian Product of 2 Sets

Cartesian product of two sets, A and B, written as A× B, isthe set of all ordered pairs (a, b), where the first element a isfrom set A, and the second element b is from the set B.

The Cartesian product is also called the cross product.

Question: How would you write this definition using formal setnotation?

Answer: A× B = {(a, b) | a ∈ A, b ∈ B}Example: A = {4, 5}, B = {x , y , z}A× B = {(4, x), (4, y), (4, z), (5, x), (5, y), (5, z)}Why do you think it’s called “Cartesian”?

E. Wenderholm Set Theory

Page 56: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set OperationsCartesian Product of 2 Sets

Cartesian product of two sets, A and B, written as A× B, isthe set of all ordered pairs (a, b), where the first element a isfrom set A, and the second element b is from the set B.

The Cartesian product is also called the cross product.

Question: How would you write this definition using formal setnotation? Answer: A× B = {(a, b) | a ∈ A, b ∈ B}Example: A = {4, 5}, B = {x , y , z}A× B = {(4, x), (4, y), (4, z), (5, x), (5, y), (5, z)}Why do you think it’s called “Cartesian”?

E. Wenderholm Set Theory

Page 57: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set PartitionExample

S is a deck (a set) of playing cards.

How many different ways can they be sorted into “piles” (or“bins”)?

Whare are the properties of these bins, regardless of how wesort the cards?

We have a certain number (≥ 1) of bins. The elements ineach bin all share the same common property.

Each bin is a subset of the original deck.

No card can be in more than one bin.

No cards get left out of the sort.

E. Wenderholm Set Theory

Page 58: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set PartitionExample

S is a deck (a set) of playing cards.

How many different ways can they be sorted into “piles” (or“bins”)?

Whare are the properties of these bins, regardless of how wesort the cards?

We have a certain number (≥ 1) of bins. The elements ineach bin all share the same common property.

Each bin is a subset of the original deck.

No card can be in more than one bin.

No cards get left out of the sort.

E. Wenderholm Set Theory

Page 59: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set PartitionExample

S is a deck (a set) of playing cards.

How many different ways can they be sorted into “piles” (or“bins”)?

Whare are the properties of these bins, regardless of how wesort the cards?

We have a certain number (≥ 1) of bins. The elements ineach bin all share the same common property.

Each bin is a subset of the original deck.

No card can be in more than one bin.

No cards get left out of the sort.

E. Wenderholm Set Theory

Page 60: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set PartitionExample

S is a deck (a set) of playing cards.

How many different ways can they be sorted into “piles” (or“bins”)?

Whare are the properties of these bins, regardless of how wesort the cards?

We have a certain number (≥ 1) of bins. The elements ineach bin all share the same common property.

Each bin is a subset of the original deck.

No card can be in more than one bin.

No cards get left out of the sort.

E. Wenderholm Set Theory

Page 61: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set PartitionExample

S is a deck (a set) of playing cards.

How many different ways can they be sorted into “piles” (or“bins”)?

Whare are the properties of these bins, regardless of how wesort the cards?

We have a certain number (≥ 1) of bins. The elements ineach bin all share the same common property.

Each bin is a subset of the original deck.

No card can be in more than one bin.

No cards get left out of the sort.

E. Wenderholm Set Theory

Page 62: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set PartitionExample

S is a deck (a set) of playing cards.

How many different ways can they be sorted into “piles” (or“bins”)?

Whare are the properties of these bins, regardless of how wesort the cards?

We have a certain number (≥ 1) of bins. The elements ineach bin all share the same common property.

Each bin is a subset of the original deck.

No card can be in more than one bin.

No cards get left out of the sort.

E. Wenderholm Set Theory

Page 63: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Set Union, Intersection, ComplementPower SetCartesian ProductPartition of a Set

Set PartitionDefinition

A is a nonempty set. Π(A) is called a partition A1, A2 . . . An of A,provided each of the following is true:

i.) Ai 6= ∅, 1 ≤ i ≤ n (all subsets are nonempty)

ii.) Ai ∩ Aj = ∅, 1 ≤ i 6= j ≤ n (all subsets are disjoint)

iii.)⋃n

i=1 Ai = A (no elements from A are left out)

E. Wenderholm Set Theory

Page 64: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesSequences: just like in programming

A sequence of entities is a list of these entities in some order.

The sequence of numbers 7, 85, 22 is typically written byenclosing the sequence in parentheses: (7, 85, 22)Order matters in a sequence (7, 85, 22) 6= (22, 7, 85)but not in a set!Where have you used parentheses before?

arguments to functionsformal and actual parameters in programming languages

E. Wenderholm Set Theory

Page 65: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesSequences: just like in programming

A sequence of entities is a list of these entities in some order.

The sequence of numbers 7, 85, 22 is typically written byenclosing the sequence in parentheses: (7, 85, 22)

Order matters in a sequence (7, 85, 22) 6= (22, 7, 85)but not in a set!Where have you used parentheses before?

arguments to functionsformal and actual parameters in programming languages

E. Wenderholm Set Theory

Page 66: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesSequences: just like in programming

A sequence of entities is a list of these entities in some order.

The sequence of numbers 7, 85, 22 is typically written byenclosing the sequence in parentheses: (7, 85, 22)Order matters in a sequence (7, 85, 22) 6= (22, 7, 85)but not in a set!

Where have you used parentheses before?

arguments to functionsformal and actual parameters in programming languages

E. Wenderholm Set Theory

Page 67: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesSequences: just like in programming

A sequence of entities is a list of these entities in some order.

The sequence of numbers 7, 85, 22 is typically written byenclosing the sequence in parentheses: (7, 85, 22)Order matters in a sequence (7, 85, 22) 6= (22, 7, 85)but not in a set!Where have you used parentheses before?

arguments to functionsformal and actual parameters in programming languages

E. Wenderholm Set Theory

Page 68: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesTuples: a way to refer to sequences

A sequence may be finite or infinite (just like sets).

A finite sequence is called a tuple.

A finite sequence with k elements is called a k-tuple.

An ordered pair is actually a 2-tuple.

Example: (a, b, c, d) is a 4-tuple.

E. Wenderholm Set Theory

Page 69: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesTuples: a way to refer to sequences

A sequence may be finite or infinite (just like sets).

A finite sequence is called a tuple.

A finite sequence with k elements is called a k-tuple.

An ordered pair is actually a 2-tuple.

Example: (a, b, c, d) is a 4-tuple.

E. Wenderholm Set Theory

Page 70: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesTuples: a way to refer to sequences

A sequence may be finite or infinite (just like sets).

A finite sequence is called a tuple.

A finite sequence with k elements is called a k-tuple.

An ordered pair is actually a 2-tuple.

Example: (a, b, c, d) is a 4-tuple.

E. Wenderholm Set Theory

Page 71: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesTuples: a way to refer to sequences

A sequence may be finite or infinite (just like sets).

A finite sequence is called a tuple.

A finite sequence with k elements is called a k-tuple.

An ordered pair is actually a 2-tuple.

Example: (a, b, c, d) is a 4-tuple.

E. Wenderholm Set Theory

Page 72: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesTuples: a way to refer to sequences

A sequence may be finite or infinite (just like sets).

A finite sequence is called a tuple.

A finite sequence with k elements is called a k-tuple.

An ordered pair is actually a 2-tuple.

Example: (a, b, c, d) is a 4-tuple.

E. Wenderholm Set Theory

Page 73: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesOperations on more than two sets.

Superscripts on set names can simplify the same operation onmany (more than 2) sets.

Use superscript to indicate the “number of times”

Cartesian product:

k times︷ ︸︸ ︷A× A× . . .× A= Ak

Same operation on different sets. Give sets the same nameand add subscripts.

Sets S1, S2, . . . ,Sn

S = S1 ∪ S2 ∪ . . . ∪ Sn is abbreviated as S =⋃n

i=1 Si

Lower limit doesn’t have to be 1, upper limit doesn’t have tobe “n” it can be finite number, say 12, or infinite, ∞.

E. Wenderholm Set Theory

Page 74: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesOperations on more than two sets.

Superscripts on set names can simplify the same operation onmany (more than 2) sets.

Use superscript to indicate the “number of times”

Cartesian product:

k times︷ ︸︸ ︷A× A× . . .× A= Ak

Same operation on different sets. Give sets the same nameand add subscripts.

Sets S1, S2, . . . ,Sn

S = S1 ∪ S2 ∪ . . . ∪ Sn is abbreviated as S =⋃n

i=1 Si

Lower limit doesn’t have to be 1, upper limit doesn’t have tobe “n” it can be finite number, say 12, or infinite, ∞.

E. Wenderholm Set Theory

Page 75: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesOperations on more than two sets.

Superscripts on set names can simplify the same operation onmany (more than 2) sets.

Use superscript to indicate the “number of times”

Cartesian product:

k times︷ ︸︸ ︷A× A× . . .× A= Ak

Same operation on different sets. Give sets the same nameand add subscripts.

Sets S1, S2, . . . ,Sn

S = S1 ∪ S2 ∪ . . . ∪ Sn is abbreviated as S =⋃n

i=1 Si

Lower limit doesn’t have to be 1, upper limit doesn’t have tobe “n” it can be finite number, say 12, or infinite, ∞.

E. Wenderholm Set Theory

Page 76: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Sequences and TuplesOperations on more than two sets.

Superscripts on set names can simplify the same operation onmany (more than 2) sets.

Use superscript to indicate the “number of times”

Cartesian product:

k times︷ ︸︸ ︷A× A× . . .× A= Ak

Same operation on different sets. Give sets the same nameand add subscripts.

Sets S1, S2, . . . ,Sn

S = S1 ∪ S2 ∪ . . . ∪ Sn is abbreviated as S =⋃n

i=1 Si

Lower limit doesn’t have to be 1, upper limit doesn’t have tobe “n” it can be finite number, say 12, or infinite, ∞.

E. Wenderholm Set Theory

Page 77: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

DeMorgan’s LawsIn Set Theory

A and B are sets.

A ∪ B = A ∩ B

A ∩ B = A ∪ B

The same rules apply to programming! ∪ is logical “or”, and∩ is logical “and”.

How we can show this using Venn Diagrams?...

E. Wenderholm Set Theory

Page 78: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

DeMorgan’s LawsIn Set Theory

A and B are sets.

A ∪ B = A ∩ B

A ∩ B = A ∪ B

The same rules apply to programming! ∪ is logical “or”, and∩ is logical “and”.

How we can show this using Venn Diagrams?...

E. Wenderholm Set Theory

Page 79: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

DeMorgan’s LawsIn Set Theory

A and B are sets.

A ∪ B = A ∩ B

A ∩ B = A ∪ B

The same rules apply to programming! ∪ is logical “or”, and∩ is logical “and”.

How we can show this using Venn Diagrams?...

E. Wenderholm Set Theory

Page 80: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

DeMorgan’s LawsIn Set Theory

A and B are sets.

A ∪ B = A ∩ B

A ∩ B = A ∪ B

The same rules apply to programming! ∪ is logical “or”, and∩ is logical “and”.

How we can show this using Venn Diagrams?...

E. Wenderholm Set Theory

Page 81: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 1

{1} = 1 ?

false

| {1, {sam, july}, {{ocean}}} | = ? 3

| {∅} | = ? 1

3 ∈ {1, {3}, {{5}}} ? false

{3} ∈ {1, {3}, {{5}}} true

E. Wenderholm Set Theory

Page 82: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 1

{1} = 1 ? false

| {1, {sam, july}, {{ocean}}} | = ?

3

| {∅} | = ? 1

3 ∈ {1, {3}, {{5}}} ? false

{3} ∈ {1, {3}, {{5}}} true

E. Wenderholm Set Theory

Page 83: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 1

{1} = 1 ? false

| {1, {sam, july}, {{ocean}}} | = ? 3

| {∅} | = ?

1

3 ∈ {1, {3}, {{5}}} ? false

{3} ∈ {1, {3}, {{5}}} true

E. Wenderholm Set Theory

Page 84: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 1

{1} = 1 ? false

| {1, {sam, july}, {{ocean}}} | = ? 3

| {∅} | = ? 1

3 ∈ {1, {3}, {{5}}} ?

false

{3} ∈ {1, {3}, {{5}}} true

E. Wenderholm Set Theory

Page 85: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 1

{1} = 1 ? false

| {1, {sam, july}, {{ocean}}} | = ? 3

| {∅} | = ? 1

3 ∈ {1, {3}, {{5}}} ? false

{3} ∈ {1, {3}, {{5}}}

true

E. Wenderholm Set Theory

Page 86: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 1

{1} = 1 ? false

| {1, {sam, july}, {{ocean}}} | = ? 3

| {∅} | = ? 1

3 ∈ {1, {3}, {{5}}} ? false

{3} ∈ {1, {3}, {{5}}} true

E. Wenderholm Set Theory

Page 87: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 2

What are the elements of S = {i | 5 ≤ i ≤ 20} ?

{5, 6, . . . , 19, 20}S = {a, b} ⊂ {a, b} ? false

b ⊆ {b} ? false

For any set S , ∅ ⊆ S ? true (!!!)

∅ ⊂ P(∅) ? true

P(∅) = ? ...answer...?

E. Wenderholm Set Theory

Page 88: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 2

What are the elements of S = {i | 5 ≤ i ≤ 20} ?{5, 6, . . . , 19, 20}S = {a, b} ⊂ {a, b} ?

false

b ⊆ {b} ? false

For any set S , ∅ ⊆ S ? true (!!!)

∅ ⊂ P(∅) ? true

P(∅) = ? ...answer...?

E. Wenderholm Set Theory

Page 89: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 2

What are the elements of S = {i | 5 ≤ i ≤ 20} ?{5, 6, . . . , 19, 20}S = {a, b} ⊂ {a, b} ? false

b ⊆ {b} ?

false

For any set S , ∅ ⊆ S ? true (!!!)

∅ ⊂ P(∅) ? true

P(∅) = ? ...answer...?

E. Wenderholm Set Theory

Page 90: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 2

What are the elements of S = {i | 5 ≤ i ≤ 20} ?{5, 6, . . . , 19, 20}S = {a, b} ⊂ {a, b} ? false

b ⊆ {b} ? false

For any set S , ∅ ⊆ S ?

true (!!!)

∅ ⊂ P(∅) ? true

P(∅) = ? ...answer...?

E. Wenderholm Set Theory

Page 91: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 2

What are the elements of S = {i | 5 ≤ i ≤ 20} ?{5, 6, . . . , 19, 20}S = {a, b} ⊂ {a, b} ? false

b ⊆ {b} ? false

For any set S , ∅ ⊆ S ? true (!!!)

∅ ⊂ P(∅) ?

true

P(∅) = ? ...answer...?

E. Wenderholm Set Theory

Page 92: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 2

What are the elements of S = {i | 5 ≤ i ≤ 20} ?{5, 6, . . . , 19, 20}S = {a, b} ⊂ {a, b} ? false

b ⊆ {b} ? false

For any set S , ∅ ⊆ S ? true (!!!)

∅ ⊂ P(∅) ? true

P(∅) = ?

...answer...?

E. Wenderholm Set Theory

Page 93: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 2

What are the elements of S = {i | 5 ≤ i ≤ 20} ?{5, 6, . . . , 19, 20}S = {a, b} ⊂ {a, b} ? false

b ⊆ {b} ? false

For any set S , ∅ ⊆ S ? true (!!!)

∅ ⊂ P(∅) ? true

P(∅) = ? ...answer...?

E. Wenderholm Set Theory

Page 94: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 3

Let A = {1, 2} and B = {3, 4}. Does A× B = B × A ?

no

How many sets are operated on?T =

⋃1≤i≤20 Si 20

If we define U =⋃j=20

j=1 Sj , does T = U ? yes

E. Wenderholm Set Theory

Page 95: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 3

Let A = {1, 2} and B = {3, 4}. Does A× B = B × A ? no

How many sets are operated on?T =

⋃1≤i≤20 Si

20

If we define U =⋃j=20

j=1 Sj , does T = U ? yes

E. Wenderholm Set Theory

Page 96: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 3

Let A = {1, 2} and B = {3, 4}. Does A× B = B × A ? no

How many sets are operated on?T =

⋃1≤i≤20 Si 20

If we define U =⋃j=20

j=1 Sj , does T = U ?

yes

E. Wenderholm Set Theory

Page 97: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Your turn.Answer these, Part 3

Let A = {1, 2} and B = {3, 4}. Does A× B = B × A ? no

How many sets are operated on?T =

⋃1≤i≤20 Si 20

If we define U =⋃j=20

j=1 Sj , does T = U ? yes

E. Wenderholm Set Theory

Page 98: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Same Operations, Different Viewpoint

A and B are sets, p and q are propositions, and x and y areboolean variables.

Set Theory Logic Software Hardware

A ∪ B (union) p ∨ q (or) x || y (or) p + q (or)

A ∩ B (intersection) p ∧ q (and) x && y (and) p · q (and)

A (complement) ¬p (not) !x (not) p (not)Note: in h/w, p · q is typically written as pq.Why do we have the same operator names in Logic and Software and(digital) Hardware ?

Because they are equivalent. All are derived from Set Theory. It justdepends on your point of view. Specifically, hardware and software areequivalent. (Embedded) systems engineers decide what to implement inhardware and in software. It’s a design tradeoff.

E. Wenderholm Set Theory

Page 99: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Same Operations, Different Viewpoint

A and B are sets, p and q are propositions, and x and y areboolean variables.

Set Theory Logic Software Hardware

A ∪ B (union) p ∨ q (or) x || y (or) p + q (or)

A ∩ B (intersection) p ∧ q (and) x && y (and) p · q (and)

A (complement) ¬p (not) !x (not) p (not)Note: in h/w, p · q is typically written as pq.Why do we have the same operator names in Logic and Software and(digital) Hardware ?Because they are equivalent. All are derived from Set Theory. It justdepends on your point of view.

Specifically, hardware and software areequivalent. (Embedded) systems engineers decide what to implement inhardware and in software. It’s a design tradeoff.

E. Wenderholm Set Theory

Page 100: Set Theory - Definitions - Oswegowender/Classes/221/Slides/set-theory.pdfDe nition Denotation Operations Special Sets Set Operations that Create New Sets Tuples DeMorgan’s Laws Your

DefinitionDenotationOperations

Special SetsSet Operations that Create New Sets

TuplesDeMorgan’s Laws

Your Turn

Same Operations, Different Viewpoint

A and B are sets, p and q are propositions, and x and y areboolean variables.

Set Theory Logic Software Hardware

A ∪ B (union) p ∨ q (or) x || y (or) p + q (or)

A ∩ B (intersection) p ∧ q (and) x && y (and) p · q (and)

A (complement) ¬p (not) !x (not) p (not)Note: in h/w, p · q is typically written as pq.Why do we have the same operator names in Logic and Software and(digital) Hardware ?Because they are equivalent. All are derived from Set Theory. It justdepends on your point of view. Specifically, hardware and software areequivalent. (Embedded) systems engineers decide what to implement inhardware and in software. It’s a design tradeoff.

E. Wenderholm Set Theory