Let’s get started with...
Logic!
Fall
2002
CMSC
203
-
Discrete
Structures
1
LOGIC
Let’s get started with...
LOGIC
Fall
2002
CMSC
203
-
Discrete
Structures
2
Logic
• Crucial for mathematical reasoning
• Used for designing electronic circuitry
• Logic is a system based on propositions.
• A proposition is a statement that is either
true or false (not both).
• We say that the truth value of a
proposition is either true (T) or false (F).
• Corresponds to 1 and 0 in digital circuits
Fall
2002
CMSC
203
-
Discrete
Structures
3
The Statement/Proposition Game
“Elephants are bigger than mice.”
Fall
2002
CMSC
203
-
Discrete
Structures
4
Is this a statement? yes
Is this a proposition? yes
What is the truth value
of the proposition? true
The Statement/Proposition Game
“520 < 111”
Fall
2002
CMSC
203
-
Discrete
Structures
5
Is this a statement? yes
Is this a proposition? yes
What is the truth value
of the proposition? false
The Statement/Proposition Game
“y > 5”
Fall
2002
CMSC
203
-
Discrete
Structures
6
Is this a statement? yes
Is this a proposition? no
Its truth value depends on the value of y, but
this value is not specified.
We call this type of statement a propositional
function or open sentence.
The Statement/Proposition Game
“Today is January 1 and 99 < 5.”
Fall
2002
CMSC
203
-
Discrete
Structures
7
Is this a statement? yes
Is this a proposition? yes
What is the truth value
of the proposition? false
The Statement/Proposition Game
“Please do not fall asleep.”
Fall
2002
CMSC
203
-
Discrete
Structures
8
Is this a statement? no
Is this a proposition? no
Only statements can be propositions.
It’s a request.
The Statement/Proposition Game
“If elephants were red, they could hide
in cherry trees.”
Fall
2002
CMSC
203
-
Discrete
Structures
9
Is this a statement? yes
Is this a proposition? yes
What is the truth value
of the proposition? probably false
The Statement/Proposition Game
“x < y if and only if y > x.”
Fall
2002
CMSC
203
-
Discrete
Structures
10
Is this a statement? yes
Is this a proposition? yes
What is the truth value
of the proposition? true
… because its truth value
does not depend on
specific values of x and y.
Combining Propositions
As we have seen in the previous
examples, one or more propositions can
be combined to form a single compound
proposition.
We formalize this by denoting propositions
with letters such as p, q, r, s, and
introducing several logical operators.
Fall
2002
CMSC
203
-
Discrete
Structures
11
Logical Operators (Connectives)
We will examine the following logical operators:
• Negation (NOT)
• Conjunction (AND)
• Disjunction (OR)
• Exclusive or (XOR)
• Implication (if – then)
• Biconditional (if and only if)
Truth tables can be used to show how these operators
can combine propositions to compound propositions.
Fall
2002
CMSC
203
-
Discrete
Structures
12
Negation (NOT)
Unary Operator, Symbol: 
Fall
2002
CMSC
203
-
Discrete
Structures
13
P P
true (T) false (F)
false (F) true (T)
Conjunction (AND)
Binary Operator, Symbol: 
Fall
2002
CMSC
203
-
Discrete
Structures
14
P Q PQ
T T T
T F F
F T F
F F F
Disjunction (OR)
Binary Operator, Symbol: 
Fall
2002
CMSC
203
-
Discrete
Structures
15
P Q PQ
T T T
T F T
F T T
F F F
Exclusive Or (XOR)
Binary Operator, Symbol: 
Fall
2002
CMSC
203
-
Discrete
Structures
16
P Q PQ
T T F
T F T
F T T
F F F
Implication (if - then)
Binary Operator, Symbol: 
Fall
2002
CMSC
203
-
Discrete
Structures
17
P Q PQ
T T T
T F F
F T T
F F T
Biconditional (if and only if)
Binary Operator, Symbol: 
Fall
2002
CMSC
203
-
Discrete
Structures
18
P Q PQ
T T T
T F F
F T F
F F T
Statements and Operators
 Statements and operators can be combined in any
way to form new statements.
Fall
2002
CMSC
203
-
Discrete
Structures
19
P Q P Q (P)(Q)
T T F F F
T F F T T
F T T F T
F F T T T
Statements and Operations
 Statements and operators can be combined in
