0% found this document useful (0 votes)
39 views122 pages

CSC 102 Midterm

Uploaded by

serialsora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views122 pages

CSC 102 Midterm

Uploaded by

serialsora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 122

CSC 102

Discrete Structures 1
CSC 102 - Discrete Structures 1

OBJECTIVES
UNDERSTAND THE BASIC
KNOW THE BASIC CONCEPTS
PRINCIPLES OF SETS AND
OF SET & SUBSETS
OPERATIONS IN SETS
DESIGN & PRESENTS THE SETS
ELEMENTS VIA VENN PROVE BASIC SET EQUALITIES
DIAGRAMS
PERFORM COUNTING
PERFORM SETS OPERATIONS PRINCIPLES ON SETS
FOR SOLVING PROBLEMS
RELATED TO IT
TOPIC 1. SET THEORY
CSC 102 - Discrete Structures 1

SETS, ELEMENTS
& SUBSETS
SET THEORY
CSC 102 - Discrete Structures 1

SETS
A set is a collection of
objects. Example: The equation
• Objects are sometimes A = {1, 2, 3, 4} (1.1.1)
referred to as elements or Describes a Set A made up of the four elements
1, 2, 3, and 4.
members.
CSC 102 - Discrete Structures 1

A set is determined by its


elements and not by any
particular order in which
the elements might be
listed.
Thus, the Set A might just as well be specified as A = { 1, 3, 4, 2}

SETS
CSC 102 - Discrete Structures 1

Example:
A set may contain any A = {4.5, Lady Gaga, 𝜋, 14}
kind of elements It consist of four elements:
whatsoever, and they the number 4.5, the
need not be of the person Lady Gaga, the
same “type”. number 𝜋(=3.1415…), and
the number 14.

SETS
CSC 102 - Discrete Structures 1

A set may contain elements


that are themselves sets.

Example: The set


{3, {5,1}, 12, {𝜋, 4.5, 40, 16},
Henry Cavill}
Consist of five elements: the
number 3, the set {5,1}, the
number 12, the set {𝜋, 4.5,
40, 16}, and the person
Henry Cavill.
SETS
CSC 102 - Discrete Structures 1

2 WAYS TO DESCRIBE SETS


ROSTER/TABULATION METHOD RULE / DESCRIPTIVE METHOD

To list its members inside Specify a set by a


braces, with elements characterizing property of an
element or defined a common
separated by commas.
characteristics, also known as,
Set-builder notation.
CSC 102 - Discrete Structures 1

EXAMPLES
ROSTER/TABULATION METHOD RULE / DESCRIPTIVE METHOD

A = { 3, 6, 9 } B = { x | x is an odd integer , x > 0 }

Read as A is equals to 3, 6, and 9. Read as B equals the set of all x such that x
is an odd positive integers.
The vertical line | is read as “such that”
and (,) as “and.” Note that the property
appears after the vertical line.

2 WAYS TO DESCRIBE SETS


CSC 102 - Discrete Structures 1

• The objects or numbers in a set are called the


elements or members (denoted by ∈) of the set.
• To describe sets with a convenient notation, we use
braces, { }, and name the sets with capital letters.
• A set that has a fixed number of elements such as {1,
2, 3} is a finite set, whereas a set without a fixed
number of elements such as the natural numbers is
an infinite set.
• When listing the elements of a set, we use a series of
three dots (or ellipsis) to indicate a continuing
pattern.
SETS
RELATIONSHIP OF SETS
CSC 102 - Discrete Structures 1

Subset. Set A is a subset EXAMPLE


of set B, if every element
of A is also an element of A = { 1, 2, 3, 4, 5 }
B. In this case, we write B = { 1, 2, 3 } = B ⊆ A
A ⊆ B. C = { 1, 4, 5 } = C ⊆ A
• Note: The empty set
∅ is considered a P(C) = 2n = 23 = 8
subset of all sets. = {1}, {4}, {5}, {1,4},
• Power Set, denoted {1,5}, {4,5}, {1, 4, 5}, ∅
by 2n is the number
of subsets of a given P(B) = 2n = 23 = 8
set where n is the = {1, 2, 3}, {1, 2}, {1,3},
cardinality of the set {2,3}, {1}, {2}, {3}, ∅
RELATIONSHIP OF SETS
CSC 102 - Discrete Structures 1

Equal Sets. sets with the same


elements, denoted by A = B,
if A ⊆ B and B ⊆ A.
EXAMPLE
Equivalent Sets. Sets with the same
• (1) {a, c, x} = {c, x, a}
number of elements, denoted by A ∼ B.
• (2) {a, 2, x} ≠ {a, c, x}
There is a one-on-one
correspondence between them.
EXAMPLE
(1) {a, 2, x} ∼ {x, y, z}
(2) {a, 2, x} ≁ {a, 2c}
RELATIONSHIP OF SETS
CSC 102 - Discrete Structures 1

Joint Sets. Sets with at least Disjoint Sets. Sets that have no
one common element. common element.
EXAMPLE EXAMPLE
Let A = {1, 2, 3, 6} and Let C = {x | x is the set of even
B = {1, 3, 9}. numbers}
A and B are Joint Sets. and let D = {x | x is the set of odd
numbers}.
C and D are Disjoint Sets.
CSC 102 - Discrete Structures 1

VENN DIAGRAMS & SET


OPERATIONS
SET THEORY
CSC 102 - Discrete Structures 1

VENN DIAGRAM EXAMPLE


Draw the Venn diagram.
Pictorial representation which Given the U = {a, b, c, d, e, f} and its subsets A
shows the relationships of a = {b, c, d}, B = {c, d}, and C = {a, b, d, f}.
given universal set and a
collection of some of its
subsets. The universal set is
usually represented by a
rectangular region, and its
subsets are represented by
circular regions.
CSC 102 - Discrete Structures 1

OPERATIONS ON SETS Intersection of sets A and B


[denoted by A ∩ B]. Set whose
Union of Sets A and B [denoted
elements are common to both
by A ∪ B].
sets.
• Set whose elements are
• In symbol:
found in A or B or in both.
A ∩ B = {x | x ∈ A and x ∈ B}.
• In symbol:
A ∪ B = {x | x ∈ A or x ∈ B}. EXAMPLE
EXAMPLE A = {a, b, c, d}, B = {c, d,
A = {a, b, c, d}, B = {c, d, e}, e}, find A ∩ B.
Find A ∪ B.
A ∩ B = { c, d }
A ∪ B = { a, b, c, d, e }
CSC 102 - Discrete Structures 1

Union of Sets Intersection of sets


CSC 102 - Discrete Structures 1

