Beruflich Dokumente
Kultur Dokumente
Introduction to course
Discrete Math
Discrete Math" is not the name of a branch of mathematics, like number theory, algebra, calculus, etc. Rather,
it's a description of a set of branches of math that all have in common the feature that they are "discrete" rather
than "continuous".
So, in short, we can say that “Study of discrete elements is known as discrete mathematics”.
Mathematics can be broadly classified into two categories −
Continuous Mathematics − It is based upon continuous number line or the real numbers. It is
characterized by the fact that between any two numbers, there are almost always an infinite set of
numbers.
Discrete Mathematics − It involves distinct values; i.e. between any two points, there are a countable
number of points. So in discrete mathematics we study discrete elements.
Logic
Logic is the study of the principles and methods that distinguish between a valid and an invalid argument.
Prepositional Variable
A variable used to represent the preposition is called prepositional variable. For example:
p: Today is Friday.
q: 2+7<3
In above examples, letters such as p, q are called prepositional variables. Usually we use lower case letters for
prepositional variables.
Connectives
The logical operators that are used to form new propositions from two or more existing propositions. These
logical operators are also called connectives.
Examples: OR (∨), AND (∧), Negation/ NOT (¬), Implication / if-then (→), If and only if (⇔)
Negation of a Preposition
If p is a statement variable, then negation of p, “not p”, is denoted as “~p” or ¬p . It has opposite truth value
from p i.e., if p is true, then ~ p is false; if p is false, then ~ p is true.
OR
p ¬p
F T
T F
Conjunction of Preposition
When two propositions are combined by connectives “AND” then it is called the conjunction of preposition.
It is represented by ⋀. Let p and q be propositions. The conjunction of p and q, denoted by p ∧ q, is the
proposition “p and q.” The conjunction p ∧ q is true when both p and q are true and is false otherwise.
p q p⋀q
F F F
F T F
T F F
T T T
Disjunction of Preposition
When two propositions are combined by connectives “OR” then it is called the Disjunction of preposition.
p q p∨q
F F F
F T T
T F T
T T T
p q p→q
F F T
F T T
T F F
T T T
p q p⇔q
F F T
F T F
T F F
T T T
Easy way to remember Biconditional: It gives True for same value and False for different value of p and q.
Exclusive OR of Prepositions
Let p and q be propositions. The exclusive or of p and q, denoted by p ⊕ q, is the proposition that is true when
exactly one of p and q is true and is false otherwise.
It is abbreviated as p ⊕ q or p XOR q.
p q p⊕q
F F F
F T T
T F T
T T T
Easy way to remember Exclusive OR: It gives False for same value and True for different value of p and q.
Compound Prepositions
Many Prepositions are constructed by combining one or more propositions. Such propositions, are called
compound propositions. This type of Prepositions is formed from existing propositions using logical operators.
Compound preposition is also called well-formed formula.
Examples: ¬( p ⋀ q), ( p ⟶ ( p ⋁ q ⋁ r ))
Tautology
A compound proposition that is always true, no matter what the truth values of the propositional variables that
occur in it, is called a tautology.
A Tautology is a formula which is always true for every value of its propositional variables.
Tautology is represented by t.
Example: Prove [(A→B)∧A]→B is a tautology.
Proof:
Contradictions
A compound proposition that is always false, no matter what the truth values of the propositional variables that
occur in it, is called a contradiction.
A contradiction is a formula which is always false for every value of its propositional variables.
Contradiction is represented by c.
Example: Prove that p⋀ ¬ p is a contradiction.
Proof:
p ¬p p⋀ ¬ p
F T F
T F F
Since in the last column in the truth table we have F in all the entries, so it is a contradiction i.e. p⋀ ¬ p≡c
Logical Equivalence
Compound propositions that have the same truth values in all possible cases are called logically Equivalent.
Two statement forms are called logically equivalent if, and only if, they have identical truth values for each
possible substitution of statements for their statement variables. The logical equivalence of statement forms p
and q is denoted by writing p≡ q
T F T F F T F
T T T F F F F
Here same truth values appear in the column of both compound expression so they are logically equivalent.
Showing Nonequivalence
Example: Show that the statement forms ∼ (p ∧ q) and ∼p ∧ ∼q are not logically equivalent.
p q p∧q ∼ (p ∧ q) ∼p ∼q ∼p ∧ ∼q
F F F T T T T
F T F T T F F
T F F T F T F
T T T F F F F
∼(p ∧ q) and ∼p ∧ ∼q have different truth values in rows 2 and 3, so they are not logically equivalent.
6. Show that:
a)
b)
c)
d)
e)
f)
g)
h)
i)
We can prove all of the theorems and rules by using truth tables. (do it yourself one is done for you.).
Here same truth values appear in the column of both compound expression so they are logically equivalent. i.e.
¬(p ∧ q) ≡ ¬p ∨¬q proved .
b) ¬ (p ∨q) ≡¬p ∧ ¬q
p q p∨q ¬ (p ∨ q) ¬p ¬q ¬p ∧ ¬q
F F F T T T T
F T T F T F F
T F T F F T F
T T T F F F F
Here same truth values appear in the column of both compound expression so they are logically equivalent. i.e.
¬ (p ∧ q) ≡¬p ∧ ¬q proved.
≡ (p ∧ q) → (p ∨ q)
≡ ¬ (p ∧ q) ∨ (p ∨ q) ………………. as p →q≡∼p∨q
≡ (¬p∨¬q) ∨ (p ∨ q) ……………… by De Morgan’s law
≡(¬p∨p) ∨ (¬q∨ q) ………………. By Associative and commutative law of disjunction
≡ t ∨ t……………. negation law
≡ t ………………. Domination law
So (p ∧ q) → (p ∨ q) ≡ t
Example: Show that ~(p→q) → p is a tautology without using truth tables.
Operations on Set
Union:
Let A and B be subsets of a universal set U. The union of sets A and B is the set
of all elements in U that belong to A or to B or to both, and is denoted A ∪ B.
Symbolically:
A ∪ B = {x ∈U | x ∈A or x ∈ B}
Example:
Let U = {a, b, c, d, e, f, g}
A = {a, c, e, g}, B = {d, e, f, g}
Then A ∪ B = {x ∈U | x ∈A or x ∈ B}
={a, c, d, e, f, g}
Intersection:
Let A and B subsets of a universal set U. The intersection of sets A and B is the
set of all elements in U that belong to both A and B and is denoted A ∩ B.
Symbolically:
A ∩ B = {x ∈U | x ∈ A and x ∈B}
EXMAPLE:
Let U = {a, b, c, d, e, f, g} A = {a, c, e, g}, B = {d, e, f, g}
Then A ∩ B = {e, g}
Difference:
Let A and B be subsets of a universal set U. The difference of “A and B” (or
relative complement of B in A) is the set of all elements in U that belong to A but
not to B, and is denoted A – B or A \ B.
Symbolically:
A – B = {x ∈U | x ∈ A and x∉B}
EXAMPLE:
Let U = {a, b, c, d, e, f, g} A = {a, c, e, g}, B = {d, e, f, g}
Then A – B = {a, c}
Complement:
Let A be a subset of universal set U. The complement of A is the set of all
element in U that do not belong to A, and is denoted Á or Ac .
Symbolically:
Ac = {x ∈U | x ∉A}
EXAMPLE:
Let U = {a, b, c, d, e, f, g]
A = {a, c, e, g}
Then Ac = {b, d, f}
Power Set
Given a set S, the power set of S is the set of all subsets of the set S. The power set of S is
denoted by P(S).
Example-What is the power set of the set {0, 1, 2}?
Solution: let A={0,1,2} The power set P(A) is the set of all subsets of {0, 1, 2}. Hence,
Partitioning of a Set
Partition of a set, say S, is a collection of n disjoint subsets, say P1,P2,…Pn that satisfies the following three
conditions −
Pi does not contain the empty set. [Pi≠{∅} for all 0<i≤n]
The union of the subsets must equal the entire original set. [P1∪P2∪⋯∪Pn=S]
The intersection of any two distinct sets is empty. [Pa∩Pb={∅}, for a≠b]
Partition of a Set
Example-
Let S={a,b,c,d,e,f,g,h}
One probable partitioning is {a},{b,c,d},{e,f,g,h}
Another probable partitioning is {a,b},{c,d},{e,f,g,h}
Bell Numbers
Bell numbers give the count of the number of ways to partition a set. They are denoted by BnBn where n is the
cardinality of the set.
Example −
Let S={1,2,3}S={1,2,3}, n=|S|=3n=|S|=3
The alternate partitions are −
1. ∅,{1,2,3}∅,{1,2,3}
2. {1},{2,3}{1},{2,3}
3. {1,2},{3}{1,2},{3}
4. {1,3},{2}{1,3},{2}
5. {1},{2},{3}{1},{2},{3}
Hence B3=5
Binary relation
Let A and B be sets. The binary relation R from A to B is a subset of A × B. When (a, b) ∈R, we say ‘a’ is related to
‘b’ by R, written aRb. Otherwise, if (a, b) ∉R, we write a R b.
EXAMPLE:
Let A = {1, 2}, B = {1, 2, 3}
Then A × B = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}
Let
R1={(1,1), (1, 3), (2, 2)}
R2={(1, 2), (2, 1), (2, 2), (2, 3)}
R3={(1, 1)}
R4= {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}
R5= ∅
All being subsets of A × B are relations from A to B.
Domain of a relation
The domain of a relation R from A to B is the set of all first elements of the ordered pairs which belong to R
denoted by Dom(R). Symbolically,
Dom (R) = {a ∈A | (a, b) ∈R}
Range of a relation
The range of a relation R from A to B is the set of all second elements of the ordered pairs which belong to R
denoted Ran(R).
Symbolically,
Ran(R) = {b ∈B | (a, b) ∈ R}
Combining Relations
Because relations from A to B are subsets of A × B, two relations from A to B can be combined in any way two
sets can be combined.
Example - Let A = {1, 2, 3} and 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)},
R1 − R2 = {(2, 2), (3, 3)},
R2 − R1 = {(1, 2), (1, 3), (1, 4)}.
Partition of a Set
Covering of Set
Covering of a set, say S, is a collection of n subsets, say P1,P2,…Pn that satisfies the following two conditions:
Pi does not contain the empty set. [Pi≠ {∅} for all 0<i≤n]
The union of the subsets must equal the entire original set. [P1∪P2∪⋯∪Pn=S]
Example- Let S= {a, b, c}, A= {{a, b}, {b, c}}and F={{a}, {b, c}}
Set A is a covering set of S since {a, b}∪{b, c} =S and Set F is a partition of S since it satisfies all three
conditions.
Equivalence Relation
A relation R in a set A is called equivalence relation if:
It is reflexive
It is symmetric
It is transitive
Example- let X={1,2,3} and a relation R on X is R={(1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), (3,3)}
then determine R is an equivalence relation.
Ans: Yes! R is an equivalence relation because
R is reflexive as for all “a” (a, a)∈ R
R is symmetric as for (a, b) ∈ R there exist (b, a) ∈ R .
R is transitive as (a, b) ∈ R and (b, c) ∈ R there exist (a, c ) ∈ R .
Representation of relations
Matrix representation of a relation
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 .
Example- Suppose that A = {1, 2, 3} and B = {1, 2}. Let R be the relation from A to B such that R = {(2, 1),
(3, 1), (3, 2)} then represent R in matrix form.
Ans:
B 1 2
Digraph
There is another important way of representing a relation using a pictorial representation. Each element of the
set is represented by a point, and each ordered pair is represented using an arc with its direction indicated by an
arrow. We use such pictorial representations when we think of relations on a finite set as directed graphs, or
digraphs.
Example- The directed graph of the relation R = {(1, 1), (1, 3), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (4, 1)} on the
set {1, 2, 3, 4} is:
Product Rule
Suppose that a procedure can be broken down into a sequence of two tasks. If there are m ways to do the first
task and for each of these ways of doing the first task, there are n ways to do the second task, then there are m.n
ways to do the procedure.
Example:
In a class there are 3 boys and 2 girls, then if a boy and girl have to be chosen for monitor, the students can
choose class monitor in 3x2=6 ways.
Difference Rule
If a task can be done in either n1 ways or n2 ways, then the number of ways to do the task is n1 + n2 minus the
number of ways to do the task that are common to the two different ways. The subtraction rule is also known as
the principle of inclusion–exclusion.
|A1 ∪ A2| = |A1| + |A2| − |A1 ∩ A2|.
Example- How many bit strings of length eight either start with a 1 bit or end with the two bits 00?
128 + 64 − 32 = 160
(In Progress…………………..)