any way to form new statements.
Fall
2002
CMSC
203
-
Discrete
Structures
20
P Q PQ  (PQ) (P)(Q)
T T T F F
T F F T T
F T F T T
F F F T T
Equivalent Statements
 The statements (PQ) and (P)  (Q) are
logically equivalent, since (PQ)  (P)  (Q) is
always true.
Fall
2002
CMSC
203
-
Discrete
Structures
21
P Q
(PQ
)
(P)(
Q)
(PQ)(P)(Q
)
T T F F T
T F T T T
F T T T T
F F T T T
Tautologies and Contradictions
A tautology is a statement that is always true.
Examples:
• R(R)
• (PQ)(P)(Q)
If ST is a tautology, we write ST.
If ST is a tautology, we write ST.
Fall
2002
CMSC
203
-
Discrete
Structures
22
Tautologies and Contradictions
A contradiction is a statement that is always
false.
Examples:
• R(R)
• ((PQ)(P)(Q))
The negation of any tautology is a contra-
diction, and the negation of any contradiction is
a tautology.
Fall
2002
CMSC
203
-
Discrete
Structures
23
Exercises
We already know the following tautology:
(PQ)  (P)(Q)
Nice home exercise:
Show that (PQ)  (P)(Q).
These two tautologies are known as De Morgan’s laws.
Table 5 in Section 1.2 shows many useful laws.
Exercises 1 and 7 in Section 1.2 may help you get used to
propositions and operators.
Fall
2002
CMSC
203
-
Discrete
Structures
24
Let’s Talk About Logic
• Logic is a system based on propositions.
• A proposition is a statement that is either true
or false (not both).
• We say that the truth value of a proposition is
either true (T) or false (F).
• Corresponds to 1 and 0 in digital circuits
Fall
2002
CMSC
203
-
Discrete
Structures
25
Logical Operators (Connectives)
• Negation (NOT)
• Conjunction (AND)
• Disjunction (OR)
• Exclusive or (XOR)
• Implication (if – then)
• Biconditional (if and only if)
Truth tables can be used to show how these
operators can combine propositions to compound
propositions.
Fall
2002
CMSC
203
-
Discrete
Structures
26
Tautologies and Contradictions
A tautology is a statement that is always true.
Examples:
• R(R)
• (PQ)(P)(Q)
If ST is a tautology, we write ST.
If ST is a tautology, we write ST.
Fall
2002
CMSC
203
-
Discrete
Structures
27
Tautologies and Contradictions
A contradiction is a statement that is always
false.
Examples:
• R(R)
• ((PQ)(P)(Q))
The negation of any tautology is a contradiction, and
the negation of any contradiction is a tautology.
Fall
2002
CMSC
203
-
Discrete
Structures
28
Propositional Functions
Propositional function (open sentence):
statement involving one or more variables,
e.g.: x-3 > 5.
Let us call this propositional function P(x), where P is
the predicate and x is the variable.
Fall
2002
CMSC
203
-
Discrete
Structures
29
What is the truth value of P(2) ? false
What is the truth value of P(8) ?
What is the truth value of P(9) ?
false
true
Propositional Functions
Let us consider the propositional function
Q(x, y, z) defined as:
x + y = z.
Here, Q is the predicate and x, y, and z are the
variables.
Fall
2002
CMSC
203
-
Discrete
Structures
30
What is the truth value of Q(2, 3,
5) ?
true
What is the truth value of Q(0, 1, 2) ?
What is the truth value of Q(9, -9, 0) ?
false
true
Universal Quantification
Let P(x) be a propositional function.
Universally quantified sentence:
For all x in the universe of discourse P(x) is true.
Using the universal quantifier :
x P(x) “for all x P(x)” or “for every x P(x)”
(Note: x P(x) is either true or false, so it is a proposition,
not a propositional function.)
Fall
2002
CMSC
203
-
Discrete
Structures
31
Universal Quantification
Example:
S(x): x is a UMBC student.
G(x): x is a genius.
What does x (S(x)  G(x)) mean ?
“If x is a UMBC student, then x is a genius.”
or
“All UMBC students are geniuses.”
Fall
2002
CMSC
203
-
Discrete
Structures
32
Existential Quantification
Existentially quantified sentence:
There exists an x in the universe of discourse for which
P(x) is true.
Using the existential quantifier :
x P(x) “There is an x such that P(x).”
 “There is at least one x such that P(x).”
(Note: x P(x) is either true or false, so it is a proposition,
but no propositional function.)
Fall
2002
CMSC
203
-
Discrete
Structures
33
Example:
P(x): x is a UMBC professor.
G(x): x is a genius.
What does x (P(x)  G(x)) mean ?
“There is an x such that x is a UMBC professor and x is a
genius.”
or
“At least one UMBC professor is a genius.”
Fall
2002
CMSC
203
-
Discrete
Structures
34
Existential Quantification
Quantification
Another example:
Let the universe of discourse be the real numbers.
What does xy (x + y = 320) mean ?
“For every x there exists a y so that x + y = 320.”
Fall
2002
CMSC
203
-
Discrete
Structures
35
Is it true?
Is it true for the natural numbers?
yes
no
Disproof by Counterexample
A counterexample to x P(x) is an object c so that
P(c) is false.
Statements such as x (P(x)  Q(x)) can be
disproved by simply providing a counterexample.
Fall
2002
CMSC
203
-
Discrete
Structures
36
Statement: “All birds can fly.”
Disproved by counterexample: Penguin.
Negation
(x P(x)) is logically equivalent to x
(P(x)).
(x P(x)) is logically equivalent to x
(P(x)).
Fall
2002
CMSC
203
-
Discrete
Structures
37
… and now for something
completely different…
Set Theory
Fall
2002
CMSC
203
-
Discrete
Structures
38
Actually, you will see that logic and
set theory are very closely related.
Set Theory
• Set: Collection of objects (“elements”)
• aA “a is an element of A”
“a is a member of A”
• aA “a is not an element of A”
• A = {a1, a2, …, an} “A contains…”
• Order of elements is meaningless
• It does not matter how often the same element is
listed.
Fall
2002
CMSC
203
-
Discrete
Structures
39
Set Equality
Sets A and B are equal if and only if they
contain exactly the same elements.
Examples:
Fall
2002
CMSC
203
-
Discrete
Structures
40
• A = {9, 2, 7, -3}, B = {7, 9, -3, 2} : A = B
• A = {dog, cat, horse},
B = {cat, horse, squirrel, dog} : A B

• A = {dog, cat, horse},
B = {cat, horse, dog, dog} : A = B
Examples for Sets
 “Standard” Sets:
• Natural numbers N = {0, 1, 2, 3, …}
• Integers Z = {…, -2, -1, 0, 1, 2, …}
• Positive Integers Z+
= {1, 2, 3, 4, …}
• Real Numbers R = {47.3, -12, , …}
• Rational Numbers Q = {1.5, 2.6, -3.8, 15, …}
(correct definition will follow)
Fall
2002
CMSC
203
-
Discrete
Structures
41
Examples for Sets
• A =  “empty set/null set”
• A = {z} Note: zA, but z  {z}
• A = {{b, c}, {c, x, d}}
• A = {{x, y}}
Note: {x, y} A, but {x, y}  {{x, y}}
• A = {x | P(x)}
“set of all x such that P(x)”
• A = {x | xN  x > 7} = {8, 9, 10, …}
“set builder notation”
Fall
2002
CMSC
203
-
Discrete
Structures
42
Examples for Sets
We are now able to define the set of rational
numbers Q:
Q = {a/b | aZ  bZ+
}
or
Q = {a/b | aZ  bZ  b0}
And how about the set of real numbers R?
R = {r | r is a real number}
That is the best we can do.
Fall
2002
CMSC
203
-
Discrete
Structures
43
Subsets
A  B “A is a subset of B”
A  B if and only if every element of A is also
an element of B.
We can completely formalize this:
A  B  x (xA  xB)
Examples:
Fall
2002
CMSC
203
-
Discrete
Structures
44
A = {3, 9}, B = {5, 9, 1, 3}, A  B ? true
A = {3, 3, 3, 9}, B = {5, 9, 1, 3}, A  B ?
false
true
A = {1, 2, 3}, B = {2, 3, 4}, A  B ?
Subsets
Useful rules:
• A = B  (A  B)  (B  A)
• (A  B)  (B  C)  A  C (see Venn Diagram)
Fall
2002
CMSC
203
-
Discrete
Structures
45
U
A
B
C
Useful rules:
•   A for any set A
• A  A for any set A
Proper subsets:
A  B “A is a proper subset of B”
A  B  x (xA  xB)  x (xB  xA)
or
A  B  x (xA  xB)  x (xB  xA)
Fall
2002
CMSC
203
-
Discrete
Structures
46
Cardinality of Sets
If a set S contains n distinct elements, nN,
we call S a finite set with cardinality n.
Examples:
A = {Mercedes, BMW, Porsche}, |A| = 3
Fall
2002
CMSC
203
-
Discrete
Structures
47
B = {1, {2, 3}, {4, 5}, 6} |B| = 4
C =  |C| = 0
D = { xN | x 7000 }
 |D| = 7001