OPERATIONS ON SETS
EXAMPLE
Disjoint Union
A∩B=∅
Recall that sets A and B are said
Supposed, S = A ∪ B
to be disjoint or
Then S is called the disjoint union
nonintersecting if they have no
of A and B
elements in common.
CSC 102 - Discrete Structures 1

OPERATIONS ON SETS
Complement of set A [denoted EXAMPLE
by A’, Ac]. The set of elements Let U = {a, b, c, d, e} and its
found in the universal set but subsets A={a, b, c, d} and B = {c,
not in set A. d, e}. Find, A’.
• In symbol:
A’ = {x | x ∈ U and x ∉ A} U = {a, b, c, d, e} A={a, b, c, d}
A’ = { e }
CSC 102 - Discrete Structures 1

OPERATIONS ON SETS
Difference of sets A and B EXAMPLE
[denoted by A-B, A\B]. The A = {a, b, c, d}, B = {c, d, e},
set whose elements are found find A-B.
in set A but not in set B.
• In symbol: A – B = { a, b }
A – B = A ∩ B’ = B–A={e}
{x : x ∈ A and x ∉ B}
CSC 102 - Discrete Structures 1

OPERATIONS ON SETS
Symmetric Difference EXAMPLE
The symmetric difference of A = {1, 2, 3, 4, 5} B = {2, 5}
sets A and B, denoted by A ⊕ B, Find A ⊕ B
consists of those elements
which belong to A or B but not A ⊕ B = { 1, 3, 4 }
to both
• In symbol:
A ⊕ B = (A ∪ B)\(A ∩ B) or
A ⊕ B = (A\B) ∪ (B\A)
CSC 102 - Discrete Structures 1

Complement of Sets Difference of sets Symmetric


Difference of sets
CSC 102 - Discrete Structures 1

OPERATIONS ON SETS
Cartesian Product of two sets EXAMPLE
A and B, denoted by A×B. The Given A = {1, 2, 3} and B = {c, d}.
set of all ordered pairs (a, b) Find A × B and B × A.
where a ∈ A and b ∈ B.
• In rule form, A × B = {(1, c), (1, d), (2, c), (2, d), (3,
A × B = {(a, b) | a ∈ A and b ∈ B} c), (3, d)}

B × A = {(c, 1), (c, 2), (c, 3), (d, 1),


(d, 2), (d, 3)}
CSC 102 - Discrete Structures 1

ALGEBRA OF SETS AND


DUALITY
SET THEORY
CSC 102 - Discrete Structures 1

ALGEBRA OF SETS & DUALITY

The algebra of sets The concept of duality in


refers to a set of set theory is based on
operations that can the idea that for every
set operation, there is a
be performed on
corresponding dual
sets to create new operation that reflects
sets or analyze the operation in some
existing ones. way.
CSC 102 - Discrete Structures 1

Let U be a universal set


and let A, B, and C be F. Idempotent laws
subsets of U. G. Bound laws
The following properties H. Absorption laws
hold. I. Involution law
A. Associative laws J. 0/1 laws
B. Commutative laws K. De Morgan’s laws for
C. Distributive laws sets
D. Identity laws
E. Complement laws
SETS
CSC 102 - Discrete Structures 1

A. Associative laws: (A ∪ B) ∪ C = A ∪ (B ∪ C), (A ∩ B) ∩ C = A ∩ (B ∩ C)


B. Commutative laws: A ∪ B = B ∪ A, A ∩ B = B ∩ A
C. Distributive laws: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C), A ∪ (B ∩ C) = (A ∪
B) ∩ (A ∪ C)
D. Identity laws: A ∪ ∅ = A, A ∩ U = A
E. Complement laws: A ∪ A’ = U, A ∩ A’ = ∅
F. Idempotent laws: A ∪ A = A, A ∩ A = A
G. Bound laws: A ∪ U = U, A ∩ ∅ = ∅
H. Absorption laws: A ∪ (A ∩ B) = A, A ∩ (A ∪ B) = A
I. Involution law: (A’)’ = A
J. 0/1 laws: ∅’ = U, U’ = ∅

SETS
K. De Morgan’s laws for sets: (A ∪ B)’ = A’ ∩ B’ ,(A ∩ B)’ = A’ ∪ B’
CSC 102 - Discrete Structures 1

ASSOCIATIVE
A ∪ B = { 1, 2, 3, 4, 5 }
LAWS ∪ C = { 5, 6, 7 }
(A ∪ B) ∪ C = { 1, 2, 3, 4,
Associative Law for Union (∪):
5, 6, 7}
(A ∪ B) ∪ C = A ∪ (B ∪ C)
(B ∪ C) = { 3, 4, 5, 6, 7 }
EXAMPLE ∪ A = { 1, 2, 3 }
Set A = {1, 2, 3}
Set B = {3, 4, 5}
A ∪ (B ∪ C) = { 1, 2, 3, 4,
Set C = {5, 6, 7} 5, 6, 7 }
CSC 102 - Discrete Structures 1

ASSOCIATIVE
LAWS Associative Law for Intersection (∩):
(A ∩ B) ∩ C = A ∩ (B ∩ C)

EXAMPLE
Set A = {1, 2, 3} (A ∩ B) = { 3 } A ∩ = { 1, 2, 3}
Set B = {3, 4, 5} ∩ C = { 5, 6, 7 } (B ∩ C) = {5}
Set C = {5, 6, 7} (A ∩ B) ∩ C = {} A ∩ (B ∩ C) = {}
CSC 102 - Discrete Structures 1

COMMUTATIVE EXAMPLE
Set A = {1, 2, 3}
LAWS Set B = {3, 4, 5}

Commutative Law for Union (∪): A ∪ B = { 1, 2, 3, 4, 5 }

A∪B=B∪A B ∪ A = { 3, 4, 5, 1, 2 }

Commutative Law for Intersection (∩):


A∩B=B∩A
{3} = {3} A∩B=B∩A
CSC 102 - Discrete Structures 1

DISTRIBUTIVE
LAWS Distributive Law for Union (∪):

A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)

EXAMPLE (A ∪ B) = { 1, 2, 3, 4, 5}
(B ∩ C) = { 5 }
Set A = {1, 2, 3} (A ∪ C) = { 1, 2, 3, 5, 6, 7 }
A ∪ (B ∩ C) =
Set B = {3, 4, 5} (A ∪ B) ∩ (A ∪ C) =
Set C = {5, 6, 7} { 1, 2, 3, 5 }
{ 1, 2, 3, 5 }
CSC 102 - Discrete Structures 1

DISTRIBUTIVE
LAWS Distributive Law for Intersection (∩):

A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

EXAMPLE (B ∪ C) = (A ∩ B) = { 3 }
Set A = {1, 2, 3} { 3, 4, 5, 6, 7 } (A ∩ C) = { }
Set B = {3, 4, 5}
A ∩ (B ∪ C) = { 3 } (A ∩ B) ∪ (A ∩ C)
Set C = {5, 6, 7}
={3}
CSC 102 - Discrete Structures 1

IDENTITY LAWS EXAMPLE


Identity Law for Union (∪): Set A = {1, 2, 3}

A∪∅=A A ∪ ∅ = { 1, 2, 3 }

EXAMPLE
Identity Law for Intersection (∩): Let U = { 1, 2, 3, 4,
5, 6, 7 }
A∩U=A Set A = {1, 2, 3}

A ∩ U = { 1, 2, 3 }
CSC 102 - Discrete Structures 1

COMPLEMENT Complement Law for Intersection (∩):

LAWS A ∩ A’ = ∅
Complement Law for Union (∪):
EXAMPLE
A ∪ A’ = U Let U = { 1, 2, 3, 4,
5, 6, 7 }
EXAMPLE Set A = {1, 2, 3} A ∩ A’ = { }
Let U = { 1, 2, 3, 4, A’ = { 4, 5, 6, 7 }
5, 6, 7 } A ∪ A’ = { 1, 2, 3,
Set A = {1, 2, 3} 4, 5, 6, 7 }
CSC 102 - Discrete Structures 1

IDEMPOTENT Idempotent Law for Intersection (∩):

LAWS A∩A=A
EXAMPLE
Idempotent Law for Union (∪):
Set A = {1, 2, 3}
A∪A=A A ∩ A = { 1, 2, 3,}
EXAMPLE
Set A = {1, 2, 3}

A ∪ A = { 1, 2, 3,}
CSC 102 - Discrete Structures 1

BOUND LAWS
Bound Law for Union (∪): Bound Law for
Intersection (∩):
A∪U=U
EXAMPLE A∩∅=∅
Let U = { 1, 2, 3, 4,
EXAMPLE
5, 6, 7 }
Set A = {1, 2, 3}
Set A = {1, 2, 3}
A ∪ ∅ ={}
A ∪ U = { 1, 2, 3, 4, 5, 6, 7}
CSC 102 - Discrete Structures 1

ABSORPTION EXAMPLE
Set A = {1, 2, 3}
LAWS Set B = {3, 4, 5}
Absorption Law for
Absorption Law for Union (∪): Intersection (∩):

A ∪ (A ∩ B) = A A ∩ (A ∪ B) = A
A∩B={3} ( A ∪ B ) = { 1, 2, 3, 4, 5 }
A ∪ (A ∩ B) = { 1, 2, 3 } A ∩ ( A ∪ B ) = { 1, 2, 3 }
CSC 102 - Discrete Structures 1

INVOLUTION 0/1 LAWS


LAW (A’)’ = A ∅’ = U, U’ = ∅
EXAMPLE EXAMPLE
Let U = { 1, 2, 3, 4, 5, 6, 7 } Let U = { 1, 2, 3, 4, 5, 6, 7 }
Set A = {1, 2, 3} Set A = {1, 2, 3}

A’ = { 4, 5, 6, 7 }
∅’ = { 1, 2, 3, 4,
(A’)’ = { x | x is not in { 4,
5, 6, 7 }
5, 6, 7 }}
U’ = {}
= { 1, 2, 3 }
CSC 102 - Discrete Structures 1

DE MORGAN’S EXAMPLE
Let U = { 1, 2, 3, 4, 5, 6, 7 }
LAWS FOR SETS Set A = {1, 2, 3} Set B = {3, 4, 5}

for Union (∪): (A ∪ B)’ = { 6, 7 }


A’ ∩ B’ = { 6, 7 }
(A ∪ B)’ = A’ ∩ B’

for Intersection (∩): (A ∩ B)’ = { 1, 2, 4, 5, 6, 7 }


(A ∩ B)’ = A’ ∪ B’ A’ ∪ B’ = { 1, 2, 4, 5, 6, 7, }
CSC 102 - Discrete Structures 1

COUNTING PRINCIPLES,
CLASSES OF SETS
SET THEORY
CSC 102 - Discrete Structures 1

SETS can be finite or infinite.

FINITE INFINITE
1. Empty Set Set B consists of even positive
2. Set A consists of the days of integers
the week.

A set is countable if it is finite.


A set is countably infinite if it can be arranged as sequence and is infinite.
A set is uncountable if can't be arranged in sequence and is infinite.

COUNTING PRINCIPLES
CSC 102 - Discrete Structures 1

Counting Elements in Finite Sets


The notation n(S) or |S| will denote the number of
elements in a set S, also known as the cardinality.

EXAMPLES:

Set A consists of the days of Set D consists of letters in the


the week. English alphabet.
n(A) or |A| = 7 n(D) or |D| = 26

COUNTING PRINCIPLES
CSC 102 - Discrete Structures 1

• Suppose A and B are finite disjoint sets then A ∪ B is finite


and n(A ∪ B) = n (A) + n (B)
EXAMPLE n(A) or |A| = 5 n(A ∪ B) = n (A) + n (B)
n(B) or |B| = 3 = 5+3
n(A ∪ B) = 8

Counting Elements in Finite Sets


CSC 102 - Discrete Structures 1

• Let A and B be Finite sets, n(A\B) = n (A) – n(A∩B)


EXAMPLE Suppose Class A (CSC 102) has 25 students
and 10 of them are taking a Class B (ITE 15).
Then the number of students in CSC 102
which are not in ITE 15 is :

n(A\B) = n (A) – n(A∩B) = 25 – 10


n(A\B) = 15

Counting Elements in Finite Sets


CSC 102 - Discrete Structures 1

• Let A be a subset of a finite universal set U,


• n(A’) = n (U) – n(A)

EXAMPLE Suppose a Class U with 30 students


has 18 full time students. Then there
are 12 part time students in the Class U.

n(A’) = n (U) – n(A)


= 30 – 18
n(A’) = 12

Counting Elements in Finite Sets


CSC 102 - Discrete Structures 1

Inclusion – Exclusion Principle


• It is the formula for n(A∪B) where A and B are not disjoint.
• Suppose A and B are finite sets, then A∪B & A∩B are finite.
• n(A∪B) = n(A) + n(B) – n(A∩B)
EXAMPLE: Suppose a list A contains the 30 students in a
mathematics class, and a list B contains the 35
students in an English class, and suppose there are
20 names on both lists.

n(A∪B) = n(A) + n(B) – n(A∩B) = 30 + 35 – 20


n(A∪B) = 45
COUNTING PRINCIPLES
CSC 102 - Discrete Structures 1

• Suppose A, B, C are finite sets, then A ∪ B ∪ C is finite.


