Lecture Notes Discrete Unit 1
Lecture Notes Discrete Unit 1
1 Set Theory
Sets:
Definition: - A set is a collection of well-defined and different elements. A set can be written
explicitly by listing its elements using curly bracket.
A set is typically determined by its distinct elements, or members, by which we mean that the
order does not matter, and if an element is repeated several times, we only care about one
instance of the element. We typically use the bracket notation { } to refer to a set.
Example: The sets {1, 2, 3} and {3, 1, 2} are the same, because the ordering does not matter.
The set {1, 1, 1, 2, 3, 3, 3} is also the same set as {1, 2, 3}, because we are not interested in
repetition: either an element is in the set, or it is not, but we do not count how many times it
appears.
Representation of a Set:
Roster or Tabular Form: The set is represented by listing all the elements comprising it. The elements are enclosed within
braces and separated by commas.
Set Builder Notation: -The set is defined by specifying a property that elements of the set
have in common. The set is described as A = {x: p(x)}
Example 2.4: The set {1, 3, 5, 7, 9} is written as: B ={x: 1≤x<10 and (x%2) ≠ 0}
Cardinality of a Set: Cardinality of a set S, denoted by |S|, is the number of distinct elements
of the set. The number is also referred as the cardinal number. If a set has an infinite number
of elements, its Cardinality is ∞.
Example 1: Let, X = {1, 2, 3, 4, 5, 6} and Y = {1, 2}. Here set Y is a subset of set X as all the
elements of set Y is in set X. Hence, we can write Y ⊆ X.
Example 2: Let, X = {1, 2, 3} and Y = {1, 2, 3}. Here set Y is a subset (Not a proper subset) of
set X as all the elements of set Y is in set X. Hence, we can write Y ⊆ X.
Proper Subset: The term “proper subset” can be defined as “subset of but not equal to”. A
Set X is a proper subset of set Y (Written as X ⊂ Y) if every element of X is an element of set Y
and |X| < |Y|.
Example: Let, X = {1, 2, 3, 4, 5, 6} and Y = {1, 2}. Here set Y⊂X since all elements in Y are
contained in X too and X has at least one element is more than set Y.
Note:
Types of Sets:
Sets can be classified into many types. Some of which are finite, infinite, universal, singleton
set, etc.
Finite Set: A set which contains a definite number of elements is called a finite set.
Infinite Set: A set which contains infinite number of elements is called an infinite set.
Universal Set: It is a collection of all elements in a particular context or application. All the
sets in that context or application are essentially subsets of this universal set. Universal sets
are represented as U.
Example: We may define U as the set of all animals on earth. In this case, set of all mammals
is a subset of U, set of all fishes is a subset of U, set of all insects is a subset of U, and so on.
Empty Set or Null Set: An empty set contains no elements. It is denoted by ∅. As the number
of elements in an empty set is finite, empty set is a finite set.The Cardinality of empty set or
null set is zero.
Singleton Set or Unit Set: Singleton set or unit set contains only one element. A singleton
set is denoted by {s}.
Example: If A = {1, 2, 6} and B = {6, 1, 2}, they are equal as every element of set A is an element
of set B and every element of set B is an element of set A.
Equivalent Set: If the cardinalities of two sets are same, they are called equivalent sets.
Example: If A = {1, 2, 6} and B = {16, 17, 22}, they are equivalent as cardinality of A is equal to
the cardinality of B. i.e. |A|=|B|=3
Disjoint Set: Two sets A and B are called disjoint sets if they do not have even one element
in common.
Overlapping Set: Two sets that have at least one common element are called overlapping
sets.
Example: Let, A = {1, 2, 6} and B = {6, 12, 42}. There is a common element ‘6’; hence these sets
are overlapping sets.
Venn Diagrams:
Venn diagram, invented in 1880 by John Venn, is a schematic diagram that shows all possible
logical relations between different mathematical sets.
In Venn-diagrams the universal set U is represented by point within a rectangle and its subsets
are represented by points in closed curves (usually circles) within the rectangle.
Examples:
Set Operations:
Set Operations include Set Union, Set Intersection, Set Difference, Complement of Set, and
Cartesian product.
Set Union: The union of sets A and B (denoted by A ∪ B) is the set of elements which are in A,
in B, or in both A and B. Hence, A∪B = {x | x ∈A or x ∈B}.
Example: If A = {10, 11, 12, 13} and B = {13, 14, 15}, then A∪B = {10, 11, 12, 13,14, 15}. (The
common element occurs only once)
Set Intersection: The intersection of sets A and B (denoted by A ∩ B) is the set of elements
which are in both A and B. Hence, A∩B = {x | x ∈A and x ∈B}.
Example: If A = {11, 12, 13} and B = {13, 14, 15}, then A∩B = {13}.
Disjoint Sets: Two sets A and B are called disjoint sets if they do not have even one element
in common i.e.
n (A ∩ B) = ∅
Example: If A ={2,3} and B ={5,6} Here A and B do not have any common element.
Set Difference/ Relative Complement: The set difference of sets A and B (denoted by A–B)
is the set of elements which are only in A but not in B. Hence, A−B = {x | x ∈A and x ∉B}.
Example: If A = {10, 11, 12, 13} and B = {13, 14, 15}, then (A−B) = {10, 11, 12} and (B−A) =
{14,15}. Here, we can see (A−B) ≠ (B−A).
Complement of a Set: The complement of a set A (denoted by A’) is the set of elements
which are not in set A. Hence, A' = {x | x ∉A}.
More specifically, A'= (U–A) where U is a universal set which contains all objects.
Example: If A ={x | x belongs to set of odd integers} then A' ={y | y does not belong to set
of odd integers}
Hence, A ∆ B = (A – B) ∪ (B – A) = {x : x ∉ A ∩ B}.
Example: If A = {10, 11, 12, 13} and B = {13, 14, 15}, then (A−B) = {10, 11, 12} and (B−A) =
{14,15}.
A ∆ B = (A – B) ∪ (B – A) = {10,11,12,14,15}.
Algebra of Sets:
Algebra of sets explains the basic properties and laws of sets, i.e. the set -theoretic operations
of union, intersection, and complement. It also explains the relations of set equality and
set inclusion. Systematic procedure for evaluating expressions, along with performing
calculations which involve these operations and relations are included as well.
(a) A ∪ A = A
(b) A ∩ A = A
(b) A ∩ U = A
(a) A ∪ B = B ∪ A
(b) A ∩ B = B ∩ A
(a) A ∪ (B ∪ C) = (A ∪ B) ∪ C
(b) A ∩ (B ∩ C) = (A ∩ B) ∩ C
(a) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
(b) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
(a) (A ∪ B)C = AC ∩ BC
(b) (A ∩ B) C = AC ∪ BC
Example: Let A and B be the following subsets of the real numbers defined as A = {x: 0<x<5}
and B = {x: 2<x<8}. Express A U B as the union of three disjoint sets.
As A U B = (A - B) U ( B - A) U (A ∩ B).
Duality:
Suppose E is an equation of set algebra, the dual E* of E is the equation obtained by replacing
Illustrative Examples:
Solution:
Example 2: What is the cardinality of P = the set of English names for the months of the year?
Solution: The cardinality of this set is 12, since there are 12 months in the year.
Sometimes we may be interested in the cardinality of the union or intersection of sets, but
not know the actual elements of each set. This is common in surveying
Example 3: A survey asks 200 people “What beverage do you drink in the morning”, and offers
choices:
Suppose 20 report tea only, 80 report coffee only, 40 report both. How many people drink
tea in the morning? How many people drink neither tea or coffee?
Solution: This question can most easily be answered by creating a Venn diagram.
We can see that we can find the people who drink tea by adding those who drink only tea to
those who drink both: 60 people.
We can also see that those who drink neither are those not contained in the any of the three
other groupings, so we can count those by subtracting from the cardinality of the universal
set, 200.
Definition. Let A be any set. The power set of A is the set P(A) = {B | B ⊂ A}. In words, the
power set of A is the set of all the subsets of A.
Note:
1) For any set A we have ∅ ∈ P(A) and A ∈ P(A), so P(A) is non empty for every set A.
As each element has two possibilities (present or absent}, possible subsets are 2×2×2.. n times
= 2n. Therefore, power set contains 2n elements.
Example: Is it true that power set of A U B is equal to union of power sets of A and B? Justify.
P(B) = {Ø , { c } }
P(A) U P(B) = { Ø , { a } , { b } , { c } , { a , b } }
Whereas
P(A U B) = { Ø , { a } , { b } , { c } , { a , b } , { a , c } , { b , c } , { a , b , c } }
A set is called countable when its element can be counted. A countable set can be finite or
infinite.
Example: set S(1) = {a, e, i, o, u} representing vowels is a countably finite set. However, S(2) =
{1, 2, 3……} representing set of natural numbers is a countably infinite set.
Note:
Example: Set S(1) representing vowels has 5 elements and its power set contains 2^5 = 32
elements. Therefore, it is finite and hence countable.
Example: Set S(2) representing set of natural numbers is countably infinite. However, its
power set is uncountable.
A set is called uncountable when its element can’t be counted. An uncountable set can be
always infinite.
Motivation Among many of the counting techniques, the principle of inclusion and exclusion
is considered as a basic counting tool. It has a wide area of applications such as counting
derangements, counting a number of onto functions, counting intersections, Euler’s φ
function, graph coloring, Rook polynomials, and many more. Let us understand it with an
example.
For two sets A and B, the principle states: |A ∪ B| = |A| + |B| – |A∩B|
Proof: We know that A ∪ B is the union of three disjoint sets A-B, A∩B, and B-A.
= |A ∪ B|+|A∩B|
Hence Proved.
Prove: For two disjoint sets A and B, the principle states: |A ∪ B| = |A| + |B|.
Proof: Since A and B are disjoint sets, then A∩B=Ø => |A∩B|=0
Hence Proved.
For three sets A, B and C, the principle states:
Example: Suppose that 100 of 120 students at a college take at least one of the languages
French, German and Russian, also suppose 65 study French, 45 study German, 42 study
Russian, 20 study French and German, 25 study French and Russian and 15 study German
and Russian. Find number of students who study all three languages and to fill in correct
number of students in each of the eight regions.
Solution: Let F, G and R denote the sets of students studying French, German and Russian
respectively. Then the Venn diagram shown as below:
100 = 65 + 45 + 42 – 20 – 25 – 15 + n(F∩G∩R)
Answer:
Let A be the set of integers from 1 to 100 that are multiples of 2, then ∣A∣=50.
Let B be the set of integers from 1 to 100 that are multiples of 3, then ∣B∣=33.
Now, A∩B is the set of integers from 1 to 100 that are multiples of both 2 and 3, and hence
are multiples of 6, implying ∣A∩B∣=16.
Hence, by PIE,
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣=50+33−16=67.
1 Counting problem
Consider the below problem. How many positive integers less than 100 is not a factor of 2,3
and 5?
For solving this problem at first we have to find the number of positive integers less than 100
which are divisible by 2 or 3 or 5.
|A ∪ B ∪ C| = |A| + |B| − |A ∩ B| − |B ∩ C| − |A ∩ C| + |A ∩ B ∩ C|
= 49+33+19-16-6-9+3 = 73
Lecture 1.1.5
Introduction:
Logic is the science of reasoning. It plays a vital role in any study involving reasoning. In
fact it is process by which
we arrive at a conclusion from known statements with the use of laws of logic. The
axiomatic approach to logic was
Many algorithms and proofs use logical expressions such as: “IF p THEN q” or “If p1 AND
p2, THEN q1 OR q2”
There fore it is necessary to know the cases in which these expressions are TRUE or
FALSE, that is, to know the“truth value” of such expressions.
We also investigate the truth value of quantified statements, which are statements which
use the logical quantifiers“for every” and “there exist.”
Proposition:
A proposition (or statement) is a declarative statement which is true or false, but not
both.
(i) Ice floats in water. (iii) 2 + 2 = 4 (v) Where are you going?
The first four are propositions, the last two are not. Also, (i) and (iii) are true, but (ii) and
(iv) are false.
Compound Propositions:
Many propositions are composite, that is, composed of sub propositions and various
connectives discussed
propositions are composite: “Roses are red and violets are blue.” and “John is smart or he
studies every night.” The fundamental property of a compound proposition is that its
truth value is completely determined by the truth values of its sub propositions together
with the way in which they are connected to form the compound propositions. The next
section studies some of these connectives.
Conjunction, p ∧q :
Any two propositions can be combined by the word “and” to form a compound
proposition called the conjunction of the original propositions. Symbolically, p ∧ q read
“p and q,” denotes the conjunction of p and q. Since p ∧ q is a proposition it has a truth
value, and this truth value depends only on the truth values of p and q.
Here, the first line is a short way of saying that if p is true and q is true, then p ∧ q is true.
The second line says that if p is true and q is false, then p ∧ q is false. And so on. Observe
that there are four lines corresponding to the four possible combinations of T and F for
the two sub propositions p and q. Note that p ∧ q is true only when both p and q are true.
The truth value of p ∧ q may be defined equivalently by the table in Fig. (a)
Only the first statement is true. Each of the others is false since at least one of its
substatements is false.
Disjunction, p ∨ q :
Any two propositions can be combined by the word “or” to form a compound proposition
called the disjunction of the original propositions. Symbolically, p ∨ q read “p or q,”
denotes the disjunction of p and q. The truth value of p ∨ q depends only on the truth
values of p and q as follows.
Remember: If p and q are false, then p ∨ q is false; otherwise p ∨ q is true.
The truth value of p ∨ q may be defined equivalently by the table in Fig. (b). Observe that
p ∨ q is false only in the fourth case when both p and q are false.
Only the last statement (iv) is false. Each of the others is true since at least one of its sub-
statements is true.
Negation, ¬p :
Given any proposition p, another proposition, called the negation of p, can be formed by
writing “It is not true that. .” or “It is false that . . .” before p or, if possible, by inserting in
p the word “not.” Symbolically, the negation of p, read “not p,” is denoted by ¬p.
The truth value of ¬p may be defined equivalently by the table in Fig. (c). Thus the truth
value of the negation of p is always the opposite of the truth value of p.
Example: Consider the following six statemets:
(a1) Ice floats in water. (a2) It is false that ice floats in water. (a3) Ice does not float in
water.
Then (a2) and (a3) are each the negation of (a1); and (b2) and (b3) are each the negation
of (b1). Since (a1) is true,
(a2) and (a3) are false; and since (b1) is false, (b2) and (b3) are true.
Remark: The logical notation for the connectives “and,” “or,” and “not” is not completely
standardized. For example,
1. p & q, p · q or pq for p ∧ q
2. p + q for p ∨ q
3. p', ¯p or ∼ p for ¬p.
Example: Let p be “It is cold” and let q be “It is raining”. Give a simple verbal sentence
which describes each of the
following statements:
In each case, translate ∧, ∨, and ∼ to read “and,” “or,” and “It is false that” or “not,”
respectively, and then simplify the
English sentence.
Solution:
Let P(p, q, . . .) denote an expression constructed from logical variables p, q, . . ., which take
on the value TRUE (T) or
FALSE (F), and the logical connectives ∧, ∨, and ¬ (and others discussed subsequently).
Such an expression P(p, q, . .
The main property of a proposition P(p, q, . . .) is that its truth value depends exclusively
upon the truth values of its
variables, that is, the truth value of a proposition is known once the truth value of each of
its variables is known.
A simple concise way to show this relationship is through a truth table. We describe a
way to obtain such a truth
table below.
Consider, for example, the proposition ¬(p∧¬q). Figure 1 (a) indicates how the truth
table of ¬(p∧¬q) is
constructed.
Observe that the first columns of the table are for the variables p, q, . . . and that there are
enough rows in the
table, to allow for all possible combinations of T and F for these variables. (For 2 variables,
as above, 4 rows are
necessary; for 3 variables, 8 rows are necessary; and, in general, for n variables, 2n rows
are required.)
There is then a column for each “elementary” stage of the construction of the proposition,
the truth value at each
step being determined from the previous stages by the definitions of the connectives ∧,
∨, ¬. Finally we obtain the
truth value of the proposition, which appears in the last column.The actual truth table of
the proposition ¬(p∧¬q)
is shown in Fig. 1(b). It consists precisely of the columns in Fig. 4(a) which appear under
the variables and under the
proposition; the other columns were merely used in the construction of the truth table.
the logical connectives. Specifically, ¬has precedence over ∧ which has precedence over
∨.
Lecture 1.2.1
Some propositions P(p, q, . . .) contain only T in the last column of their truth tables or, in other
words, they are true
for any truth values of their variables. Such propositions are called Tautologies.
Example: The proposition “p or not p,” that is, p ∨¬p, is a tautology, and the proposition “p
and not p,” i.e., p∧¬p,
is a contradiction. This is verified by looking at their truth tables in Fig. 1(a) represents
tautology and 1(b) represents
contradiction. (The truth tables have only two rows since each proposition has only the one
variable p.)
Note : The negation of a tautology is a contradiction since it is always false, and the
negation of a contradiction is a
Many statements, particularly in mathematics, are of the form “If p then q.” Such
statements are called Conditional
Another common statement is of the form “p if and only if q.” Such statements are called
Biconditional statements
Observe that:
(a) The conditional p → q is false only when the first part p is true and the second part q
is false. Accordingly, when p is false, the conditional p → q is true regardless of the truth
value of q.
(b) The biconditional p ↔ q is true whenever p and q have the same truth values and false
otherwise.
Image: Fig. 3
(b) The statement is equivalent to: “If Marc passes the test, then he studied.” Thus its
Contrapositive is:
If Marc does not study, then he will not pass the test.
Example: 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.
Image: Fig. 4
Lecture 1.2.2
3. If asked to find the Converse, Contrapositive, or Negation, perform the operation now.
4. If asked to translate back to English, replace operators and variables with appropriate
words.
p “The message is scanned for viruses” and q “The message was sent from an unknown
system” together with logical connectives (including negations).
Solution:
a “The message is scanned for viruses whenever the message was sent from an unknown
system.” q → p
b “The message was sent from an unknown system but it was not scanned for viruses.” q ∧
¬p
c “When a message is not sent from an unknown system it is not scanned for viruses.” ¬q →
¬p
Example: If you are older than 13 or you are with your parents then you can attend a seminar.
Solution: If ( you are older than 13 or you are with your parents ) then ( you can attend a
seminar).
Propositions: A= you are older than 13, B= you are with your parents, C= you can attend a
seminar.
Translation: A ∨ B → C
Look for patterns corresponding to logical connectives in the sentence and use them to define
elementary propositions.
Example: You can have free coffee if you are senior citizen and it is a Tuesday.
Solution:
Step 1 Find logical connectives i.e. You can have free coffee if you are senior citizen and it is
a Tuesday
Logical Equivalence:
Two propositions P(p, q, . . .) and Q(p, q, . . .) are said to be logically equivalent, or simply
equivalent or equal,
Example: The truth tables of ¬(p ∧ q) and ¬p ∨¬q appearing in Fig. 1(a) and 1(b) are the
same, that is, both
propositions are false in the first case and true in the other three cases.
Accordingly, we can write ¬(p ∧ q) ≡ ¬p ∨¬q. In other words, the propositions are logically
equivalent.
Let S be the statement: “It is not true that roses are red and violets are blue. ”
Then S can be written in the form ¬(p ∧ q). However, as noted above, ¬(p ∧ q) ≡ ¬p ∨ ¬q.
Accordingly, S has the same meaning as the statement: “Roses are not red, or violets are not
blue.”
Solution: Again, this can be checked with the truth tables in Fig. 2 :
Image: Fig. 2
Algebra of Propositions: Propositions satisfy various laws which are listed in Fig. 3. (In this
table, T and F are
restricted to the truth values “True” and “False,” respectively.)We state this result formally.
Lecture1.2.3
Let A be a given set. A propositional function (or an open sentence or condition) defined on A
is an expression p(x) which has the property that p(a) is true or false for each a ∈ A. That is,
p(x) becomes a statement (with a truth
value) whenever any element a ∈ A is substituted for the variable x. The set A is called the
domain of p(x), and the set Tp of all elements of A for which p(a) is true is called the truth set
of p(x). In other words, Tp = {x | x ∈ A, p(x) is true} or Tp = {x | p(x)}.
Frequently, when A is some set of numbers, the condition p(x) has the form of an equation or
inequality involving the variable x.
Example: Find the truth set for each propositional function p(x) defined on the set N of
positive integers.
(a) Let p(x) be “x + 2 > 7.” Its truth set is {6, 7, 8, . . .} consisting of all integers greater than 5.
(b) Let p(x) be “x + 5 < 3.” Its truth set is the empty set . That is, p(x) is not true for any integer
in N.
(c) Let p(x) be “x + 5 > 1.” Its truth set is N. That is, p(x) is true for every element in N.
Remark: The above example shows that if p(x) is a propositional function defined on a set A
then p(x) could be true for all x ∈ A, for some x ∈ A, or for no x ∈ A. The next two subsections
discuss quantifiers related to such propositional functions.
Quantifiers:
Universal Quantifier:
which reads “For every x in A, p(x) is a true statement” or, simply, “For all x, p(x).” The symbol
∀ which reads “for all” or “for every” is called the universal quantifier. The statement (1) is
equivalent to the statement
Tp = {x | x ∈ A, p(x)} = A ---------------(2)
that is, that the truth set of p(x) is the entire set A.
The expression p(x) by itself is an open sentence or condition and therefore has no truth
value. However,
∀x p(x), that is p(x) preceded by the quantifier ∀, does have a truth value which follows from
the equivalence of (1) and (2). Specifically:
Example:
(a) The proposition (∀n∈ N)(n + 4 > 3) is true since {n | n + 4 > 3} = {1, 2, 3, . . .} = N.
(b) The proposition (∀n∈ N)(n + 2 > 8) is false since {n | n + 2 > 8} = {7, 8, . . .} ≠ N.
Existential Quantifier:
which reads “There exists an x in A such that p(x) is a true statement” or, simply, “For some x,
p(x).” The symbol ∃ which reads “there exists” or “for some” or “for at least one” is called the
existential quantifier. Statement (3) is equivalent to the statement
Tp = {x | x ∈ A, p(x)} ≠ Ø -----------(4)
i.e., that the truth set of p(x) is not empty. Accordingly, ∃x p(x), that is, p(x) preceded by the
quantifier ∃, does
Example:
(a) The proposition (∃n ∈ N)(n + 4 < 7) is true since {n | n + 4 < 7} = {1, 2} ≠ Ø.
Negation of Quantified Statements: Consider the statement: “All math majors are male.”
Its negation reads: “It is not the case that all math majors are male” or, equivalently, “There
exists at least one math major who is a female (not male)”
Symbolically, using M to denote the set of math majors, the above can be written as
Example:
Remark: The expression ¬p(x) has the obvious meaning: “The statement ¬p(a) is true when
p(a) is false, and vice versa”
Similarly, p(x) ∧ q(x), read “p(x) and q(x),” is defined by: “The statement p(a) ∧ q(a) is true when
p(a) and q(a) are true”
Similarly, p(x) ∨ q(x), read “p(x) or q(x),” is defined by: “The statement p(a) ∨ q(a) is true when
p(a) or q(a) is true”
Counterexample: A statement ∀x, p(x) is false, it is equivalent to show that ∃ x¬ p(x) is true
or, in other words,
that there is an element d with the property that p(d) is false. Such an element d is called a
counterexample to the statement ∀x, p(x).
Example:
(a) Consider the statement ∀x ∈ R, |x| ≠ 0. The statement is false since 0 is a counterexample,
that is, |0| ≠ 0 is not true.
(b) Consider the statement ∀x ∈ R, x2 ≥ x. The statement is not true since, for example, 1/2 is
a counterexample.
Specifically, (1/2)2 ≥ 1/2 is not true, that is, (1/2)2 < 1/2.
(c) Consider the statement ∀x ∈ N, x2 ≥ x. This statement is true where N is the set of positive
integers.
In other words, there does not exist a positive integer n for which n2 < n.
Solution:
(a) At least one student does not live in the dormitories. (Some students do not live in the
dormitories.)
(b) At least one mathematics major is female. (Some mathematics majors are female.)
(c) None of the students is 25 years old or older. (All the students are under 25.)
Example: Let A = {1, 2, 3, 4, 5}. Determine the truth value of each of the following statements:
Solution:
Basic Principle: A propositional function preceded by a quantifier for each variable, for
example,
Example: Let B = {1, 2, 3, . . . , 9} and let p(x, y) denote “x +y = 10.” Then p(x, y) is a propositional
function on A = B2 = B × B.
(a) The following is a statement since there is a quantifier for each variable:
∀ x ∃ y, p(x, y), that is, “For every x, there exists a y such that x + y = 10”
∃ y ∀ x, p(x, y), that is, “There exists a y such that, for every x, we have x + y = 10”
Note: The only difference between (a) and (b) is the order of the quantifiers. Thus a different
ordering of the
quantifiers may yield a different statement.We note that, when translating such quantified
statements into English, the expression “such that” frequently follows “there exists.”
Example: Determine the truth value of each of the following statements where U = {1, 2, 3} is
the universal set:
(a) ∃x ∀y, x2 < y + 1; (b) ∀x ∃y, x2 + y2 < 12; (c) ∀x ∀y, x2 + y2 < 12.
Solution:
(b) True. For each x0, let y = 1; then x02 + 1 < 12 is a true statement.
(c) False. For if x0 = 2 and y0 = 3, then x02 + y02 < 12 is not a true statement.
Example: Let M(x) be “x is mammal.” let A(x) be “ x is a animal” and let W(x) be, “x is warm
blooded.”
Solution: We have
M(x): x is mammal
A(x) : x is an animal
Lecture 1.2.4
Rules of Inference
Arguments:
An argument is a set of statements, one of which is called the conclusion and the rest of
which are called premises.
An argument is said to be valid if the conclusion must be true whenever the premises are
all true. An argument is invalid if it is not valid; it is possible for all the premises to be true
and the conclusion to be false.
p1
p2
...
pn
______
∴q
OR
p1, p2, . . . , pn / ∴ q
The argument is called valid if q is true whenever p1, p2, . . . , pn are true; otherwise it is
called invalid.
Theorem: The argument p1, p2, . . . , pn / ∴ q is valid if and only if the proposition (p1 ∧
p2 . . .∧ pn) → q is a Tautology.
Example: A fundamental principle of logical reasoning states: “If p implies q and q implies
r, then p implies r”.
Solution: This fact is verified by the truth table in Fig. 1 which shows that the following
proposition is a tautology:
We now apply the above theory to arguments involving specific statements. We emphasize
that the validity of an argument does not depend upon the truth values nor the content of
the statements appearing in the argument, but upon the particular form of the argument.
This is illustrated in the following example:
Solution: Here the statement T below the line denotes the conclusion of the argument, and
the statements S1 and S2 above the line denote the premises. We claim that the argument
S1, S2 / ∴ S is valid. For the argument is of the form
p → q, q → r / ∴ p → r
where p is “He is a bachelor,” q is “He is unhappy” and r is “He dies young;” and by above
example this argument
q : I study
r : I pass mathematics
Rules of Inference:
The main function of logic is to provide rules of inference, or principles of reasoning. The
theory associated with such rules is known as inference theory because it is connected
with the inferring of a conclusion from certain premises. When a conclusion is derived
from a set of premises by using the accepted rules of reasoning, then such a process of
derivation is called a deduction or a formal proof. An important difference between the
reasoning used in any general discussion and that the premises used are believed to be
true either from experience or from faith, and if proper rules are followed, then one
expects the conclusion to be true. In mathematics, one is solely concerned with
conclusion which is obtained by following the rules of logic. In any argument, a conclusion
is admitted to be true provided that the premises (assumptions, axioms and hypotheses)
are accepted as true and the reasoning used in deriving the conclusion from the premises
follows certain accepted rules of logical inference.
Rules of inference are certain simple arguments known to be valid and used to make a
proof step by step. A number of valid arguments are very common and are given names.
Example: Consider the following statements: “I take the bus or I walk. If I walk I get tired.
I do not get tired.
Solution: We can formalize this by calling B = “I take the bus”, W = “I walk” and T = “I get
tired”. The premises are
B v W, W → T and ¬T, and the conclusion is B. The argument can be described in the
following steps:
Lecture 1.3.1
For example: 13 +23 + 33 + ….. +n3 = (n(n+1) / 2)2, the statement is considered here as true for all
the values of natural numbers.
Consider a statement P(n), where n is a natural number. Then to determine the validity of P(n)
for every n, use the following principle:
Step 2: Assume that the given statement P(n) is also true for n = k, where k is any positive
integer.
Step 3: Prove that the result is true for P(k+1) for any positive integer k.
If the above-mentioned conditions are satisfied, then it can be concluded that P(n) is true for
all n natural numbers.
The first step of the principle is a factual statement and the second step is a conditional one.
According to this if the given statement is true for some positive integer k only then it can be
concluded that the statement P(n) is valid for n = k + 1.
This is also known as the inductive step and the assumption that P(n) is true for n=k is known
as the inductive hypothesis.
Example 1: Prove that the sum of cubes of n natural numbers is equal to ( n(n+1)2)2 for
all n natural numbers.
Solution:
In the given statement we are asked to prove:
13+23+33+⋯+n3 = (n(n+1)2)2
Step 1: Now with the help of the principle of induction in math let us check the validity of the
given statement P(n) for n=1.
Step 2: Now as the given statement is true for n=1 we shall move forward and try proving this
for n=k, i.e.,
13+23+33+⋯+k3= (k(k+1)2)2 .
13+23+33+⋯+k3+(k+1)3 = (k(k+1)2)2+(k+1)3
⇒13+23+33+⋯+k3+(k+1)3=k2(k+1)4+(k+1)3
= k2(k+1)2+4((k+1)3)4
=(k+1)2(k2+4(k+1))4
=(k+1)2(k2+4k+4)4
= (k+1)2((k+2)2)4
=(k+1)2(k+1+1)2)4
=(k+1)2((k+1)+1)2)4
Solution:
1 + 3 + 5 + … + (2k−1) = k2
k2 + (2(k+1)−1) = (k+1)2
k2 + 2k + 2 −1 = (k+1)2
k2 + 2k + 1 = (k+1)2
(k+1)2 = (k+1)2
We see that the given statement is also true for n=k+1. Hence we can say that by the principle
of mathematical induction this statement is valid for all natural numbers n.
Example 3:
Thus, the statement can be written as P(k) = 22n-1 is divisible by 3, for every natural number
Step 2: Now, assume that P(n) is true for all the natural number, say k
Hence,
P(k+1) = 22(k+1)-1
P(k+1)= 22k+2-1
P(k+1)= 22k. 22 – 1
P(k+1) =3.22k + 3a
It is proved that p(k+1) holds true, whenever the statement P(k) is true.
Lecture 1.3.2
Introduction to Counting principles
This chapter develops some techniques for determining, without direct enumeration, the
number of possible outcomes of a particular event or the number of elements in a set. Such
sophisticated counting is sometimes called Combinatorial Analysis. It includes the study of
Permutations and Combinations.
One of the first things you learn in mathematics is how to count. Now we want to count large
collections of things quickly and precisely.
There are two basic counting principles used throughout this chapter. The first one involves
addition and the second one multiplication.
Suppose some event E can occur in m ways and a second event F can occur in n ways, and
suppose both events cannot occur simultaneously. Then E or F can occur in m + n ways.
The above principles can be extended to three or more events. That is, suppose an event A
can occur in m ways, a second event B can occur in n ways, and, a third event C can occur in
r ways, and so on.
Then If no two events can occur at the same time, then one of the events can occur in: m + n
+ r +· · · ways.
Example: How many two letter words start with one of the 5 vowels?
Solution: There are 26 two letter words starting with A, another 26 starting with E, and so on.
We will have 5 groups of 26. So we add 26 to itself 5 times i.e 26 + 26+ 26 + 26 + 26 = 130 ways.
Note: It is important that the events be disjoint: i.e., that there is no way for A and B to both
happen at the same time.
Example: A standard deck of 52 cards contains 26 red cards and 12 face cards. However, the
number of ways to select a card which is either red or a face card is not 26 + 12 = 38. This is
because there are 6 cards which are both red and face cards.
Example: In Fast Food stall you have 14 choices for donuts, 16 for hot dogs, and 15 choices
for waffles. If you want either a donut or a hot dog or waffle. How many choices do you have
now?
Suppose there is an event E which can occur in m ways and, independent of this event, there
is a second event F which can occur in n ways. Then combinations of E and F can occur in m
× n ways.
The above principles can be extended to three or more events. That is, suppose an event A
can occur in m ways, a second event B can occur in n ways, and, a third event C can occur in
r ways, and so on.
If the events occur one after the other, then all the events can occur in the order indicated in:
m × n × r × · · · ways.
Example: A boy lives at X and wants to go to School at Z. From his home X he has to first reach
Y and then Y to Z.
He may go X to Y by either 3 bus routes or 2 train routes. From there, he can either choose 4
bus routes or 5 train routes to reach Z. How many ways are there to go from X to Z?
Example: Suppose a college has 3 different history courses, 4 different literature courses, and
2 different sociology courses.
(a) The number m of ways a student can choose one of each kind of courses is: m = 3 (4) (2) =
24.
(b) The number n of ways a student can choose just one of the courses is: n = 3 + 4 + 2 = 9.
Lecture 1.3.3
Linear Permutation
Here We will discuss two important Mathematical functions frequently used in Combinatorics.
Factorial Function:
The product of the positive integers from 1 to n inclusive is denoted by n!, read “n factorial.”
Namely:
Permutations:
Any arrangement of a set of n objects in a given order is called a permutation of the object
(taken all at a time).
(i) The permutations of the letters a, b, c are the following: abc, acb, bac, bca, cab, cba.
(ii) The permutations of size 2 of the letters a, b, c, d are: ab, ac, ad, ba, bc, bd, ca, cb, cd, da,
db, dc.
For instance, there are 3! = 6 permutations of the 3 letters a, b, c. The number of permutations
of size 2 of the 4
We usually are interested in the number of such permutations without listing them.
Note: It is important to remember that order counts in Permutation i.e. ab is different from
ba.
Example: Find the number m of permutations of six objects, say, A, B, C, D, E, F, taken three
at a time.
In other words, find the number of “three-letter words” using only the given six letters without
repetition.
Solution: Let us represent the general three-letter word by the following three positions:
——, ——, ——
The first letter can be chosen in 6 ways; following this the second letter can be chosen in 5
ways; and, finally, the third letter can be chosen in 4 ways. Write each number in its
appropriate position as follows: 6 , 5 , 4
By the Product Rule there are m = 6 · 5 · 4 = 120 possible three-letter words without repetition
from the six letters. Namely, there are 120 permutations of 6 objects taken 3 at a time.
Ordered Samples:
Many problems are concerned with choosing an element from a set S, say, with n elements.
When we choose one element after another, say, r times, we call the choice an ordered
sample of size r. We consider two cases.
1) Sampling with replacement: Here the element is replaced in the set S before the next
element is chosen. Thus, each time there are n ways to choose an element (repetitions are
allowed). The Product rule tells us that the number of such samples is n · n · n · · · n · n(r
factors) = nr.
(2) Sampling without replacement: Here the element is not replaced in the set S before the
next element is chosen. Thus, there is no repetition in the ordered sample. Such a sample is
simply an r-permutation. Thus the number of such samples is P(n, r) = n(n − 1) (n − 2) · · · (n −
( r - 1)).
Example: Three cards are chosen one after the other from a 52-card deck. Find the number
m of ways this can be done: (a) with replacement; (b) without replacement.
Solution: (a) Each card can be chosen in 52 ways. Thus m = 52 (52) (52) = 140608.
(b) Here there is no replacement. Thus the first card can be chosen in 52 ways, the second in
51 ways, and the third in 50 ways. Therefore: m = P(52, 3) = 52 (51) (50) = 132 600.
Lecture 1.3.4
Combination
Thus the number of combinations multiplied by 3! gives us the number of permutations; that
is,
P(n, r) = r! C(n, r)
Example: A farmer buys 3 cows, 2 pigs, and 4 hens from a man who has 6 cows, 5 pigs, and
8 hens. Find the number m of choices that the farmer has.
Solution: The farmer can choose the cows in C(6, 3) ways, the pigs in C(5, 2) ways, and the
hens in C(8, 4) ways.
Example: You decide to have a dinner party. Even though you are incredibly popular and
have 14 different friends, you only have enough chairs to invite 6 of them.
2. What if you need to decide not only which friends to invite but also where to seat them
along your long table?
Solution: 1. You must simply choose 6 friends from a group of 14. This can be done in C
(14,6) ways. We can find as 14!/8!6!=3003 ways
2. Here you must count all the ways you can permute 6 friends chosen from a group of
14. So the answer is
Remember: How are these numbers related? Notice that P(14, 6) is much larger than C(14,
6). This makes sense C(14, 6) picks 6 friends, but P(14, 6) arranges the 6 friends as well as picks
them. In fact, we can say exactly how much larger P(14, 6) is. In both counting problems we
choose 6 out of 14 friends. For the first one, we stop there, at 3003 ways. But for the second
counting problem, each of those 3003 choices of 6 friends can be arranged in exactly 6! ways.
So now we have 3003 · 6! choices and that is exactly 2162160.