Discrete Structure Note 16
Discrete Structure Note 16
SET THEORY
Set Theory is a mathematical theory that underlies all of modern mathematics. The best way
to understand mathematics is to talk and write about mathematics. Mathematics is not all
about finding solutions to given tasks. Therefore, as we tackle a more advanced and abstract
mathematics in this unit, your basic understanding of it will be helped by how well you can
read, write and talk about mathematical statements.
Statement Definitions
A declarative sentence which is either true or false is called a statement. A statement is said
to be an Atomic Statement if it cannot be divided into smaller statements, otherwise it is
called a Molecular Statement.
• 5 is larger than 7.
• 12 is a perfect square.
• Every even number greater than 2 can be expressed as the sum of two primes.
• 1 + 3 + 5 + 7 + · · · + 2n + 1.
• Go to the lecture room!
• 4 + x = 12
This example of a molecular statement can also be broken down into smaller statements
which were only connected by an “and”. Obviously, molecular statements are still statements,
therefore, they must be either true or false.
The five connectives we can consider are “and”, “or”, “if… then”, “if and only if”, and “not.
“if… then” - If you register then you can write the exam.
“if and only if”- You can register if and only if you were admitted.
The connectives, “and”, “or”, “if… then”, “if and only if”, connects two statements and are
called binary connectives while the connective “not” applies to only a single sentence and is
called a unary connective.
In order to determine the truth values of molecular statements, the key observation to make is
to completely determine the truth values of the parts and the type of connective(s). We do not
necessarily need to know what the individual parts actually say; we however, only need to
know whether those parts are true or false. Therefore, in order to analyse logical connectives,
we use propositional variables (also called sentential variables) which are the letters found in
the middle of the English alphabet represented in capital: P, Q, R, S, … to represent each
atomic statements in the molecular statement. These variables can only have two values, true
or false. The logical connectives: “and”, “or”, “if… then”, “if and only if”, and “not” can be
represented by these symbols ^, v, →, ↔, and ¬ respectively.
Logical Connectives
The truth value of a statement is determined by the truth value(s) of its part(s), depending on
the connectives: Truth Conditions for Connectives.
Sets
Notations
The notation, A = {1, 2} is read as, “A is the set containing the elements 1 and 2.”
The curly braces “{ }” is used to enclose the elements of a set and the comma “,” is used to
separate the elements inside the braces.
integer, 1 ≤ x ≤ 2} is read as “the set of all x such that x is an integer between 1 and 2 (1 and
2 inclusive)”.
The symbol “∈” implies “is in” or “is an element of.” Therefore, the notation is read as 5 is
an element of a set containing 1,2, and 5. This is a true statement. We can also write another
true statement if we say that 3 “is not” an element of the set containing 1, 2, and 5. This can
be written as:
3 ∉ {1, 2, 5}
If A is {2, 3, 4}, B is {2, 3, 4}. Then A ⊄ B (read as A is a NOT a proper subset of B).
U: A fixed set which contains all other sets under investigation is called universal set.
In other words, all other sets under investigation are subsets of the universal set and it is
denoted by U.
Example: Considering human population, the universal set consist of all people in the world.
Operations on Sets
∪: A ∪ B is the union of A and B: is the set containing all elements which are elements
of A or B or both.
∩: A ∩ B is the intersection of A and B: the set containing all elements which are
elements of both A and B.
\: A \ B is A minus B: the set containing all elements of A which are not elements of B.
Let the universal set, U be {1, 2, . . . , 9, 10}, A = {2, 3, 4}. Then Ac = {1, 5, 6,..,9, 10}.
The expression A × A × · · · × A (n times) can also be denoted as An which is the set of all
ordered subsets (with repetitions) of A of size n.
Examples
ii. Let A = {1, 2}, B = {3, 4, 5}. Then A × B = {(1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5)}.
Example
Solution
Proof: Let A × B = B × A. then, A ⊆ B and B ⊆ A. Therefore, A = B.
iv. De M gan’s Law: (P ∪ Q)C = (Pc ∩ Qc) and (P ∩ Q)C = (Pc ∪ Qc)
• P(A) The power set of any set A is the set of all subsets of A.
Disjoint Set
Sets X and Y are said to be disjoint sets, if they have no element in common, that is, no
element of X is in Y and no element of Y is in X.
Example:
Power Set
We call the set of all subsets of A, the power set of A, and write it as P(A)
So, P(A) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
Note: The power set of a set A is normally, 2n, where n is the cardinality of the set A.
Note: Although 2 ∈ A, it will be wrong to say that 2 ∈ P(A) because none of the elements in
P(A) are numbers. However, we can say that {2} ∈ P(A) because {2} ⊆ A.
We can relate the symbols of union and intersect to resemble the logic symbols of “or” and
“and”. Remember that the statement x ∈ A ∪ B is read as x is an element of A or x is an
element of B. Therefore,
x ∈ A ∪ B ↔ x ∈ A ∨ x ∈ B.
Similarly,
x ∈ A ∩ B ↔ x ∈ A ∧ x ∈ B.
Also,
x ∉ A ↔ ¬ (x ∈ A)
Example
Let A = {2, 4, 6}, B = {1, 2, 3, 4, 5, 6}, C = {1, 2, 3}, D = {1, 3, {4, 5}, x}, and
E = {7, 8, 9}.
1. A ⊂ B. 2. B ⊂ A. 3. A ∈ C. 4. ∅ ∈ B. 5. ∅ ⊂ A.
6. A < E. 7. 3 ∈ C. 8. x ⊂ D. 9. {9} ⊂ E.
Solution
5. True. Everything in the empty set (nothing) is also an element of A. Notice that the empty
set is a subset of every set.
9. True. 9 is the only element of the set {9}, and is an element of E, so every element in
{9} is an element of E.
Venn Diagrams
A Venn Diagram is a great tool used to visualize and represent operations on sets. It is used
to display sets as intersecting circles. We can highlight a region under consideration when we
carry out an operation. The cardinality of a set can be represented by putting numbers in the
corresponding area.
Relations
Definition: A relation on a single set S is a subset of S × S. A relation on sets S and T is a
subset of S × T. Now, let’s consider relationships among sets. For example, we can say that X
is married to Y and they both have a child, Z. In our daily lives, we deal a lot with talks about
relationships. For example, if we consider two human beings (A, B), “taller-than”, “smarter-
than” are relations between them. That is (A, B) ∈ “taller-than” if person A is taller than
person B. “≥” is a relation on R; “≥” = {(x, y) | x, y ∈ R, x ≥ y}.
iii. Transitive if for all x, y, z ∈ S, whenever (x, y) ∈ R and (y, z) ∈ R, then (x, z) ∈ R.
Example
iii. “sibling-of”, “≤”, and “<” are all transitive, but “parent-of” is not (however, “ancestor of”
is transitive).
A relation that is reflexive, symmetric and transitive is called an Equivalence relation and is
denoted by the symbol “≡”.
Let “≡” be an equivalence relation on the set S. An equivalence class is a maximal subset E
of the set S such that any two elements in the set E is related. There can be multiple
equivalence class corresponding to the relation ≡.
Assignments
1. Describe each of the following sets both in words and by listing out enough elements to see
the pattern.
a. {x : x + 2 ∈ ℕ}.
b. {x : x + 2 ∈ ℕ+}.
c. {x ∈ ℕ : x + 2 ∈ ℕ}.
d. {x : x ∈ ℕ ∨ −x ∈ ℕ}.
e. {x : x ∈ ℕ ∧ −x ∈ ℕ}.
4. Using the sets W = {2, a, {u, v, w}, ∅}, X = {∅, a}, Y = {1, 2, 4} and Z = {2, 4, 8}.
Determine if the following statements are true, false or meaningless. State your reasons for
each.
Proof techniques can either be direct, indirect or by induction. The choice of a proof
technique depends on the problem or task at hand. Therefore, it is important to realize that
there is no single method applicable to solving all tasks. This implies that your level of
ingenuity, skills and implementation of common sense must be applied to every task. In this
Unit, we will discuss the direct, proof by induction and indirect proofs (proof by
contrapositive and proof by contradiction).
In order to prove a mathematical statement, we have to show that for a given premise, the
conclusion given can be derived. Considering any given task: such that we are given a
premise X, how do we show that a conclusion Y holds? One way to achieve this is by giving
a Direct Proof. In this form of proof, we start with a premise X, and directly deduce the
conclusion Y through a series of logical steps.
The two steps to directly prove that X → Y is true.
Solution 1
2. Proof by Induction
Firstly, prove that the proposition is true for n = 1. If the claim is that the proposition is true
for n ≥ a, first prove it for n = a.
Inductive step
Prove that if the proposition is true for n = k, then it must also be true for n = k + 1. This is
the difficult step and we will break it down into steps.
Step 1: Here we perform Inductive Hypothesis by writing down what the proposition asserts
for the case n = k.
Step 2: Now, write down what the proposition asserts for the case n = k + 1. Clearly
remember that this is what you have to prove.
Step 3: By using the assumption made in Step 1, try and prove the statement in Step 2.
Have in mind that this stage varies from problem to problem depending on the mathematical
contents, therefore, there is no single way to solve all problems. The main aim here is to
apply your skills and determine how you get from Step1 to Step2.
After the initial and inductive steps have been successfully performed, we then conclude
immediately that the proposition is true for all n ≥ 1.
2n(n + 1).
Now, for n = 1, 1/2n (n + 1) = 1/2× 1 × 2=1. So, the result is true for n = 1.
Inductive step:
The answer here is that we get the left-hand side of stage 2 from the left-hand side of stage
This completes the inductive step. Hence, the result is true for all n ≥ 1.
Solution.3
Proof. We have to define the propositional form F(x) to be true when the sum of x and its
successor is odd.
Step 1: Let’s consider the proposition F(1). The sum 1 + 2 = 3 is odd because we can
demonstrate there exists an integer k such that 2k + 1 = 3. That is, 2(1) + 1 = 3. Thus, F(x) is
true when x = 1.
Step 2: Assume that F(x) is true for some x. Thus, for some x we have that x + (x + 1) is odd.
We add one to both x and x + 1 which gives the sum (x+1) + (x+2). We can make claim to
two things: firstly, the sum (x+1) + (x+2) = F(x+1). Secondly, we claim that the addition of
two (2) to any integer does not change the evenness or oddness of that integer (e.g., 1 + 2 = 3,
2 + 2 = 4). With these two observations we claim that F(x) is odd implies F(x + 1) is odd.
Step 3: By the principle of mathematical induction, we thus claim that F(x) is odd for all
integers x. Thus, the sum of any two consecutive numbers is odd.
3. Indirect Proofs
Proof by Contrapositive
This proof starts by assuming that the conclusion Y is false, and through a series of logical
steps deduce that the premise X must also be false.
Based on first-order logic we can make a statement such as P → Q is equivalent to ¬Q →¬P.
Steps to proving a theorem by contrapositive:
a. Assume ¬Q is true.
Solution 4
Proof by contrapositive: Suppose that n is not even. Then by solution 1 above, n2 is not even
as well. Yes, that all!
Proof by Contradiction.
This form of proof assumes both that the premise X is true and the conclusion Y is false, and
reach a logical fallacy.
a. Assume P is true.
b. Assume ¬Q is true.
c. Demonstrate a contradiction.
Solution 5
Proof by contradiction: Suppose that n2 is even, but n is odd. Applying solution 1, we see that
n2 must be odd. But n2 cannot be both odd and even at the same time.
Conclusion
You have learnt from this unit that proof techniques can either be direct, indirect or by
induction. That the choice of a proof technique depends on the problem or task at hand. You
should note that there is no single method applicable to solving all tasks. This means that
your level of ingenuity, skills and implementation of common sense must be applied to every
task.
LOGIC
Propositional Logic
Logic is the study of consequences. Given a few mathematical statements or facts, we would
like to be able to draw some conclusions. For example, we can say the statement: “Abuja is
the capital of Nigeria” is True and that the statement: “The month of December is fall in the
summer” is False. This kind of statements are called propositions because they are either true
or false. The truth or falsehood of a proposition is called its truth value. As stated earlier,
propositional variables (also called sentential variables) which are the letters found in the
middle of the English alphabet represented in capital: P, Q, R, S, … to represent each atomic
statements in the molecular statement. These variables can only have two values, true or
false. The logical connectives: “and”, “or”, “if… then”, “if and only if ( or if)”, and “not”
represented by these symbols ˄, v, →, ↔, and ¬ respectively. The atomic statements: “It is
raining” and “I need an umbrella” can be represented by the letters P and Q respectively.
Solution 1: In solving such exercises, you will have to be careful as to knowing the exact
position of the ¬. Note that this statement is not ¬ (P ∨ Q), the negation belongs only to P (i.e.
¬P). Here is the truth table:
Example 2: Analyze the statement, “if you get more doubles than any other player you will
lose, or that if you lose you must have bought the most properties,” using truth tables.
Solution 2: Let’s start by breaking down the molecular statement into atomic statements. Let
P be the statement “you get more doubles than any other player,”; Q be the statement “you
will lose,” and R be the statement “you must have bought the most properties.” Now let’s
construct a truth table to represent the statement as this symbol (P → Q) ∨ (Q → R).
The truth table needs to contain 8 rows in order to account for every possible combination of
truth and falsity among the three statements. Here is the full truth table:
This is a true statement about monopoly, such that it is regardless of how many properties
you own, how many doubles you roll, or whether you win or lose, the outcome is true for all
8 possible combinations.
Logical Equivalence
Two molecular statements P and Q are logically equivalent provided P is true precisely when
Q is true. That is, P and Q have the same truth value under any assignment of truth values to
their individual atomic parts. Then we symbolize it as P ≡ Q. In order to verify that two or
more statements are logically equivalent, you may have to make a truth table for each and
check whether the columns for the statements are identical.
Solution 3: let us start by making the truth table for these statements. Check example 1 and
our first truth table.
Since the statements ¬P ∨ Q and P → Q either both true or both false for whatever values of
P and Q. We therefore say these statements ¬P ∨ Q and P → Q are logically equivalent.
Exercise 4: Make a truth table to determine whether the statement ¬ (P∨Q) is logically
equivalent to ¬P ∧ ¬Q.
Solution 4
Try it yourself.
The solution to exercise 4 will show that both statements are logically equivalent. It also
shows that we can distribute a negation over a disjunction (“or”). Likewise, the distribution of
negation over a conjunction (“and”) is also possible.
De Morgan’s Laws
1. ¬ (P ∧ Q) is logically equivalent to ¬P ∨ ¬Q
2. ¬ (P ∨ Q) is logically equivalent to ¬P ∧ ¬Q
Example 5: Without using truth tables prove that the statements ¬ (P → Q) and P ∧ ¬Q are
logically equivalent.
Solution 5: Let’s start with one of the statements, and transform it into the other through a
sequence of logically equivalent statements.
We can rewrite the implication as a disjunction this is logically equivalent to ¬ (¬P ∨ Q).
(Solution 3 shows that P → Q is logically equivalent to ¬P ∨ Q)
P ∧ ¬Q
Deduction Rule
An argument is valid provided the conclusion must be true given that the premises are true.
This means that for all times the premises are found to be true, the conclusion must be true
for the argument to be a valid deduction rule, else it is invalid.
Example 6:
Example 7
Solution 7:
The premises P → Q, Q → R and R are all true in rows 1, 5, and 7. However, the conclusion
P ∨ Q is not always true when the premises are all true as seen in row 7. Hence this is not a
valid deduction rule.
Tutor-Marked Assignment
1. Consider the statement about a party, “If it’s your birthday or there will be cake, then there
will be cake.”
a. Translate the above statement into symbols. Clearly state which statement is P and which is
Q.
c. Assuming the statement is true, what (if anything) can you conclude if there will be cake?
d. Assuming the statement is true, what (if anything) can you conclude if there will not be
cake?
e. Suppose you found out that the statement was a lie. What can you conclude?
3. Using a truth table, determine if the following statements are logically equivalent.
i. (P ∨ Q) → R and (P → R) ∨ (Q → R)
iii. “I will not eat or drink” and “I will not eat and I will not drink”. Hint: First translate to
statement into a logical expression.
4. Simplify the following statements (so that negation only appears right before variables).
a. ¬(P → ¬Q).
d. It is false that if Sam is not a man then Chris is a woman, and that Chris is not a woman.
5. Show that