• n(A ∪ B ∪ C ) = n(A)+ n(B)+n(C) – n(A∩B)- n(A∩C) -
n(B∩C) + n(A∩B∩C)
EXAMPLE: Suppose 58 students drink milk A, 49 students
drinking milk B, and 57 students drink milk C. There
are 14 students who drink A and B,
13 A and C, 17 who drink B and C and 4 who drink the
three.

n(A ∪ B ∪ C ) = n(A)+ n(B)+n(C) – n(A∩B)- n(A∩C) - n(B∩C) + n(A∩B∩C)


= 58+49+57-14-13-17+4
n(A ∪ B ∪ C ) = 124
Inclusion – Exclusion Principle
CSC 102 - Discrete Structures 1

EXAMPLE
The population of Alaska is 830, of which 250 are adult females and 380 are
children.
LET:
U = residents of Alaska
A = adults A. |A| = |U| - |C| = 830 – 380 = 450
F = female adults B. |M| = |A| - |F| = 450 – 250 = 200
M = male adults C. |F ∪ C| = |F| + |C| - |F ∩ C| = 250 + 380 – 0 = 630
C = children

A. How many adults live in Alaska?


B. How many adult males live in Alaska?
C. How many “females and children” live in Alaska?

Inclusion – Exclusion Principle


CSC 102 - Discrete Structures 1

Classes of Sets
• Given a set S, we might wish to talk about some of its
subsets, we will speak of a class of sets or collection of
sets.
EXAMPLE
Let A be the class of subsets of S which contain
exactly three elements of S.
S = { 1, 2, 3, 4 }
A = [{1, 2, 3},{1, 2, 4},{1, 3, 4},{2, 3, 4}]

COUNTING PRINCIPLES
CSC 102 - Discrete Structures 1

POWER SETS &


PARTITIONS
SET THEORY
CSC 102 - Discrete Structures 1

POWER SETS • Given a Set S, we may speak of


EXAMPLE the class of all subsets of S.
S = { 1, 2, 3 } • This class is called the power set
P(S) = [{Ø}, {1}, {2}, {3}, {1,2}, of S, and will be denoted by P(S). If
{2,3}, {1,3}, S] S is finite then so is P(S).
n (P(S)) = 𝟐𝒏(𝑺) = 23 = 8
• The number of elements in P(S) is
2 raised to the power n(S)
• n (P(S)) = 𝟐𝒏(𝑺)
• The power set of S is sometimes
denoted by 2𝑆
SET THEORY
CSC 102 - Discrete Structures 1

PARTITIONS
• Let S a non-empty set.
EXAMPLE • A partition of S is a subdivision of
S = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } S into nonoverlapping, non-
Identify the partition of S: empty subsets.
• Precisely, a partition of S
1. [{1, 3, 5}, {2,6}, {4,8,9}] collection {𝐴𝑖 } of non empty set
2. [{1, 3, 5}, {2, 4, 6, 8}, {7,9}] subsets.
3. [{1, 3, 5}, {2, 4, 6, 8}, {5, 7, 9}]

SET THEORY
CSC 102 - Discrete Structures 1

OBJECTIVES
WRITE AN ARGUMENT USING LOGICAL NOTATION
AND DETERMINE IF THE ARGUMENT IS OR IS NOT
VALID.

HAVE SUBSTANTIAL EXPERIENCE TO COMPREHEND


FORMAL LOGICAL ARGUMENTS.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

PROPOSITIONS & TRUTH


VALUES
LOGIC PART 1
CSC 102 - Discrete Structures 1

PROPOSITIONS
A proposition is a
EXAMPLES
declarative sentence (that
All the following declarative sentences are
is, a sentence that declares propositions.
a fact) that is either true or 1. Washington, D.C., is the capital of the United
States of America.
false, but not both. 2. Toronto is the capital of Canada.
3. 1 + 1 = 2.
4. 2 + 2 = 3.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

EXAMPLES
1. What time is it?
2. Read this carefully.
3. x + 1 = 2.
4. x + y = z.

PROPOSITIONS
CSC 102 - Discrete Structures 1

We use letters to denote propositional variables (or


statement variables), that is, variables that represent
propositions, just as letters are used to denote numerical
variables.
• The conventional letters used for propositional variables
are p, q, r, s, . . . .

The truth value of a proposition is true, denoted by T, if it is a


true proposition, and the truth value of a proposition is false,
denoted by F, if it is a false proposition.

PROPOSITIONS
CSC 102 - Discrete Structures 1

The area of logic that It was first developed


deals with propositions is systematically by the
called the propositional Greek philosopher
calculus or Aristotle more than 2300
propositional logic. years ago.

Many mathematical statements are constructed by


combining one or more propositions.
New propositions, called compound propositions, are formed
from existing propositions using logical operators
PROPOSITIONS
CSC 102 - Discrete Structures 1

DEFINITION 1
• Let p be a proposition. EXAMPLE
• The negation of p, denoted by ¬p Find the negation of the proposition:
“Michael’s PC runs Linux”
(also denoted by p), is the and express this in simple English.
statement “It is not the case that ANSWER: The negation is
p.” “It is not the case that Michael’s PC
runs Linux.”
• The proposition ¬p is read “not p.” This negation can be more simply
• The truth value of the negation of expressed as
“Michael’s PC does not run Linux.”
p, ¬p, is the opposite of the truth
value of p.
PROPOSITIONS
CSC 102 - Discrete Structures 1

LOGICAL CONNECTIVES &


TRUTH TABLES
LOGIC PART 1
CSC 102 - Discrete Structures 1

DEFINITION 1 NEGATION OF A PROPOSITION P

Table 1 displays the truth table for the


negation of a proposition p.
This table has a row for each of the two
possible truth values of a proposition p.
Each row shows the truth value of ¬p
corresponding to the truth value of p for
this row.
The negation of a proposition can also be considered the result of the operation of the
negation operator on a proposition. The negation operator constructs a new proposition
from a single existing proposition.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

DEFINITION 2
• Let p and q be propositions. Connectives – the
• The conjunction of p and q, logical operators
denoted by p ∧ q, is the that are used to form
proposition “p and q.” new propositions
from two or more
• The conjunction p ∧ q is true
existing propositions.
when both p and q are true and is
false otherwise.

LOGICAL CONNECTIVES & TRUTH TABLES


CSC 102 - Discrete Structures 1

DEFINITION 2 CONJUNCTION OF THE PROPOSITIONS P AND Q