E = { xN | x 7000 }

E is infinite!

Let’s get started with with discrete math.pptx

  • 1.
    Let’s get startedwith... Logic! Fall 2002 CMSC 203 - Discrete Structures 1
  • 2.
    LOGIC Let’s get startedwith... LOGIC Fall 2002 CMSC 203 - Discrete Structures 2
  • 3.
    Logic • Crucial formathematical reasoning • Used for designing electronic circuitry • Logic is a system based on propositions. • A proposition is a statement that is either true or false (not both). • We say that the truth value of a proposition is either true (T) or false (F). • Corresponds to 1 and 0 in digital circuits Fall 2002 CMSC 203 - Discrete Structures 3
  • 4.
    The Statement/Proposition Game “Elephantsare bigger than mice.” Fall 2002 CMSC 203 - Discrete Structures 4 Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? true
  • 5.
    The Statement/Proposition Game “520< 111” Fall 2002 CMSC 203 - Discrete Structures 5 Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? false
  • 6.
    The Statement/Proposition Game “y> 5” Fall 2002 CMSC 203 - Discrete Structures 6 Is this a statement? yes Is this a proposition? no Its truth value depends on the value of y, but this value is not specified. We call this type of statement a propositional function or open sentence.
  • 7.
    The Statement/Proposition Game “Todayis January 1 and 99 < 5.” Fall 2002 CMSC 203 - Discrete Structures 7 Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? false
  • 8.
    The Statement/Proposition Game “Pleasedo not fall asleep.” Fall 2002 CMSC 203 - Discrete Structures 8 Is this a statement? no Is this a proposition? no Only statements can be propositions. It’s a request.
  • 9.
    The Statement/Proposition Game “Ifelephants were red, they could hide in cherry trees.” Fall 2002 CMSC 203 - Discrete Structures 9 Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? probably false
  • 10.
    The Statement/Proposition Game “x< y if and only if y > x.” Fall 2002 CMSC 203 - Discrete Structures 10 Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? true … because its truth value does not depend on specific values of x and y.
  • 11.
    Combining Propositions As wehave seen in the previous examples, one or more propositions can be combined to form a single compound proposition. We formalize this by denoting propositions with letters such as p, q, r, s, and introducing several logical operators. Fall 2002 CMSC 203 - Discrete Structures 11
  • 12.
    Logical Operators (Connectives) Wewill examine the following logical operators: • Negation (NOT) • Conjunction (AND) • Disjunction (OR) • Exclusive or (XOR) • Implication (if – then) • Biconditional (if and only if) Truth tables can be used to show how these operators can combine propositions to compound propositions. Fall 2002 CMSC 203 - Discrete Structures 12
  • 13.
    Negation (NOT) Unary Operator,Symbol:  Fall 2002 CMSC 203 - Discrete Structures 13 P P true (T) false (F) false (F) true (T)
  • 14.
    Conjunction (AND) Binary Operator,Symbol:  Fall 2002 CMSC 203 - Discrete Structures 14 P Q PQ T T T T F F F T F F F F
  • 15.
    Disjunction (OR) Binary Operator,Symbol:  Fall 2002 CMSC 203 - Discrete Structures 15 P Q PQ T T T T F T F T T F F F
  • 16.
    Exclusive Or (XOR) BinaryOperator, Symbol:  Fall 2002 CMSC 203 - Discrete Structures 16 P Q PQ T T F T F T F T T F F F
  • 17.
    Implication (if -then) Binary Operator, Symbol:  Fall 2002 CMSC 203 - Discrete Structures 17 P Q PQ T T T T F F F T T F F T
  • 18.
    Biconditional (if andonly if) Binary Operator, Symbol:  Fall 2002 CMSC 203 - Discrete Structures 18 P Q PQ T T T T F F F T F F F T
  • 19.
    Statements and Operators Statements and operators can be combined in any way to form new statements. Fall 2002 CMSC 203 - Discrete Structures 19 P Q P Q (P)(Q) T T F F F T F F T T F T T F T F F T T T
  • 20.
    Statements and Operations Statements and operators can be combined in any way to form new statements. Fall 2002 CMSC 203 - Discrete Structures 20 P Q PQ  (PQ) (P)(Q) T T T F F T F F T T F T F T T F F F T T
  • 21.
    Equivalent Statements  Thestatements (PQ) and (P)  (Q) are logically equivalent, since (PQ)  (P)  (Q) is always true. Fall 2002 CMSC 203 - Discrete Structures 21 P Q (PQ ) (P)( Q) (PQ)(P)(Q ) T T F F T T F T T T F T T T T F F T T T
  • 22.
    Tautologies and Contradictions Atautology is a statement that is always true. Examples: • R(R) • (PQ)(P)(Q) If ST is a tautology, we write ST. If ST is a tautology, we write ST. Fall 2002 CMSC 203 - Discrete Structures 22
  • 23.
    Tautologies and Contradictions Acontradiction is a statement that is always false. Examples: • R(R) • ((PQ)(P)(Q)) The negation of any tautology is a contra- diction, and the negation of any contradiction is a tautology. Fall 2002 CMSC 203 - Discrete Structures 23
  • 24.
    Exercises We already knowthe following tautology: (PQ)  (P)(Q) Nice home exercise: Show that (PQ)  (P)(Q). These two tautologies are known as De Morgan’s laws. Table 5 in Section 1.2 shows many useful laws. Exercises 1 and 7 in Section 1.2 may help you get used to propositions and operators. Fall 2002 CMSC 203 - Discrete Structures 24
  • 25.
    Let’s Talk AboutLogic • Logic is a system based on propositions. • A proposition is a statement that is either true or false (not both). • We say that the truth value of a proposition is either true (T) or false (F). • Corresponds to 1 and 0 in digital circuits Fall 2002 CMSC 203 - Discrete Structures 25
  • 26.
    Logical Operators (Connectives) •Negation (NOT) • Conjunction (AND) • Disjunction (OR) • Exclusive or (XOR) • Implication (if – then) • Biconditional (if and only if) Truth tables can be used to show how these operators can combine propositions to compound propositions. Fall 2002 CMSC 203 - Discrete Structures 26
  • 27.
    Tautologies and Contradictions Atautology is a statement that is always true. Examples: • R(R) • (PQ)(P)(Q) If ST is a tautology, we write ST. If ST is a tautology, we write ST. Fall 2002 CMSC 203 - Discrete Structures 27
  • 28.
    Tautologies and Contradictions Acontradiction is a statement that is always false. Examples: • R(R) • ((PQ)(P)(Q)) The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology. Fall 2002 CMSC 203 - Discrete Structures 28
  • 29.
    Propositional Functions Propositional function(open sentence): statement involving one or more variables, e.g.: x-3 > 5. Let us call this propositional function P(x), where P is the predicate and x is the variable. Fall 2002 CMSC 203 - Discrete Structures 29 What is the truth value of P(2) ? false What is the truth value of P(8) ? What is the truth value of P(9) ? false true
  • 30.
    Propositional Functions Let usconsider the propositional function Q(x, y, z) defined as: x + y = z. Here, Q is the predicate and x, y, and z are the variables. Fall 2002 CMSC 203 - Discrete Structures 30 What is the truth value of Q(2, 3, 5) ? true What is the truth value of Q(0, 1, 2) ? What is the truth value of Q(9, -9, 0) ? false true
  • 31.
    Universal Quantification Let P(x)be a propositional function. Universally quantified sentence: For all x in the universe of discourse P(x) is true. Using the universal quantifier : x P(x) “for all x P(x)” or “for every x P(x)” (Note: x P(x) is either true or false, so it is a proposition, not a propositional function.) Fall 2002 CMSC 203 - Discrete Structures 31
  • 32.
    Universal Quantification Example: S(x): xis a UMBC student. G(x): x is a genius. What does x (S(x)  G(x)) mean ? “If x is a UMBC student, then x is a genius.” or “All UMBC students are geniuses.” Fall 2002 CMSC 203 - Discrete Structures 32
  • 33.
    Existential Quantification Existentially quantifiedsentence: There exists an x in the universe of discourse for which P(x) is true. Using the existential quantifier : x P(x) “There is an x such that P(x).”  “There is at least one x such that P(x).” (Note: x P(x) is either true or false, so it is a proposition, but no propositional function.) Fall 2002 CMSC 203 - Discrete Structures 33
  • 34.
    Example: P(x): x isa UMBC professor. G(x): x is a genius. What does x (P(x)  G(x)) mean ? “There is an x such that x is a UMBC professor and x is a genius.” or “At least one UMBC professor is a genius.” Fall 2002 CMSC 203 - Discrete Structures 34 Existential Quantification
  • 35.
    Quantification Another example: Let theuniverse of discourse be the real numbers. What does xy (x + y = 320) mean ? “For every x there exists a y so that x + y = 320.” Fall 2002 CMSC 203 - Discrete Structures 35 Is it true? Is it true for the natural numbers? yes no
  • 36.
    Disproof by Counterexample Acounterexample to x P(x) is an object c so that P(c) is false. Statements such as x (P(x)  Q(x)) can be disproved by simply providing a counterexample. Fall 2002 CMSC 203 - Discrete Structures 36 Statement: “All birds can fly.” Disproved by counterexample: Penguin.
  • 37.
    Negation (x P(x)) islogically equivalent to x (P(x)). (x P(x)) is logically equivalent to x (P(x)). Fall 2002 CMSC 203 - Discrete Structures 37
  • 38.
    … and nowfor something completely different… Set Theory Fall 2002 CMSC 203 - Discrete Structures 38 Actually, you will see that logic and set theory are very closely related.
  • 39.
    Set Theory • Set:Collection of objects (“elements”) • aA “a is an element of A” “a is a member of A” • aA “a is not an element of A” • A = {a1, a2, …, an} “A contains…” • Order of elements is meaningless • It does not matter how often the same element is listed. Fall 2002 CMSC 203 - Discrete Structures 39
  • 40.
    Set Equality Sets Aand B are equal if and only if they contain exactly the same elements. Examples: Fall 2002 CMSC 203 - Discrete Structures 40 • A = {9, 2, 7, -3}, B = {7, 9, -3, 2} : A = B • A = {dog, cat, horse}, B = {cat, horse, squirrel, dog} : A B  • A = {dog, cat, horse}, B = {cat, horse, dog, dog} : A = B
  • 41.
    Examples for Sets “Standard” Sets: • Natural numbers N = {0, 1, 2, 3, …} • Integers Z = {…, -2, -1, 0, 1, 2, …} • Positive Integers Z+ = {1, 2, 3, 4, …} • Real Numbers R = {47.3, -12, , …} • Rational Numbers Q = {1.5, 2.6, -3.8, 15, …} (correct definition will follow) Fall 2002 CMSC 203 - Discrete Structures 41
  • 42.
    Examples for Sets •A =  “empty set/null set” • A = {z} Note: zA, but z  {z} • A = {{b, c}, {c, x, d}} • A = {{x, y}} Note: {x, y} A, but {x, y}  {{x, y}} • A = {x | P(x)} “set of all x such that P(x)” • A = {x | xN  x > 7} = {8, 9, 10, …} “set builder notation” Fall 2002 CMSC 203 - Discrete Structures 42
  • 43.
    Examples for Sets Weare now able to define the set of rational numbers Q: Q = {a/b | aZ  bZ+ } or Q = {a/b | aZ  bZ  b0} And how about the set of real numbers R? R = {r | r is a real number} That is the best we can do. Fall 2002 CMSC 203 - Discrete Structures 43
  • 44.
    Subsets A  B“A is a subset of B” A  B if and only if every element of A is also an element of B. We can completely formalize this: A  B  x (xA  xB) Examples: Fall 2002 CMSC 203 - Discrete Structures 44 A = {3, 9}, B = {5, 9, 1, 3}, A  B ? true A = {3, 3, 3, 9}, B = {5, 9, 1, 3}, A  B ? false true A = {1, 2, 3}, B = {2, 3, 4}, A  B ?
  • 45.
    Subsets Useful rules: • A= B  (A  B)  (B  A) • (A  B)  (B  C)  A  C (see Venn Diagram) Fall 2002 CMSC 203 - Discrete Structures 45 U A B C
  • 46.
    Useful rules: •  A for any set A • A  A for any set A Proper subsets: A  B “A is a proper subset of B” A  B  x (xA  xB)  x (xB  xA) or A  B  x (xA  xB)  x (xB  xA) Fall 2002 CMSC 203 - Discrete Structures 46
  • 47.
    Cardinality of Sets Ifa set S contains n distinct elements, nN, we call S a finite set with cardinality n. Examples: A = {Mercedes, BMW, Porsche}, |A| = 3 Fall 2002 CMSC 203 - Discrete Structures 47 B = {1, {2, 3}, {4, 5}, 6} |B| = 4 C =  |C| = 0 D = { xN | x 7000 }  |D| = 7001 E = { xN | x 7000 }  E is infinite!