18
Lecture 6 2.1 Sets 2.2 Set Operations

Lecture 6

  • Upload
    vian

  • View
    32

  • Download
    0

Embed Size (px)

DESCRIPTION

Lecture 6. 2.1 Sets 2.2 Set Operations. Definition of Set and Set Theory. Describing Set Membership. Set Builder Notation. Sets and Set Operations. Definition: A set is any collection of distinct things considered as a whole. A set is an unordered collection of objects. - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture 6

Lecture 6

2.1 Sets 2.2 Set Operations

Page 2: Lecture 6

Definition of Set and Set Theory

Page 3: Lecture 6

Describing Set Membership

Page 4: Lecture 6

Set Builder Notation

Page 5: Lecture 6

Sets and Set Operations

Definition: A set is any collection of distinct things considered as a whole. A set is an unordered collection of objects.

Discuss whether each of the following in a set:

S = {1, 2, 3, 42} V = {x|x is a real number}

T = {1, 1, 2, 3} W = {x|x is not in W}

U = { } Z = {{1,2,3},{2,3,4},{3,4,5}}

P = { { }, { { } }, { { { } } } } Q = {{1,2,3}, {2,3,4},{3,2,1}}

Since the members of a set are in no particular order Q is not a set if its members are sets, but Q is a set if its members are 3-tuples, vectors or some other entity for which membership order is important.

Since f = { } we can rewrite P = { f, {f}, {{f}} } so P is a set containing three elements, namely the empty set, a singleton containing the empty set and a singleton containing a singleton containing the empty set.

Page 6: Lecture 6

If A is a set containing n elements then |A| = n, and is called the cardinality of A.

Given a set S, the power set of S is the set of all subsets of the set S. The power set is S is denoted by P(S).

The ordered n-tuple (a1, a2, . . . , an) is the ordered collection that has a1

as its first element, a2 as its second element . . . and an as its nth element.

Let A and B be sets. The Cartesian product of A and B, denoted by AxB, is the set of all ordered pairs (a,b) where a A and b B. Hence,

AxB = {(a,b)|a A b B}.

Definitions: Set Properties

Page 7: Lecture 6

Cartesian Product

A = { 1,3,5,8 }

B = { 2,4,5 }A

B

1 1,2 1,4 1,5

3 3,2 3,4 3,5

5 5,2 5,4 5,5

8 8,2 8,4 8,5

2 4 5

A = { s, pass, link, stock }

B = { word, port, age, able}

Page 8: Lecture 6

Definition: Venn Diagrams

Page 9: Lecture 6

Set Notation with Quantifiers

02 xRx

12 xZx

For all x, elements of the Reals, x2 is greater than or equal to 0.

There exists an x, element of the Integers, such that x2 equals 1.

1 yxRyRx

For every x, element of the Reals, there exists a y, element of the Reals, such that x times y = 1. (give an exception to show this statement is false)

0 yxZyZx

For every x, element of the Integers, there exists ay, element of the Integers, such that x plus y = 0.

Page 10: Lecture 6

Truth Sets of Quantifiers

Page 11: Lecture 6

Combining Sets

Page 12: Lecture 6

Set Union

Page 13: Lecture 6

Set Intersection

Page 14: Lecture 6

Venn Diagrams

A B

U

A B

U

A B

U

A B

U

A B

U

A B

U

A B

U

A B

U

A B

U

A B

U

A B

U

A B

U

A B U BA

BA BA AB

A B BA BA

BA

Page 15: Lecture 6

Set Identities

ABAAABAA

BABABABA

CBACBACBACBA

ABBAABBA

AA

AAA

AAA

A

UUA

AAAUA

UAAAA

(This is why we had a separate test on first-order logic.)

Page 16: Lecture 6

CABACABACBACBCBA

1 1 1 1 1 1 1 1

1 1 0 1 1 1 0 1

1 0 1 1 1 0 0 1

1 0 0 0 0 0 0 0

0 1 1 1 0 0 0 0

0 1 0 1 0 0 0 0

0 0 1 1 0 0 0 0

0 0 0 0 0 0 0 0

Membership Table

CABACBA Show that

Page 17: Lecture 6

Computer Representation of Sets

Page 18: Lecture 6

))()()()((

))()()()((),,,,,(

fedfedfecedcfdb

ecbecbfeaedacbafedcbaF

An ExampleSatisfiability Set Enumeration

)( cba

0

1

0

)( eda

0

0

1 =

00

01

00

00

10

00

01

11