EXAMPLE
Find the conjunction of the ANSWER:
propositions p and q, where p The conjunction of these propositions, p ∧ q, is the
proposition “Rebecca’s PC has more than 16 GB
is the proposition “Rebecca’s free hard disk space, and the processor in
PC has more than 16 GB free Rebecca’s PC runs faster than 1 GHz.”
hard disk space” and q is the This conjunction can be expressed more simply as “Rebecca’s
proposition “The processor in PC has more than 16 GB free hard disk space, and its processor
runs faster than 1 GHz.” For this conjunction to be true, both
Rebecca’s PC runs faster conditions given must be true. It is false, when one or both of
than 1 GHz.” these conditions are false.

LOGICAL CONNECTIVES & TRUTH TABLES


CSC 102 - Discrete Structures 1

DEFINITION 2 CONJUNCTION OF THE PROPOSITIONS P AND Q

Table 2 displays the truth table of p ∧ q.


This table has a row for each of the four possible
combinations of truth values of p and q. The four
rows correspond to the pairs of truth values TT, TF,
FT, and FF, where the first truth value in the pair is
the truth value of p and the second truth value is
the truth value of q.

Note that in logic the word “but” sometimes is used instead of


“and” in a conjunction.

LOGICAL CONNECTIVES & TRUTH TABLES


CSC 102 - Discrete Structures 1

DEFINITION 3 EXAMPLE
Find the disjunction of the
• Let p and q be propositions. propositions p and q, where
• The disjunction of p and q, p is the proposition
denoted by p ∨ q, is the “Rebecca’s PC has more
than 16 GB free hard disk
proposition “p or q.” space” and q is the
• The disjunction p ∨ q is false proposition “The processor
in Rebecca’s PC runs faster
when both p and q are false and than 1 GHz.”
is true otherwise.

LOGICAL CONNECTIVES & TRUTH TABLES


CSC 102 - Discrete Structures 1

DEFINITION 3 DISJUNCTION OF THE PROPOSITIONS P AND Q

ANSWER:
The disjunction of p and q, p ∨ q, is the proposition
“Rebecca’s PC has at least 16 GB free hard disk
space, or the processor in Rebecca’s PC runs faster
than 1 GHz.”
• This proposition is true when Rebecca’s PC has at least 16 GB free hard disk
space, when the PC’s processor runs faster than 1 GHz, and when both
conditions are true.
• It is false when both of these conditions are false, that is, when Rebecca’s PC
has less than 16 GB free hard disk space and the processor in her PC runs at 1
GHz or slower.

LOGICAL CONNECTIVES & TRUTH TABLES


CSC 102 - Discrete Structures 1

DEFINITION 3 DISJUNCTION OF THE PROPOSITIONS P AND Q

Table 3 displays the truth table of p ∨ q .


This table has a row for each of the four possible
combinations of truth values of p and q. The four
rows correspond to the pairs of truth values TT, TF,
FT, and FF, the use of the connective or in a
disjunction corresponds that a disjunction is true
when at least one of the two propositions in it is
true.

LOGICAL CONNECTIVES & TRUTH TABLES


CSC 102 - Discrete Structures 1

DEFINITION 4
• Let p and q be propositions.
• The conditional statement p → q is the proposition “if p,
then q.”
• The conditional statement p → q is false when p is true
and q is false, and true otherwise.
• In the conditional statement p → q, p is called the
hypothesis (or antecedent or premise) and q is called the
conclusion (or consequence).

CONDITIONAL STATEMENTS
CSC 102 - Discrete Structures 1

DEFINITION 4
EXAMPLE Let p be the statement “Maria learns discrete mathematics” and q
the statement “Maria will find a good job.”
Express the statement p → q as a statement in English.

ANSWER:
“If Maria learns discrete mathematics, then she will find a good job.”
There are many other ways to express this conditional statement in English. Among the most
natural of these are:
• “Maria will find a good job when she learns discrete mathematics.”
• “For Maria to get a good job, it is sufficient for her to learn discrete mathematics.” and
• “Maria will find a good job unless she does not learn discrete mathematics.”

CONDITIONAL STATEMENTS
CSC 102 - Discrete Structures 1

DEFINITION 4

The truth table for the conditional statement p → q


is shown in Table 5.
Note that the statement p → q is true when both p
and q are true and when p is false (no matter
what truth value q has)

CONDITIONAL STATEMENTS
CSC 102 - Discrete Structures 1

The statement p → q is called a conditional statement because p


→ q asserts that q is true on the condition that p holds. A
conditional statement is also called an implication.
Because conditional statements play such an essential role in
mathematical reasoning, a variety of terminology is used to
express p → q. You will encounter most if not all of the following
ways to express this conditional statement:

CONDITIONAL STATEMENTS
CSC 102 - Discrete Structures 1

CONVERSE, CONTRAPOSITIVE, & INVERSE


Forming some new conditional statements starting with a conditional statement p → q. In
particular, there are three related conditional statements that occur so often that they have
special names.

The proposition The contrapositive The proposition


q → p is called of p → q is the ¬p → ¬q is called
the converse of proposition the inverse of
p → q. ¬q → ¬p. p → q.
Of these three conditional statements formed from p → q, only the contrapositive always has
the same truth value as p → q.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

EXAMPLE What are the contrapositive, the converse, and the inverse of the
conditional statement : “The home team wins whenever it is raining?”

ANSWER: Because “q whenever p” is one of the ways to express the


conditional statement p → q, the original statement can be rewritten
as “If it is raining, then the home team wins.”
• Consequently, the contrapositive of this conditional statement is
“If the home team does not win, then it is not raining.”
• The converse is “If the home team wins, then it is raining.”
• The inverse is “If it is not raining, then the home team does not win.”

Only the contrapositive is equivalent to the original statement.

CONVERSE, CONTRAPOSITIVE, & INVERSE


CSC 102 - Discrete Structures 1

DEFINITION 5
• Let p and q be propositions.
• The biconditional statement p ↔ q is the proposition “p if
and only if q.”
• The biconditional statement p ↔ q is true when p and q
have the same truth values, and is false otherwise.
• Biconditional statements are also called bi-implications.

BICONDITIONALS
CSC 102 - Discrete Structures 1

DEFINITION 5
EXAMPLE ANSWER: “You can take the flight if and
Let p be the only if you buy a ticket.”
• This statement is true if p and q are either both true or
statement “You
both false, that is, if you buy a ticket and can take the
can take the flight or if you do not buy a ticket and you cannot take
flight,” and let q the flight.
be the • It is false when p and q have opposite truth values,
statement “You that is, when you do not buy a ticket, but you can take
the flight (such as when you get a free trip) and when
buy a ticket.”
you buy a ticket but you cannot take the flight (such
Then p ↔ q is as when the airline bumps you).
the statement
BICONDITIONALS
CSC 102 - Discrete Structures 1

DEFINITION 5 The truth table for p ↔ q is shown in Table 6.


Note that the statement p ↔ q is true when
both the conditional statements p → q and q
→ p are true and is false otherwise.
That is why we use the words “if and only if” to
express this logical connective and why it is
symbolically written by combining the symbols
→ and ←.
There are some other common ways to express
p ↔ q:
• “p is necessary and sufficient for q”
• “if p then q, and conversely”
• “p iff q.”
The last way of expressing the biconditional statement p ↔ q uses the abbreviation “iff” for “if and
only if.” Note that p ↔ q has exactly the same truth value as (p → q) ∧ (q → p).

BICONDITIONALS
CSC 102 - Discrete Structures 1

TRUTH TABLES OF COMPOUND PROPOSITIONS


o We have now introduced four o We can use truth tables to determine
important logical connectives— the truth values of these compound
conjunctions, disjunctions, propositions.
conditional statements, and o We use a separate column to find the
truth value of each compound
biconditional statements—as well
expression that occurs in the
as negations. compound proposition as it is built up.
o We can use these connectives to The truth values of the compound
build up complicated compound proposition for each combination of
propositions involving any number truth values of the propositional
of propositional variables. variables in it.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

EXAMPLE Construct the truth table of the compound proposition (p ∨ ¬q) → (p ∧ q).

Because this truth table involves two propositional variables p and q,


there are four rows in this truth table, one for each of the pairs of truth
values TT, TF, FT, and FF.
• The first two columns are used for the truth values of p and q,
respectively.
• In the third column we find the truth value of ¬q, needed to find the
truth value of p ∨ ¬q, found in the fourth column.
• The fifth column gives the truth value of p ∧ q. Finally, the truth
value of (p ∨ ¬q) → (p ∧ q) is found in the last column.

COMPOUND PROPOITIONS
CSC 102 - Discrete Structures 1

EXAMPLE Construct the truth table of the compound proposition (p ∨ ¬q) → (p ∧ q).

Because this truth table involves two propositional variables p and q, there are four
rows in this truth table, one for each of the pairs of truth values TT, TF, FT, and FF.
• The first two columns are used for the truth values of p and q, respectively.
• In the third column we find the truth value of ¬q, needed to find the truth value of p ∨
¬q, found in the fourth column.
• The fifth column gives the truth value of p ∧ q. Finally, the truth value of (p ∨ ¬q) → (p
∧ q) is found in the last column.
The resulting truth table is shown in Table 7. COMPOUND PROPOITIONS
CSC 102 - Discrete Structures 1
CSC 102 - Discrete Structures 1
CSC 102 - Discrete Structures 1

BASIC LOGICAL
OPERATIONS
LOGIC PART 1
CSC 102 - Discrete Structures 1

Precedence of Logical Operators


We can construct compound • For instance, (p ∨ q) ∧ (¬r) is the
conjunction of p ∨ q and ¬r.
propositions using the negation • However, to reduce the number of
operator and the logical parentheses, we specify that the
operators defined so far. We will negation operator is applied before
generally use parentheses to all other logical operators.
specify the order in which • This means that ¬p ∧ q is the
conjunction of ¬p and q,
logical operators in a namely,(¬p) ∧ q, not the negation of
compound proposition are to the conjunction of p and q, namely
be applied. ¬(p ∧ q).

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

• Another general rule • accepted rule that the


of precedence is that conditional and
the conjunction biconditional operators →
operator takes and ↔ have lower
precedence over the precedence than the
disjunction operator, conjunction and disjunction
so that p ∧ q ∨ r means operators, ∧ and ∨
(p ∧ q) ∨ r rather than p • Consequently, p ∨ q → r is
∧ (q ∨ r). the same as (p ∨ q) → r
• may be difficult to • Use parentheses when the
remember, we will order of the conditional
continue to use operator and biconditional
parentheses so that operator is at issue,
the order of the although the conditional
disjunction and operator has precedence
conjunction operators over the biconditional
is clear operator
Precedence of Logical Operators
CSC 102 - Discrete Structures 1

Logic and Bit Operations


o Computers represent
information using bits. o The well-known statistician
o A bit is a symbol with two John Tukey introduced this
possible values, namely, 0 terminology in 1946.
(zero) and 1 (one). o A bit can be used to
o This meaning of the word bit represent a truth value,
comes from binary digit, because there are two truth
because zeros and ones are values, namely, true and
the digits used in binary false.
representations of numbers.
TOPIC 2. LOGIC PART 1
CSC 102 - Discrete Structures 1

o 1 represents T (True), 0 represents F


(False)
o A variable is called a Boolean variable
if its value is either true or false.
o A Boolean variable can be
represented using a bit. Computer bit
operations correspond to the logical
connectives

o By replacing true by a one and false by a


zero in the truth tables for the operators
∧, ∨, and ⊕ , the tables shown in Table 9
for the corresponding bit operations are
obtained.
o use the notation OR, AND, and XOR for the
operators ∨, ∧, and ⊕, as is done in
various programming languages
Logic and Bit Operations
CSC 102 - Discrete Structures 1

A bit string is a sequence of zero or more bits. The length of this string is the number of
bits in the string.

EXAMPLE:
101010011 is a bit string of length nine

o We can extend bit operations to bit strings. Find the bitwise OR, bitwise AND, and
o We define the bitwise OR, bitwise AND, and bitwise XOR of the bit strings 01 1011 0110
bitwise XOR of two strings of the same and 11 0001 1101.
length to be the strings that have as their
01 1011 0110
bits the OR, AND, and XOR of the
11 0001 1101
corresponding bits in the two strings, 11 1011 1111 bitwise OR
respectively. 01 0001 0100 bitwise AND
o We use the symbols ∨, ∧, and ⊕ to represent 10 1010 1011 bitwise XOR
the bitwise OR, bitwise AND, and bitwise XOR
operations, respectively.
Logic and Bit Operations
CSC 102 - Discrete Structures 1

TAUTOLOGIES &
CONTRADICTIONS
LOGIC PART 1
CSC 102 - Discrete Structures 1

Propositional Equivalences
o Methods that produce propositions with the same truth
value as a given compound proposition are used
extensively in the construction of mathematical
arguments.
o Note that we will use the term “compound proposition” to
refer to an expression formed from propositional
variables using logical operators, such as p ∧ q.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

A compound proposition that is

TAUTOLOGY always true, no matter what the


truth values of the propositional
variables that occur in it.

A compound proposition
that is always false. CONTRADICTION
A compound proposition that
CONTINGENCY is neither a tautology nor a
contradiction.

Propositional Equivalences
CSC 102 - Discrete Structures 1

EXAMPLE: We can construct examples of tautologies and contradictions


using just one propositional variable.

o Consider the truth tables of


p ∨ ¬p and p ∧ ¬p, shown in
Table 1.
o Because p ∨ ¬p is always
true, it is a tautology.
Because p ∧ ¬p is always
false, it is a contradiction.

