0% found this document useful (0 votes)
76 views

02 Sets and Logic

This document defines key concepts related to sets including: - A set is a well-defined collection of objects called elements. Sets are denoted with capital letters and elements with lowercase. - Sets must be well-defined, for example specifying a range of numbers or properties of elements. - Set notation is used to indicate membership (element of), non-membership, and describe sets. - Sets can be described by listing elements, properties, or constraints on elements. Order does not matter and duplicates are not allowed. - Important defined sets include natural numbers, integers, rational numbers, and real numbers. - Relationships between sets like subsets, proper subsets, intersections, unions, and complements are defined.

Uploaded by

Alex Bernier
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

02 Sets and Logic

This document defines key concepts related to sets including: - A set is a well-defined collection of objects called elements. Sets are denoted with capital letters and elements with lowercase. - Sets must be well-defined, for example specifying a range of numbers or properties of elements. - Set notation is used to indicate membership (element of), non-membership, and describe sets. - Sets can be described by listing elements, properties, or constraints on elements. Order does not matter and duplicates are not allowed. - Important defined sets include natural numbers, integers, rational numbers, and real numbers. - Relationships between sets like subsets, proper subsets, intersections, unions, and complements are defined.

Uploaded by

Alex Bernier
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 79

Chapter 2 - Sets

Definition
Universal Set
everything you can choose from

Set
Well defined collection of objects from
the universal set
Usually denoted with capital letter (A)

Element
an object within a set
Denoted with lower case letter (x)

Well Defined

The set of positive integers < 25


The set of all smart students in class
The set of odd numbers
The set of odd numbers divisible by
10
The set of letters in the word
superstars
The set of blonde people at App.

Well Defined
The set of positive integers < 25
Well defined

The set of all smart students in class


Not well defined? How could we fix it?

The set of odd numbers divisible by 10


Well defined

The set of letters in the word superstars


Well defined

The set of blonde people at App.


Not well defined. How could we fix this?

Set Notation
xA
read x is an element of A
(x is considered to be a MEMBER of A)

xA
read x is not an element of A

If P is the set of prime numbers


101 P
24 P

Describe a Set
List all element
X={3, 6, 8, 12, 17}

Describe the elements


P={x:x is a prime number}

List enough elements to give an idea


Z={0,1,-1,2,-2,3,-3,} ellipsis means and so
on

Specify multiple constraints


C = {y:y is an integer, 3<y<9}

Describe a Set
P={x:x is a prime number}
read the set of all x where x is a prime
number

C = {y:y is an integer, 3y<9}


read the set of all y where y is an
integer and y is greater than or equal
to 3 and y is less than 9

Properties of Sets
Order is not important
Order does help reader see a pattern

Lists cannot have duplicates


Two sets are equal if they have the
same elements
{2, 3, 4, 2} = {2, 3, 4} = {4, 3, 2, 4, 4}

Write the following sets


