Professional Documents
Culture Documents
Discrete Mathematics: Propositional Logic
Discrete Mathematics: Propositional Logic
Discrete Mathematics: Propositional Logic
1
Disjunction
Conjunction
The disjunction of propositions p and q is denoted by p ∧ q and has this truth table:
Implication
If p and q are propositions, then p → q is a conditional statement or implication which is read as “if p, then q”
and has this truth table:
2
Different Ways of Expressing p → q
if p, then q p implies q
if p, q p only if q
q unless ¬p q when p
q if p q whenever p
p is sufficient for q q follows from p
q is necessary for p a necessary condition for p is q
a sufficient condition for q is p
Converse, Contrapositive, and Inverse
q → p is the converse of p → q
¬q → ¬p is the contrapositive of p → q
¬p → ¬q is the inverse of p → q
Example: Find the converse, inverse, and contrapositive of
“It is raining is a sufficient condition for my not going to town.”
Solution:
converse: If I do not go to town, then it is raining.
inverse: If it is not raining, then I will go to town.
contrapositive: If I go to town, then it is not raining.
How do the converse, contrapositive, and inverse relate to p → q ?
converse ≡ contrapositive ?
converse ≡ inverse ?
contrapositive ≡ inverse ?
Biconditional
If p and q are propositions, then the biconditional proposition p ↔ q has this truth table
3
p ↔ q also reads as
p if and only if q
p iff q.
p is necessary and sufficient for q
if p then q, and conversely
p implies q, and vice-versa
Precedence of Logical Operators
1¬
2∧
3∨
4→
5↔
Thus p ∨ q → ¬r is equivalent to (p ∨ q) → ¬r. If the intended meaning is p ∨ (q → ¬r) then parentheses
must be used.
Satisfiability, Tautology, Contradiction
A proposition is
satisfiable, if its truth table contains true at least once. Example:
p ∧ q.
a tautology, if it is always true. Example: p ∨ ¬p.
a contradiction, if it always false. Example: p ∧ ¬p.
a contingency, if it is neither a tautology nor a contradiction.
Example: p.
Logical Equivalence
Definition: Two compound propositions p and q are logically equivalent if the columns in a truth table
giving their truth values agree.
This is written as p ≡ q.
It is easy to show:
Fact p ≡ q if and only if p ↔ q is a tautology.
De Morgan’s Laws
¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q
4
Truth table proving De Morgan’s second law.
5
A Proof in Propositional Logic
To prove: ¬(p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬q
¬(p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬(¬p ∧ q) by De Morgan’s 2nd law
≡ ¬p ∧ (¬(¬p) ∨ ¬q) by De Morgan’s first law
≡ ¬p ∧ (p ∨ ¬q) by the double negation law
≡ (¬p ∧ p) ∨ (¬p ∧ ¬q) by the 2nd distributive law
≡ F ∨ (¬p ∧ ¬q) because ¬p ∧ p ≡ F
≡ (¬p ∧ ¬q) ∨ F by commutativity of disj.
≡ ¬p ∧ ¬q by the identity law for F
6
Example: Transformation into CNF
Transform the following formula into CNF.
¬(p → q) ∨ (r → p)
1 Express implication by disjunction and negation.
¬(¬p ∨ q) ∨ (¬r ∨ p)
2 Push negation inwards by De Morgan’s laws and double negation.
(p ∧ ¬q) ∨ (¬r ∨ p)
3 Convert to CNF by associative and distributive laws.
(p ∨ ¬r ∨ p) ∧ (¬q ∨ ¬r ∨ p)
4 Optionally simplify by commutative and idempotent laws.
(p ∨ ¬r) ∧ (¬q ∨ ¬r ∨ p)
and by commutative and absorbtion laws
(p ∨ ¬r)
7
Quantifiers
• Universal
P(x) is true for every x in the universe of discourse.
Notation: universal quantifier
" xP(x)
‘For all x, P(x)’, ‘For every x, P(x)’
The variable x is bound by the universal quantifier producing a proposition.
Example: U={1,2,3}
Existential
P(x) is true for some x in the universe of discourse.
Notation: existential quantifier
‘There is an x such that P(x),’ ‘For some x, P(x)’, ‘For at least one x, P(x)’, ‘I can find an x such that
P(x).’
Unique Existential
P(x) is true for one and only one x in the universe of discourse.
Notation: unique existential quantifier
‘There is a unique x such that P(x),’ ‘There is one and only one x such that P(x),’ ‘One can find only one
x such that P(x).’
Example: U={1,2,3}
Truth Table:
8
How many minterms are in the DNF?
Distributing a negation operator across a quantifier changes a universal to an existential and vice versa.
Multiple Quantifiers: read left to right . . .
Example: Let U = R, the real numbers, P(x,y): xy= 0
9
The only one that is false is the first one. Suppose P(x,y) is the predicate x/y=1?
Example:
Let U = {1,2,3}. Find an expression equivalent to
Nested Quantifiers
In the domain of integers, P(x,y). predicate "xy=12"
I'm not sure why
10
Rules of Inference
• Theorem: a statement that can be shown to be true
• Proof: demonstration of truth of theorem
– consists of series of arguments called axioms or postulates
– these are statements of underlying assumptions about mathematical structures,
hypotheses of theorem to be proved, and previously proved theorems
Addition
A true hypothesis implies that the disjunction of that hypothesis and another are true
Simplification
If the conjunction of 2 propositions is true, then each proposition is true
Conjunction
If p is true and q is true, then p Ù q is true
Modus Ponens
If a hypothesis and implication are both true, then the conclusion is true
11
Modus Tollens
If a conclusion is false and its implication is true, then the hypothesis must be false
Hypothetical Syllogism
If an implication is true, and the implication formed using its conclusion as the hypothesis is
also true, then the implication formed using the original hypothesis and the new conclusion is
also true
Disjunctive Syllogism
If a proposition is false, and the disjunction of it and another proposition is true, the second
proposition is true.
A proof is a valid argument that establishes the truth of a theorem (as the conclusion)
Statements in a proof can include the axioms (something assumed to be true), the premises,
and previously proved theorems
12
Methods of Proving:
A direct proof of a conditional statement
p q first assumes that p is true, and uses axioms,definitions, previously proved theorems, with
rules of inference, to show that q is also true
The above targets to show that the case where p is true and q is false never occurs
Thus, p q is always true
Direct Proof (Example 1)
Show that if n is an odd integer, then n2 is odd.
Proof : Assume that n is an odd integer. This implies that there is some integer k such that n = 2k + 1.
Then n2 = (2k+1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1. Thus, n2 is odd.
Direct Proof (Example 2)
Show that if m and n are both square numbers, then mn is also a square number.
• Proof : Assume that m and n are both squares. This implies that there are integers u and v such that
m = u2 and n = v2.
Then mn = u2 v2 = (uv)2. Thus, mn is a square.
To show that the conditional statement p q is true, we first assume is true, and use
axioms, definitions, proved theorems, with
then .
13
• Proof : Assume that both a and b are larger than .
of the equivalence
where F0 is any contradiction
• One way to show that the latter is as follows: First assume ¬ p is true, and then show that
for some proposition r, r is true and ¬ r is true
• That is, we show ¬ p ( r ˄ ¬ r ) is true
14
Proof Strategies
Adapting Existing Proof
15
Examples:
(1) an = n2, where n = 1,2,3...– What are the elements of the sequence?
1, 4, 9, 16, 25, ...
(2) an = (-1) n, where n=0,1,2,3,... – Elements of the sequence?
1, -1, 1, -1, 1, ...
3) an = 2 n, where n=0,1,2,3,... – Elements of the sequence?
1, 2, 4, 8, 16, 32, ...
Arithmetic progression
Definition: An arithmetic progression is a sequence of the form
a, a+d,a+2d, …, a+nd where a is the initial term and d is common difference, such that
both belong to R.
Example:
sn= -1+4n for n=0,1,2,3, …
members: -1, 3, 7, 11, …
Geometric progression
DefinitionA geometric progression is a sequence of the form:
a, ar, ar2, ..., ark, where a is the initial term, and r is the common ratio. Both a and r belong to R.
Example:
an = ( ½ )n for n = 0,1,2,3, …
members: 1,½, ¼, 1/8, …..
Given a sequence finding a rule for generating the sequence is not always straightforward.
Example:
Assume the sequence: 1,3,5,7,9, ….
What is the formula for the sequence?
Each term is obtained by adding 2 to the previous term.
1, 1+2=3, 3+2=5, 5+2=7
What type of progression this suggest?
Example:
Assume the sequence: 1,3,5,7,9, ….
What is the formula for the sequence?
Each term is obtained by adding 2 to the previous term.
1, 1+2=3, 3+2=5, 5+2=7
It suggests an arithmetic progression: a+nd
with a=1 and d=2
an=1+2n
16
Example 2:
Assume the sequence: 1, 1/3, 1/9, 1/27, …
What is the sequence?
The denominators are powers of 3.
1, 1/3= 1/3, (1/3)/3=1/(3*3)=1/9, (1/9)/3=1/27
This suggests a geometric progression: ark
with a=1 and r=1/3
(1/3 )n
Recursively defined sequences
The n-th element of the sequence {an} is defined recursively in terms of the previous
elements of the sequence and the initial elements of the sequence.
Example :
an = an-1 + 2 assuming a0 = 1;
a0 = 1;
a1 = 3;
a2 = 5;
a3 = 7;
Can you write an non-recursively using n?
an = 1 + 2n.
Fibonacci sequence
Recursively defined sequence, where
f0 = 0;
f1 = 1;
fn = fn-1 + fn-2 for n = 2,3, …
f2 = 1
f3 = 2
f4 = 3
f5 = 5
Summations
Summation of the terms of a sequence:
17
2) What is the value of
Arithmetic series
Definition: The sum of the terms of the arithmetic progression
a, a+d,a+2d, …, a+nd is called an arithmetic series.
Theorem: The sum of the terms of the arithmetic progression
a, a+d,a+2d, …, a+nd is
18
Example:
Example 2:
19
Double summations
Example:
Geometric series
Definition: The sum of the terms of a geometric progression a, ar,
Ar2, ..., ark is called a geometric series.
Theorem: The sum of the terms of a geometric progression a, ar,
Ar , ..., arn is
2
Geometric series
Theorem: The sum of the terms of a geometric progression a, ar,ar2.......arn is
20
Infinite geometric series
Infinite geometric series can be computed in the closed form
for x<1
How?
Mathematical Induction
21
Note: Proofs by mathematical induction do not always start at the integer 0. In such a case, the
basis step begins at a starting point b where b is an integer. In this case we prove the property
only for integers ≥ b instead of for all of N.
Proving a Summation Formula by Mathematical Ind.
Show that the following property P(n) that
22
Example: Give a recursive definition of the factorial function n!.
f (0) = 1
f (n + 1) = (n + 1) . f (n)
Example: Fibonacci numbers. f (0) = 0, f (1) = 1 and
f (n + 2) = f (n + 1) + f (n).
Recursively Defined Sets and Structures
Recursive definitions of sets have two parts:
The basis step specifies an initial collection of elements. The recursive step gives the rules for forming
new elements in the set from those already known to be in the set.
Sometimes the recursive definition has an exclusion rule, which specifies that the set contains nothing
other than those elements specified in the basis step and generated by applications of the rules in
the recursive step.
We will always assume that the exclusion rule holds, even if it is not explicitly mentioned.
We will later develop a form of induction, called structural induction, to prove results about recursively
defined sets.
Example: A subset of Integers S:
Basis step: 3 ϵ S.
Recursive step: If x ϵS and y ϵS, then x + y ϵ S.
Initially 3 is in S, then 3 + 3 = 6, then 3 + 6 = 9, etc.
Example: The natural numbers N.
Basis step: 0 ϵN.
Recursive step: If n ϵN then n + 1 ϵN.
*
Example: The set Σ of strings over alphabet Σ.
*
Basis step: λϵΣ . (λ is the empty string.)
*
Recursive step: If w ϵΣ and x ϵΣ then wx ϵΣ
Structural Induction
Here we instantiate well-founded induction with a relation R defined as “is used as a part in the
recursive step of the construction of”.
To prove a property of the elements of a recursively defined set, we use structural induction.
Basis step: Show that the property holds for all elements specified in the basis step of the
recursive definition.
Recursive step: Show that if the property is true for each of the parts used to construct new
elements in the recursive step of the definition, then the property also holds for these new
elements.
Functions on Full Binary Trees
Definition
The height h(T) of a full binary tree T is defined recursively as follows:
Basis step: The height of a full binary tree T consisting of only a root r is h(T) = 0.
Recursive step: If T1 and T2 are full binary trees, then the full binary tree T = T 1 .T2 has height
h(T) = 1 + max(h(T1); h(T2)).
Definition
The number of vertices n(T) of a full binary tree T is defined recursively as follows:
Basis step: The number of vertices n(T) of a full binary tree T consisting of only a root r is n(T) = 1.
Recursive step: If T1 and T2 are full binary trees, then the full binary tree T = T 1 _ T2 has number of
vertices n(T) = 1 + n(T1) + n(T2).
23
Structural Induction on Binary Trees
Theorem
If T is a full binary tree, then n(T) ≤2 h(T)+1-1.
Proof by structural induction.
Basis step: The result holds for a full binary tree consisting only of a root n(T) = 1 and h(T) = 0. Hence,
n(T) = 1≤20+1-1=1
Recursive step: By induction hypothesis we assume
Recurrence relation
A recurrence relation for {an} is an equation that expresses an in terms of a0……….an -1. A sequence is
called a solution of a recurrence relation if its terms satisfy the recurrence relation.
For instance, the relation fn = fn-1 + fn-2 of Fibonacci numbers is a recurrence relation.
Example
(The Tower of Hanoi) Consider moving a stack of disks with di_erent sizes with three pegs. Initially, all
disks are sorted and placed on the _rst peg.
One can only move the topmost disk from a peg to another peg. At any time, disks on each peg must be
sorted as well. How many steps does it take to move all disks from one peg to another?
Solution: Let Hn be the number of steps to solve the problem of n disks.
Clearly, H1 = 1. Now consider moving n disks from peg 1 to peg 2. If we can move the
Top most n - 1 disks from peg 1 to peg 3, we can solve the puzzle by moving the bottom disk from peg 1
to peg 2 and then the n -1 disks
Hence
24
THYen
CATALAN NUMBERS
Example
Find the number of ways to parenthesize the product of n + 1 numbers x 0; x1……xn.
Solution: Let Cn denote the number of ways to parenthesize the product
of n + 1 numbers. For instance, C3 = 5 because
x0 .(x1 . (x2 . x3)) x0 .((x1 .x2) . x3) (x0 .(x1 .x2)) .x3 ((x0 .x1) . x2) .x3
25
Theorem:
Proof.
Fibonacci numbers
Example
Recall the recurrence relation for Fibonacci numbers fn = fn-1 + fn-2 with f0 = 0 and f1 = 1. Find an explicit
formula for the Fibonacci numbers.
26
Characteristic Equations with Multiple Roots:
Theorem:
Example
What is the solution of the recurrence relation
27
GENERATING FUNCTIONS
Any sequence a0, a1, a2, . . . can be encoded as a formal infinite power series
a 0x 0 + a 1x 1+ a 2x2 + . . .
def: An (ordinary) generating function for a sequence a0, a1, a2, . . . is a function whose formal
power series (Maclaurin series) has that sequence as its sequence of coefficients.
Example : The generating function for the sequence 1, 1, 1, . . . is the function
RATIONAL FUNCTIONS
def: A rational function is the quotient of two finite polynomials.
Example
Remark: Rational functions are among the most frequently encountered generating functions.
One may think of a closed form as a way of “generating” the coefficients of a power series. In
particular, division of polynomials generates the power series.
Example: Long division of polynomials
28
Prop: Every rational function is the OGF for a sequence.
Proof: As illustrated by Example
ENCODING A GIVEN SEQUENCE AS AN OGF
Several principles are valuable in constructing an OGF for a given sequence. Proofs are omitted .
Prop: Two generating functions
Example:
Inclusion-Exclusion
Principle: The number of elements in the union of the two sets A and B is the sum of the numbers of
elements in the sets minus the number of elements in their intersection. That is,
Theorem:
Proof: Suppose that a is a member of exactly r of the sets. Then a is counted times by the
first sum, times by the second sum and counted by the m th sum. Thus, a is counted
29
times in all. Considering the expansion of (1 -1) r , we see that the above expression is equal to 1. Thus,
each member of A is counted exactly once by the right-hand sequence of sums, so it equals
Example: Give a formula for the number of elements in the union of four
arbitrary sets: A1,A2, A3,A4.
Give a formula for the number of elements in the union of four arbitrary sets: A1,A2, A3,A4.
30
and the second element comes from B. We use the notation a R b to denote that (a, b) ∈ R and a6R b to denote
that (a, b) /∈ R. Moreover, when (a, b) ∈ R, a is said to be related to b by R.
31
In other words, the zero-one matrix representing R has a 1 as its (i , j) entry when ai is related to
bj , and a 0 in this position if ai is not related to bj . Such a representation depends on the
ordering used for A and B.
Example: Let A = {0, 1, 2}, B = {a, b} and the relation
R = {(0, a), (0, b), (1, a), (2, b)} from A to B.
An edge of the form (a, a) is represented using an arc from the vertex a back to itself. Such an
edge is called a loop.
32
Representing Relations on a Set Using Tables
Let A be the set {1, 2, 3, 4} and R be the relation on the set A given by R = {(a, b) | a divides b}
⊆ A×A. This relation is the set R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
Reflexive Relation
Definition
A relation R on a set A is called reflexive if (a, a) ∈ R for all element a ∈ A.
Remark: Using quantifiers, a relation R on a set A is reflexive if ∀a((a, a) ∈ R), where the universe of
discourse is the set of all elements in A.
Example: Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation reflexive?
33
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation
reflexive?
Symmetric Relation
Definition
A relation R on a set A is called symmetric if (a, b) ∈ R implies that (b, a) ∈ R for all a, b ∈ A.
Remark: Using quantifiers, a relation R on a set A is symmetric if ∀a ∀b ((a, b) ∈ R → (b, a) ∈ R).
Example: Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation symmetric?
Representing a Relation on a Set Using a Directed Graph
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation
symmetric?
Representing a Relation on a Set Using a Directed Graph
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation symmetric?
34
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation
symmetric?
Antisymmetric Relation
Definition
A relation R on a set A is called antisymmetric if, for all a, b ∈ A, (a, b) ∈ R and (b, a) ∈ R then a = b.
Remark: Using quantifiers, a relation R on a set A is antisymmetric if ∀a ∀b (((a, b) ∈ R ∧ (b, a) ∈ R) → (a = b)).
The contrapositive is ∀a ∀b ((a 6= b) → ((a, b) /∈ R ∨ (b, a) /∈ R)).
Example: Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation antisymmetric?
35
Representing Relations on a Set Using Matrices
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation
antisymmetric?
Transitive Relation
Definition
A relation R on a set A is called transitive if, whenever (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R,
for all a, b, c ∈ A.
Remark: Using quantifiers, a relation R on a set A is transitive if ∀a ∀b ∀c(((a, b) ∈ R ∧ (b, c) ∈ R)
→ (a, c) ∈ R).
Example: Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation
transitive?
Representing a Relation on a Set Using a Directed Graph
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation
transitive?
36
Representing a Relation on a Set Using a Directed Graph , Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation transitive?
Representing Relations on a Set Using Matrices Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation transitive.
Combining Relations
Because relations from A to B are subsets of A × B, two relations form A to B can be combined in any way two sets
can be combined.
Example: A = {1, 2, 3}, B = {1, 2, 3, 4}. The relations
R1 = {(1, 1), (2, 2), (3, 3)} and R2 = {(1, 1), (1, 2), (1, 3), (1, 4)} can be combined to obtain
R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)}.
R1 ∩ R2 = {(1, 1)}.
37
R1 − R2 = {(2, 2), (3, 3)}.
R2 − R1 = {(1, 2), (1, 3), (1, 4)}.
Closures of Relations
Let R be a relation on a set A. The relation R may or may not have some property P such as reflexivity, symmetry or
transitivity.
If there is a relation S
◮ with property P,
◮ containing R,
◮ and such that S is a subset of every relation with property P
containing R, then S is called the closure of R with respect to P.
Reflexive Relation
Definition
A relation R on a set A is called reflexive if (a, a) ∈ R for every
element a ∈ A.
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}.
Reflexive Closure
Let R be a relation on a set A. The reflexive closure of R is R ∪ Δ where Δ = {(a, a) | a ∈ A} is called the diagonal
relation on A.
Symmetric Relation
Definition
A relation R on a set A is called symmetric if (a, b) ∈ R implies
that (b, a) ∈ R for all a, b ∈ A.
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}.
Symmetric Closure
Let R be a relation on a set A. The symmetric closure of R is R ∪ R-1
Where R -1 = {(b, a) | (a, b) ∈ R} is inverse relation of R.
Transitive Relation
Definition
A relation R on a set A is called transitive if, whenever (a, b) ∈ R
and (b, c) ∈ R, then (a, c) ∈ R, for all a, b, c ∈ A.
Let A be the set {1, 2, 3, 4} and R be the relation
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)}. Is this relation
transitive? If not, what is the transitive closure of R?
38
Composite of Relations
Definition
Let R be a relation from a set A to a set B, and S a relation from B to a set C. The composite of R and S is the
relation consisting of ordered pairs (a, c), where a ∈ A, c ∈ C, and for which there exists an element b ∈ B such that
(a, b) ∈ R and (b, c) ∈ S. We denote the composite of R and S by S ◦ R.
Join Matrix
Definition
Let A = [aij ] and B = [bij ] be m × n zero-one matrices. Then, the
join of A and B, denoted by A ∨ B, is the m × n zero-one matrix
with (i , j)th entry aij ∨ bij .
Example. Let
Definition
Let A = [aij ] be an m ×k zero-one matrix and B = [bij ] be a k ×n
zero-one matrix. Then, the Boolean product of A and B, denoted
39
Paths and Connectivity
Definition
Let R be a relation on the set A. The connectivity relation R * consists of pairs (a, b) such that there is a path of
length at least one from a to b in R.
Theorem
The transitive closure of a relation R equals the connectivity relation R *.
Theorem
Let MR be the zero-one matrix of the relation R on a set with n elements. Then the zero-one matrix of the transitive
closure R * is
40
Example of Transitive Closure, Step 2 of 4
Partial Orders
41
Total Order
A total ordering is a partial ordering in which every element is related to every other element.
(This forces a linear order or chain.)
Hasse Diagrams
We produce Hasse Diagrams from directed graphs of relations by doing a transitive reduction
plus a reflexive reduction (if weak) and (usually) dropping arrowheads (using, instead, “above”
to give direction)
1) Transitive reduction ¾ discard all arcs except those that “directly cover” an element.
42
Descending Sequence
Descending sequence: A sequence <x1, x2, …, xn> where for i < j, x i “is strictly above” xj on a
path in a Hasse diagram; xi need not, however, be “immediately above” xj.
43
Application of Well Founded Posets
for i=1 to n do …
n-i for i=1, …, n is a descending sequence on a well founded set (the natural numbers): <n-1,
n-2, …, n-n = 0>.
If a poset is built from relation R on set A, then any x Î A satisfying xRy is an upper bound of y,
and any x Î A satisfying yRx is a lower bound of y.
44
Least Upper and Greatest Lower Bounds
A least upper bound of two elements x and y is a minimal element in the intersection of the
upper bounds of x and y.
A greatest lower bound is a maximal element in the intersection of the lower bounds of x and y.
45
46