Propositional Equivalences
CSC 102 - Discrete Structures 1

LOGICAL EQUIVALENCES
o Compound propositions that have the same truth values
in all possible cases are called logically equivalent.
o The compound propositions p and q are called logically
equivalent if p ↔ q is a tautology.
o The notation p ≡ q denotes that p and q are logically
equivalent. The symbol ≡ is not a logical connective, and
p ≡ q is not a compound proposition but rather is the
statement that p ↔ q is a tautology.
o The symbol ⇔ is sometimes used instead of ≡ to denote logical
equivalence.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

o In particular, the compound propositions


p and q are equivalent if and only if the
columns giving their truth values agree.
o Example 2 illustrates this method to
establish an extremely important and
useful logical equivalence, namely, that of
¬(p ∨ q) with ¬p ∧ ¬q.

o This logical equivalence is one of the two De Morgan laws, shown


in Table 2, named after the English mathematician Augustus De
Morgan, of the mid-nineteenth century.

LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

SOLUTION:
The truth tables for these
EXAMPLE 2
Show that ¬(p ∨ q) and ¬p ∧ ¬q are
compound propositions are logically equivalent.
displayed in Table 3.
Because the truth values of
the compound propositions
¬(p ∨ q) and ¬p ∧ ¬q agree
for all possible
combinations of the truth
values of p and q, it follows
that ¬(p ∨ q) ↔ (¬p ∧ ¬q)is a
tautology and that these
compound propositions are
logically equivalent.
LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

SOLUTION:
The truth tables for these
EXAMPLE 2
Show that ¬(p ∨ q) and ¬p ∧ ¬q are
compound propositions are logically equivalent.
displayed in Table 3.
Because the truth values of
the compound propositions
¬(p ∨ q) and ¬p ∧ ¬q agree
for all possible
combinations of the truth
values of p and q, it follows
that ¬(p ∨ q) ↔ (¬p ∧ ¬q)is a
tautology and that these
compound propositions are
logically equivalent.
LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

EXAMPLE 3
SOLUTION: Show that p → q and ¬p ∨ q are
We construct the truth logically equivalent.
table for these
compound
propositions in Table 4.
Because the truth
values of ¬p ∨ q and p
→ q agree, they are
logically equivalent.

LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

EXAMPLE 3
SOLUTION: Show that p → q and ¬p ∨ q are
We construct the truth logically equivalent.
table for these
compound
propositions in Table 4.
Because the truth
values of ¬p ∨ q and p
→ q agree, they are
logically equivalent.

LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

We will now establish a logical We symbolically represent these


equivalence of two compound combinations by listing the truth
propositions involving three values of p, q, and r, respectively.
different propositional variables p, These eight combinations of truth
q, and r. values are TTT, TTF, TFT, TFF, FTT,
To use a truth table to establish such FTF, FFT, and FFF; we use this order
a logical equivalence, we need eight when we display the rows of the
rows, one for each possible truth table.
combination of truth values of these
three variables.

o Note that we need to double the number of rows in the truth tables we use to show that compound propositions are
equivalent for each additional propositional variable, so that 16 rows are needed to establish the logical equivalence of
two compound propositions involving four propositional variables, and so on.
o In general, 𝟐𝒏 rows are required if a compound proposition involves n propositional variables.

LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

EXAMPLE 4
Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are
logically equivalent. This is the distributive law of
disjunction over conjunction. SOLUTION: We construct the
truth table for these
compound propositions in
Table 5. Because the truth
values of p ∨ (q ∧ r) and (p
∨ q) ∧ (p ∨ r) agree, these
compound propositions are
logically equivalent.

LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

EXAMPLE 4
Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are
logically equivalent. This is the distributive law of
disjunction over conjunction. SOLUTION: We construct the
truth table for these
compound propositions in
Table 5. Because the truth
values of p ∨ (q ∧ r) and (p
∨ q) ∧ (p ∨ r) agree, these
compound propositions are
logically equivalent.

LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

LOGICAL EQUIVALENCES
CSC 102 - Discrete Structures 1

APPLICATIONS OF
PROPOSITIONAL LOGIC
LOGIC PART 1
CSC 102 - Discrete Structures 1

Applications of Propositional Logic


Logic is used in the Propositional logic and its
specification of software and rules can be used to design
hardware, because these computer circuits, to construct
specifications need to be computer programs, to verify
precise before development the correctness of programs,
begins. and to build expert systems.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

SYSTEM
SPECIFICATIONS
Translating sentences in System and software engineers
natural language (such as take requirements in natural
English) into logical language and produce precise and
expressions is an essential part unambiguous specifications that
of specifying both hardware can be used as the basis for system
and software systems. development.

EXAMPLE
Express the specification “The automated reply cannot be sent when the file
system is full” using logical connectives.

Applications of Propositional Logic


CSC 102 - Discrete Structures 1

EXAMPLE
Express the specification “The automated reply cannot be sent when the file
system is full” using logical connectives.

SOLUTION
o Let p denote “The automated reply can be sent” and q denote “The file
system is full.”
o Then ¬p represents “It is not the case that the automated reply can be
sent,” which can also be expressed as “The automated reply cannot be
sent.”
o Consequently, our specification can be represented by the conditional
statement q → ¬p.

System Specification
CSC 102 - Discrete Structures 1

EXAMPLE
Determine whether these system specifications are consistent:
o “The diagnostic message is stored in the buffer or it is retransmitted.”
o “The diagnostic message is not stored in the buffer.”
o “If the diagnostic message is stored in the buffer, then it is retransmitted.”

SOLUTION
o First express them using logical expressions. Let p denote “The diagnostic
message is stored in the buffer” and let q denote “The diagnostic
message is retransmitted.”
o The specifications can then be written as p ∨ q, ¬p, and p → q.
o An assignment of truth values that makes all three specifications true
must have p false to make ¬p true. Because we want p ∨ q to be true but
p must be false, q must be true. Because p → q is true when p is false
and q is true.

System Specification
CSC 102 - Discrete Structures 1

EXAMPLE
Determine whether these system specifications are consistent:
o “The diagnostic message is stored in the buffer or it is retransmitted.”
o “The diagnostic message is not stored in the buffer.”
o “If the diagnostic message is stored in the buffer, then it is retransmitted.”

SOLUTION p q ¬p p∨q p→q


o We conclude that these
specifications are consistent, T T F T T
because they are all true when
p is false and q is true. T F F T F
o We could come to the same
F T T T T
conclusion by use of a truth
table to examine the four F F T F T
possible assignments of truth
values to p and q.
System Specification
CSC 102 - Discrete Structures 1

Logic Circuits
o A logic circuit (or digital circuit) receives input signals
𝑝1 , 𝑝2, … … , 𝑝𝑛 each a bit [either 0 (off) or 1 (on)], and produces
output signals 𝑠1 , 𝑠2, … … , 𝑠𝑛 , each a bit.
o In this section we will design some useful circuits, in Figure 1
we’ll see basic logic gates. Restrict our attention to logic
circuits with a single output signal; in general, digital circuits
may have multiple outputs.

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

INVERTER / NOT takes an input bit p, and


gate produces as output ¬p.

takes two input signals p and q,


OR gate each a bit, and produces as
output the signal p ∨ q.

takes two input signals p and


AND gate q, each a bit, and produces as
output the signal p ∧ q.

Logic Circuits
CSC 102 - Discrete Structures 1

EXAMPLE #1: EXAMPLE #2:


Build a digital Build a digital circuit
circuit that that produces the
produces the output (p ∨ ¬r) ∧ (¬p
output (p ∧ ¬q) ∨ ¬r ∨ (q ∨ ¬r)) when
when given input given input bits p, q,
bits p, q, and r. and r.

Logic and Bit Operations


CSC 102 - Discrete Structures 1

EXAMPLE #1:
Build a digital circuit that produces the output (p ∧ ¬q) ∨ ¬r when given input bits p, q, and r.

EXAMPLE #2:
Build a digital circuit that produces the output (p ∨ ¬r) ∧ (¬p ∨ (q ∨ ¬r)) when given input bits p,
q, and r.

Logic and Bit Operations


CSC 102 - Discrete Structures 1

ARGUMENTS & RULES OF


INFERENCE
LOGIC PART 1
CSC 102 - Discrete Structures 1

ARGUMENTS
Consider the following sequence of • This process of drawing a conclusion
propositions: from a sequence of propositions is
called deductive reasoning.
o The bug is either in module 17 or in
• The given propositions, such as
module 81. (1.4.1), are called hypotheses or
o The bug is a numerical error. premises, and the proposition that
o Module 81 has no numerical error. (1.4.1) follows from the hypotheses, such as
(1.4.2), is called the conclusion.
Assuming that these statements are true, it • A (deductive) argument consists of
is reasonable to conclude: hypotheses together with a
The bug is in module 17. (1.4.2) conclusion.
If 𝑝1 , 𝑝2, 𝑎𝑛𝑑 … , 𝑝𝑛 , then 𝑞. (1.4.3)

TOPIC 2. LOGIC PART 1


CSC 102 - Discrete Structures 1

ARGUMENTS An argument is a sequence of


If 𝑝1 , 𝑝2, 𝑎𝑛𝑑 … , 𝑝𝑛 , then 𝑞. (1.4.3) propositions written:

Argument (1.4.3) is said to be valid if the


conclusion follows from the hypotheses; OR
that is, if 𝑝1 , 𝑝2, 𝑎𝑛𝑑 … , 𝑝𝑛 are true, then q
must also be true.

o The symbol ∴
is read “therefore.”
o The propositions 𝑝1 , 𝑝2, 𝑎𝑛𝑑 … , 𝑝𝑛 are called the hypotheses (or premises), and
o the proposition q is called the conclusion.
o The argument is valid provided that if 𝑝1 , 𝑝2, 𝑎𝑛𝑑 … , 𝑝𝑛 are all true, then q must
also be true; otherwise, the argument is invalid (or a fallacy).
TOPIC 2. LOGIC PART 1
CSC 102 - Discrete Structures 1

RULES OF INFERENCE
o In a valid argument, we sometimes say that the conclusion follows
from the hypotheses.
o Notice that we are not saying that the conclusion is true; we are only
saying that if you grant the hypotheses, you must also grant the
conclusion.
o An argument is valid because of its form, not because of its content.
Each step of an extended argument involves drawing intermediate
conclusions.
o For the argument as a whole to be valid, each step of the argument
must result in a valid, intermediate conclusion.
o Rules of inference, brief, valid arguments, are used within a larger
argument.
TOPIC 2. LOGIC PART 1
CSC 102 - Discrete Structures 1

EXAMPLE: Determine whether the argument


is valid.

FIRST SOLUTION
o We construct a truth table
for all the propositions
involved.
o We observe that whenever
the hypotheses p → q and p
are true, the conclusion q is
also true; therefore, the
argument is valid.
RULES OF INFERENCE
CSC 102 - Discrete Structures 1

EXAMPLE: Determine whether the argument


is valid.
SECOND SOLUTION
o We can avoid writing the truth table by directly verifying
that whenever the hypotheses are true, the conclusion is
also true.
o Suppose that p → q and p are true. Then q must be true, for
otherwise p → q would be false.
o Therefore, the argument is valid.
o The argument in the example is used extensively and is
known as the modus ponens rule of inference or law of
detachment.
RULES OF INFERENCE
CSC 102 - Discrete Structures 1

RULES OF INFERENCE
CSC 102 - Discrete Structures 1

EXAMPLE 1 SOLUTION
Which rule of inference is used in o Let p denote the proposition “the computer
the following argument? has one gigabyte of memory,”
o let q denote the proposition “the computer
If the computer has one can run ‘Blast ’em,’” and
o let r denote the proposition “the sonics will
gigabyte of memory, then it
be impressive.” The argument can be written
can run “Blast ’em.” If the symbolically as
computer can run “Blast
’em,” then the sonics will be
impressive. Therefore, if the
computer has one gigabyte
Therefore, the argument uses the hypothetical
of memory, then the sonics syllogism rule of inference.
will be impressive.
RULES OF INFERENCE
CSC 102 - Discrete Structures 1

EXAMPLE 2 Represent the argument symbolically and


determine whether the argument is valid.

If 2 = 3, then I ate my hat. The argument may be


I ate my hat. written:
p q p→q q p
∴2=3
T T T T T
o SOLUTION
o We let p: 2 = 3 and q: I ate my hat T F F F T
o If the argument is valid, then whenever p → q
and q are both true, p must also be true. F T T T F
Suppose that p → q and q are true. This is
possible if p is false and q is true. F F T F F
o In this case, p is not true; thus the argument is
invalid. This fallacy is known as the fallacy of
affirming the conclusion.
RULES OF INFERENCE
CSC 102 - Discrete Structures 1

VALID OR INVALID?
To test whether or not an argument is valid, we do the
following:
A. Identify the premises and the conclusion
B. Construct a truth table showing the truth values of the premises and
the conclusion
C. Look for all the rows where the premises are all true - we call such
rows critical rows.

If the conclusion is false in a critical row, then the argument is invalid.


Otherwise, the argument is valid (since the conclusion is always true
when the premises are true).

TOPIC 2. LOGIC PART 1


Thank you for
Listening!

You might also like