{x:x is an odd integer, 5 x 93}
{x:x is a perfect square, x 225
{y:y is a positive integer, y is a
multiple of 3}

Write the following sets


{x:x is an odd integer, 5 x 93}
{5,7,9,11,,91,93}
{x:x is a perfect square, x 225
{0,1,4,9,16,25,,225}
{y:y is a positive integer, y is a multiple of
3}
{3,6,9,12,15,}

P = {x: x is a prime number}


Z = {0,3,-3,5,-5,7,-7,}
C={e: e is an integer -8 y < 5
B={11,13,15,17,19}

List the 7 smallest elements of P


What are the next 4 elements of Z
Describe Z using the property format
Describe B using the property format
Describe C using the list format
Which sets are infinite?

Empty Set or Null Set


An Empty Set has no elements
Shown as {}

or

The set of odd numbers divisible by


10
Numbers greater than 5 and less
than 3
Humans who can run the mile in less
than 2 minutes

Sets can contain other sets


A={{1},{2},{3}}
B={1, {2}, 3, {4} }
C= { 1, 2, {3,4}, {5,6,7}, {{8},{9}}
}

Cardinality
Cardinality is the number of elements in a set
Written with bars on either side | |
A={1,2,3}
|A| = 3

B={1, {2}, 3, {4} }


|B| = 4
C= { 1, 2, {3,4}, {5,6,7}, {{8},{9}} }
|C| = ?

Some Defined Sets

N = {0,1,2,} - Natural (0 is iffy)


N+ = {1, 2, 3, } - Positive Natural
Z = {0,1,-1,2,-2,3,-3,} - Integers
Q = {x: x=a/b, a Z, b Z, b 0 } Rational
R = {x:x is any point on a number
line} - Real

Singleton

Set with cardinality of 1


A= {1}
B={ {1,2} }
C={ Number of people in this room
right now with a first name of Joel }

What about the following


D={}

Subsets
If a second set contains many or all of the
elements of a first set, and contains no
elements that are not in the first set, that
second set is called a subset.
X={1,2,3,5}
Y={2,3}
Y is a subset of X
Written:

YX

X is not a subset of Y, X is a superset of Y


is always a subset of any set

Proper Subsets
Subset

Proper Subset

AB

AB

Proper Subsets
A proper subset has at least one element
missing from it's superset.
A = {1,2,3,4}
{1,2} is a proper subset
{1,2,4} is a proper subset
{1,2,3,4} is not a proper subset

Proper subset symbol

Improper subset symbol

Proper Subsets
Subset
A={1,2,3,5}
B={1,2,3,5}
AB
BA
A = B (Can be equal)
A subset includes the
possibility that all
elements are the
same. Proper subsets
do not.

Proper Subset

X={1,2,3,5}
Y={2,3}
Y X (and Y X)
If Y is a proper subset of X
that means that X contains
elements that Y does not.
X Y (Can never be equal)
The book uses this symbol
for both types of subsets
A Proper subset is also a
subset

Membership vs Subset
A = { 1, 2, 3 }
1 is a element of A, but 1 is not a subset of
A
{1} is a subset of A, but {1} is not an
element of A
{} is a subset of A but is not an element of
A

Power Set

Collection of all possible subsets


Denoted P ()
A = {1, 2, 3}
P (A)= { {}, {1},{2},{3},{1,2},
{1,3}, {2,3}, {1,2,3}}
If the set A has n elements then P (A)
has 2n elements.

Power Set
Set Members

1 2 3
0 0 0

{}

0 0 1

{3}

0 1 0

{2}

No Element

0 1 1 {2,3}
1 0 0

{1}

1 0 1 {1,3}
1 1 0 {1,2}
1 1 1 {1,2,3} All Elements

A = {1, 2, 3}
P (A)= { {}, {1},{2},{3},{1,2}, {1,3},
{2,3}, {1,2,3}}

We can use the definition of subset to more


precisely define set equality. Two sets are
equal if and only if they are each a subset
of the other.
To prove that set A is a subset of set B, you
have two choices.
If set A is very small you can take each of its
elements one at a time and show that that
element is in set B.
If set A is large, show that for any arbitrary
element of A that can be selected, that element
must be in set B. In other words, say something
like "Let x be any element of A" to begin your
proof.

To show that set A is not a subset of


set B, find one element that is in A
and that is not in B.
To show that set A equals set B, show
that A is a subset of B and that B is a
subset of A.

Venn Diagrams
U

U = Universal Set = N
A = {1,2,4}
B = {2, 8, 16}

Venn Diagrams
U
A

U = Universal Set = N
A = {1,2,4}
B = {2, 4}
BA

Venn Diagrams
U
A

U = Universal Set = N
A = {1,2,4}
B = {1,2,4}
BA

Venn Diagrams
U
A

U
B

U = Universal Set = N
A = {1,2,4}
B = {1,2,4}
BA
AB

Venn Diagrams
U
A

U = Universal Set = N
A = {1,2,4,9}
B = {2,4,6}
C = {1, 2, 5, 9)

Venn Diagrams
U

U = Universal Set = N
A = {1,2,4,9}
B = {2,4,6}
C = {1, 2, 5, 9}
D= { 1, 6, 7, 10}
Where does 6 go?

Venn Diagram Problems

U = Universal Set = {1,2,3,,15}


A = {2,4,6,8,10}
B = {5,10,15}
C = {3,5,7,11}
Draw the Venn diagram

Venn Diagram Problems


U

2 4 6 8

1 9 12 13 14

A
10
B
15

C
3 7 11

U = Universal Set = {1,2,3,,15}


A = {2,4,6,8,10}
B = {5,10,15}
C = {3,5,7,11}

Intersection Union
Complement
A B Intersection common to both
A B {x:xA, x B}

A B Union In either or both


A B {x:xA or x B}

A Complement Not in A
A = {x:xU, xA}

Intersection Union
Complement
A B Intersection common to both
A B Union In either or both
A Complement Not in A
U={1,2,3,,10} A={1,3,7,8,9} B={2,3,6,7,10}
C={1,5,6,8}
A B
A C
B
A C
A B

={
={
={
={
={

}
}
}
}
}

Construct Venn Diagrams


U={1,2,3,,10} A={1,3,7,8,9}
B={2,3,6,7,10} C={1,5,6,8}
AB
A B
B
(A B)
A B

Properties

S1.
S2.
S3.
S4.
S5.
S6.
S7.
S8.
S9.

(A B) C = A (B C) (Associative Unions)
(A B) C = A (B C) (Associative Intersections)
A B = B A (Commutative Unions)
A B = B A (Commutative Intersections)
(A) = A
A (B C) = (A B)(A C) (Distributive)
A (B C) = (A B) (A C) (Distributive)
(A B) = A B (De Morgan)
(A B) = A B (De Morgan)

More Properties
A
A
A
A
A
A
A
A

=A
=
U=A
A=A
A=A
U=U
B iff A B = B
B iff A B = B

= U
U =
A A =
A A = U

U A
2
1

3
6

5
8

Verify S1. (A B) C = A (B
C)

7
C

Regions for (A B) C

A regions 2, 3, 5, 6
B regions 2, 4, 5, 7
(A B) regions 2, 3,
4, 5, 6, 7
C regions 5, 6, 7, 8
(A B) C regions
2, 3, 4, 5, 6, 7, 8

Regions for A (B C)

B regions 2, 4, 5, 7
C regions 5, 6, 7, 8
(B C) regions
2,4,5,7,8
A regions 2, 3, 5, 6
A (B C) regions
2, 3, 4, 5, 6, 7, 8

Verify S2
S2. (A B) C = A (B C)

Difference
A B is the set of element that are in
A, but are not in B
A B = {x: x A, x B}
A = {1,2,5,8}
B = {3,5,8,9}
A-B = {1, 2}

Symmetric Difference
A B (or A B)
All elements in A plus all Elements in
B minus the elements in both.
A B = (A B) (A B )
A B = (A B) (A B )
A B = {x: x A or x B, x (A
B )}

Principle of
inclusion/exclusion
Two sets
|A B| = |A| + |B| - |A B|
Three sets
|A B C| =
|A| + |B| + |C| - |A B| - |A C| - |B C| + |A B
C|

Word Problems
A survey of 78 students is conducted.
Of that number, 54 students own
either a cat or a dog (or both). 46
students own a dog and 26 students
own a cat. How many students own
both a dog and a cat? How many dog
owners do not own a cat? How many
cat owners do not own a dog? How
many students own only one kind of
pet?

Word Problem
|D| = 46
|C| = 26
|C D| = 54
|C D| = |C| + |D| - |C D|
54 = 26 + 46 - |C D|
|C D| = 26 + 46 - 54 = 18 Own Cat
and Dog

Chapter 2 - Logic

Logic
Read Sections 2.5 through 2.7 of your textbook
Logic deals with the concepts of true and false
Statement declarative sentence that is true
or false and may correspond to a mathematical
statement
Variables used to represent statements
Logical Operators - modify and/or connect
statements and variables
Truth Table A visual means of showing all
possible combinations for a statement.

The Conjunction Operator


Conjunction
p
represented by
T
read as and
T
p q read as p and q
F
means p and q are both trueF
truth table

p q

Conjunction Example
I have a piece of chalk in my hand AND I
have an eraser in my hand.
If both phrases are true the whole statement is
true.
If either phrase is false the whole statement is
false.
p
q
p
q
What if both phrases are false?
T
T
T
p = I have a piece of
T
F
F
chalk in my hand
F
T
F
q = I have an eraser
F
F
F
in my hand

The Disjunction Operator


Disjunction

p
q

T
T
T
represented by
T
F
T
read as or
F
T
T
F
F
p q read as p or q F
means either p or q (or both) is true
truth table

Disjunction Example
I have a piece of chalk in my hand OR I have
an eraser in my hand.
If either phrase is true the whole statement is
true.
Both phrases must be false for the whole
statement to be considered false. p q p q
T
T
T
What if both phrases are true?
T
F
T
p = I have a piece of
F
T
T
chalk in my hand
F
F
F
q = I have an eraser
in my hand

The Negation Operator


Negation
represented by ~ or
read as not
p read as not p
means true if p is false
truth table

Negation Example
The sun is not cold. (True or False?)
p = The sun is cold. (False)
~p = The sun is not cold. (True)
Water is not wet. (True or False?)
p = Water is wet. (True)
~p = Water is not wet. (False)

The Implication Operator


Implication
represented by "->"
read as "implies" or "if then"
p -> q read as "p implies q"
p
or "if p then q"
T
p = hypothesis
T
F
q = conclusion
F
truth table

p q

The Implication Operator 2


Implication
p
q
q
p
if

is sufficient for q
is necessary for p
if p
only if q
not q then not p

pq

Implication Example
If I was a professor then I could give lots of
quizzes.
If I was a professor then I would be able to
p q
p
fly.
q
If I was magic then I could eat cake.
T T
T
T F
F
If I was magic then I could disappear.
F

Operators
If p is true q must be true for the
implication to be true.
If p is false can't really tell what the
outcome would be. If you start with a
false assumption, you can prove anything.
p

p
q

The Biconditional Operator


Biconditional
represented by <->
read as if and only if
p <-> q read as p is true if and only if
q is true
p
q
pq
truth table
T

Biconditional Examples
Biconditional
I sleep if and only if I am tired
means
if I am asleep then I am tired
AND if I am tired the I am asleep.

also
If I am NOT sleeping, then I am NOT
tired.
If I am NOT tired, then I am NOT
sleeping.

p
q

Implication and
Biconditional
If it is raining, then I am indoors.
I may still be indoors even if it is not
raining

I am indoors if and only if it is


raining.
The only way I am indoors is if it is
raining.

Order of Operation
Operations are executed in the
following order
Negation
Conjunction
Disjunction
Implication
Biconditional

Compound Statements
Connecting variables together with
operators create compound
statements
pq
pq
(p q ) r

Creating Truth Tables


You will have 2n rows where n is the
number of variables in the
statement.
(p q ) r
Three variables so n=3
rows = 2n = 23 = 8

Creating Truth Tables


Add columns for each variable (3)
Add rows as calculated (8)
Fill in true/false values as shown in text on Figure 2.8
p

Creating Truth Tables


Order of operation
Parenthesis first
Negation before Conjunction
Conjunction before Disjunction
Disjunction before Implication or Bidirectional
(p q ) r
The order of operations is
p q first because of parenthesis
negation next (r)
(p q ) (r) finally the conjunction

List these in order on your truth table

Creating Truth Tables


(p q ) (r)
p

pq

(p q ) (r)

Creating Truth Tables


(p q ) (r)
Fill in each column by looking at other columns and applying
operators.
r is the opposite of what is in r
p

pq

(p q ) (r)

Creating Truth Tables


(p q ) (r)
Fill in each column by looking at other columns and applying
operators.
p q is true when either p or q is true (or both)
p

pq

(p q ) (r)

Creating Truth Tables


(p q ) (r)
The last column is an AND of the two previous columns
AND says both must be true for the result to be true
p

pq

(p q ) (r)

Construct the Truth Table


p q
(p ^ q)
p q is logically equivalent to
(p ^ q) because they have the
same result column in the truth table
Written:
p q (p ^ q)

De Morgan's Laws and Negation


You can use De Morgan's Law to say the same thing in a
different way
De Morgan
( p q ) p q
( p q ) p q

A phrase with a negation can be rewritten using De


Morgan
I do not speak either Spanish or German (negation)
I do not speak Spanish and I do not speak German (demorgan)
I do not drink and drive
I do not drink or I do not drive

Tautology
Always true
Construct truth table
If all true results in right hand column, tautology

(pq)(pq)
p p
p p
pp
(p q) (p q)

Contradiction
Always false
Construct truth table
If all false results in right hand column,
contradiction

p (p q)
p p
p p
( p p)

Contrapositive Converse
Inverse

statement: if p then q
contrapositive: if not q then not p
converse: if q then p
inverse: if not p then not q

If a statement is true, the contrapositive is


also true.
If the converse is true, the inverse is also true
because the inverse is the contrapositive of
the converse.

Contrapositive Converse
Inverse
If Appalachian won, then the students
are happy (Sentence)
If the students are happy, then
Appalachian won (converse)
If the students are not happy, then
Appalachian did not win
(contrapositive)
If Appalachian did not win, then the
students are not happy (inverse)

Contrapositive Converse
Inverse
Assume the top sentence is true, do the
rest have to be true?
If Appalachian won, then the students are
happy (Sentence)
If the students are happy, then
Appalachian won (converse)
If the students are not happy, then
Appalachian did not win (contrapositive)
If Appalachian did not win, then the
students are not happy (inverse)

Contrapositive Converse
Inverse
Assume the top sentence is true, do
the rest have to be true?
If Appalachian won, then the students
are happy (Sentence)
If the students are not happy, then
Appalachian did not win (contrapositive)
Yes. A win would have moved the
students into the happy state, if they are
not in that state they did not win.

Contrapositive Converse
Inverse
Assume the top sentence is true, do the
rest have to be true?
If Appalachian won, then the students are
happy (Sentence)
If the students are happy, then
Appalachian won (converse)
No. The students could have been moved to
a happy state because of some other reason.
Just because the students are happy DOES
NOT mean that Appalachian won.

Contrapositive Converse
Inverse
Assume the top sentence is true, do
the rest have to be true?
If Appalachian won, then the students
are happy (Sentence)
If Appalachian did not win, then the
students are not happy (inverse)
No. The top sentence said a win makes
the students happy. It DID NOT say a loss
makes them unhappy.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy