SlideShare a Scribd company logo
1 of 72
DISCRETE MATHEMATICS
2024-02-05 2
What is Mathematics, really?
2024-02-05 3
So, what’s this class about?
What is discrete mathematics?
The study of discrete objects. Discrete mathematics is the part
of mathematics devoted to discrete means consisting of
distinct or unconnected elements.
The kinds of problems solved using discrete mathematics include:
• How many ways are there to choose a valid password on a computer system?
• What is the probability of winning a lottery?
• Is there a link between two computers in a network?
• How can I identify spam e-mail messages?
• How can I encrypt a message so that no unintended recipient can read it?
• What is the shortest path between two cities using a transportation system?
• How can a list of integers be sorted so that the integers are in increasing order?
The kinds of problems solved using discrete mathematics include:
• How many steps are required to do such a sorting?
• How can it be proved that a sorting algorithm correctly sorts a list?
• How can a circuit that adds two integers be designed?
• How many valid Internet addresses are there?
You will learn the discrete structures and techniques needed to solve problems
such as these.
More generally, discrete mathematics is used whenever objects are counted,
when relationships between finite (or countable) sets are studied, and when
processes involving a finite number of steps are analyzed. A key reason for the
growth in the importance of discrete mathematics is that information is stored
and manipulated by computing machines in a discrete fashion.
7
Why Study Discrete Math?
Through this course you can develop your mathematical
maturity: that is, your ability to understand and create mathematical
arguments.You will not get very far in your studies in the
mathematical sciences without these skills.
Second, discrete mathematics is the gateway to more advanced
courses in all parts of the mathematical sciences. Discrete
mathematics provides the mathematical foundations for many
computer science courses including data structures and algorithms,
database theory, formal languages, compiler theory, computer
security, and operating systems.
Why Study Discrete Math?
Math courses based on the material studied in discrete mathematics
include logic, set theory, number theory, linear algebra, abstract
algebra, combinatorics, graph theory, and probability theory (the
discrete part of the subject).
Also, discrete mathematics contains the necessary mathematical
background for solving problems in operations research (including
many discrete optimization techniques), chemistry, engineering,
biology, and so on. In the text, we will study applications to some of
these areas.
Many students find their introductory discrete mathematics course
to be significantly more challenging than courses they have
Why Study Discrete Math?
Lesson 1: Introduction to Logic
Chapter 1. Foundations
of Logic
LEARNING OUTCOMES
By: SHERWIN C. SANGALANG
At the end of the lesson, the students should be able to:
1. explain and apply basic notions of symbolic logic
2. define proposition and argument and explain propositional
connectives.
3. construct truth table and apply logical operators
4. explain and exemplify truth value status of a proposition
Logic
 Logic is a language for reasoning.
 In logic we are interested whether the statement is true or
false , and how the truthness/falsehood of a statement can
be determined from other statements.
 “Logic” is “the study of the principles of reasoning,
especially of the structure of propositions as distinguished
from their content and of method and validity in deductive
reasoning.” (thefreedictionary.com)
Logic
 Logic – used to distinguish between valid and invalid
mathematical arguments.
 There are various types of logic such as logic of sentences,
logic of objects, logic involving uncertainties, temporal
logic etc.
Propositional Logic
Propositional Logic is the logic of compound
statements built from simpler statements
using so-called Boolean connectives.
Some applications in computer science:
• Design of digital electronic circuits.
• Expressing conditions in programs.
• Queries to databases & search engines.
2024-02-05 15
Topic #1 – Propositional Logic
George Boole
(1815-1864)
Chrysippus of Soli
(ca. 281 B.C. – 205 B.C.)
Propositional Logic
 Propositional logic is a logic at the sentential level.
 The smallest unit we deal with in propositional logic
is a sentence.
 Sentences considered in propositional logic are not
arbitrary sentences but are the ones that are either
true or false, but not both. This kind of sentences are
called propositions.
Definition of a Proposition
A proposition (p, q, r, …) is simply a statement (i.e., a
declarative sentence) with a definite meaning, having a
truth value that’s either true (T) or false (F) (never both,
neither, or somewhere in between).
(However, you might not know the actual truth value, and it
might be situation-dependent.)
[Later we will study probability theory, in which we assign degrees
of certainty to propositions. But for now: think True/False only!]
17
Topic #1 – Propositional Logic
Examples of Propositions
• “It is raining.” (In a given situation.)
• “Beijing is the capital of China.” • “1 + 2 = 3”
But, the following are NOT propositions:
• “Who’s there?” (interrogative, question)
• “La la la la la.” (meaningless interjection)
• “Just do it!” (imperative, command)
• “Yeah, I sorta dunno, whatever...” (vague)
• “1 + 2” (expression with a non-true/false value) 18
Topic #1 – Propositional Logic
Propositional Logic
 If a proposition is true, then we say it has a truth
value of "true"; if a proposition is false, its truth value
is "false".
 The first proposition has the truth value of "true" and
the second "false".
Example: "Grass is green",
"2 + 5 = 5"
Propositional Logic
1. San Jose, is the capital of Occidental Mindoro.
2. 1 + 1 = 2
3. What time is it?
4. Read this carefully.
5. x + 1 = 2
Elements of Propositional Logic
Simple sentences which are true or false are basic
propositions. Larger and more complex sentences are
constructed from basic propositions by combining them
with connectives. Compound Proposition is a proposition
that has its truth value completely determined by the truth
values of two or more propositions and the operators (also
called connectives) connecting them.
Operators / Connectives
An operator or connective combines one or more
operand expressions into a larger expression. (E.g., “+”
in numeric exprs.)
Unary operators take 1 operand (e.g., −3); binary
operators take 2 operands (eg 3  4).
Propositional or Boolean operators operate on
propositions or truth values instead of on numbers.
22
Topic #1.0 – Propositional Logic: Operators
Elements of Propositional Logic
Though there are many connectives, we are going to
use the following five basic:
NOT (), AND (), OR (), IF_THEN or IMPLY (),
IF_AND_ONLY_IF ().
Some Popular Boolean Operators
Formal Name Nickname Arity Symbol
Negation operator NOT Unary ¬
Conjunction operator AND Binary 
Disjunction operator OR Binary 
Exclusive-OR operator XOR Binary 
Implication operator IMPLIES Binary 
Biconditional operator IFF Binary ↔
24
Elements of Propositional Logic
In such a case rather than stating them for each
individual proposition we use variables representing
an arbitrary proposition and state properties/relations
in terms of those variables. Those variables are called
a propositional variable. Propositional variables are
also considered a proposition and called a proposition
since they represent a proposition hence they behave
the same way as propositions.
Elements of Propositional Logic
P  Q
Propositional variables
Connective
Compound Propositions
When two or more propositions are joined together
using connectives this statement is called a compound
proposition. Example “John is smart or he studies
every night.”
TRUTH TABLE
A truth table is a device that allows us to analyze and
compare compound logic statements. In logic, given a
proposition, a truth table shows all the possible truth
values of a proposition.
Example: (for a simple proposition), the truth table is
p
T
F
TRUTH TABLE
• A truth table is useful if we need to show the possible
truth values of compound propositions.
• Example: (for compound propositions with p and q as
component propositions)
• First determine the number of possible combinations
of the simple propositions. For 2 component
propositions, the number of combinations is 4 (given
by the equation “𝑁 = 2𝑛” where N is the number of
combinations and n is the number of component
propositions.
THE BASIC RULES FOR CONSTRUCTING A TRUTH
TABLE FOR A COMPOUND STATEMENT
1. The number of rows in the truth table depends upon the number
of basic variables in the compound statement. To determine the
number of rows required, count the number of basic variables in the
statement, but don't re-count multiple occurrences of a variable.
• variable---2 rows
• variables--4 rows
• variables--8 rows
• variables--16 rows and so forth.
THE BASIC RULES FOR CONSTRUCTING A TRUTH
TABLE FOR A COMPOUND STATEMENT
2. The number of columns in a truth table depends upon the number
of logical connectives in the statement. The following guidelines are
usually reliable.
• There will be one column for each basic variable; and
• To determine the number of other columns, count the number of
logical connectives in the statement; do re-count multiple
occurrences of the same connective. The “~” symbol counts as a
logical connective.
• In addition to the columns for each basic variable, there will usually
be one column for each occurrence of a logical connective
THE BASIC RULES FOR CONSTRUCTING A TRUTH
TABLE FOR A COMPOUND STATEMENT
3. The beginning columns are filled in so as to take into
account every possible combination of the basic variables
being true or false. Each row represents one of the possible
combinations.
4. In order to fill in any other column in the truth table, you
must refer to a previous column or columns.
The Negation Operator
The unary negation operator “¬” (NOT) transforms a prop.
into its logical negation.
E.g. If p = “I have brown hair.”
then ¬p = “I do not have brown hair.”
Truth table for NOT:
33
p p
T F
F T
T :≡ True; F :≡ False
“:≡” means “is defined as” Operand
column
Result
column
Topic #1.0 – Propositional Logic: Operators
Logical Connectives
(1) Not (negation) : (~) or ()
Let p be a proposition. The negation of p is denoted by:
p, and read as “not p”.
Example:
Find the negation of the proposition “Today is Friday”.
Logical Connectives
DEFINITION 1 Let p be a proposition. The negation of p,
denoted by¬p (also denoted by ¯), is the statement
“It is not the case that p.”
The proposition ¬p is read “not p.” The truth value of the
negation of p, ¬p, is the opposite
of the truth value of p.
P
EXAMPLE
EXAMPLE1. Find the negation of the proposition
“Michael’s PC runs Linux”
and express this in simple English.
SOLUTION: The negation is
“It is not the case that Michael’s PC runs Linux.”
This negation can be more simply expressed as
“Michael’s PC does not run Linux.”
▲
EXAMPLE
Find the negation of the proposition
“Maria’s smartphone has at least 32GB of memory”
and express this in simple English.
Solution: The negation is
“It is not the case that Maria’s smartphone has at least 32GB of memory.”
This negation can also be expressed as
“Maria’s smartphone does not have at least 32GB of memory”
or even more simply as
“Maria’s smartphone has less than 32GB of memory.”
The Conjunction Operator
The binary conjunction operator “” (AND) combines
two propositions to form their logical conjunction.
E.g. If p=“I will have salad for lunch.” and q=“I will have
steak for dinner.”, then pq=“I will have salad for lunch
and
I will have steak for dinner.”
38
Remember: “” points up like an “A”, and it means “ND”
ND
Topic #1.0 – Propositional Logic: Operators
Logical Connectives
(2) And (conjunction) :
Let p and q be prepositions. The preposition of “p and q” is
denoted by p  q, is TRUE when BOTH p and q are true and
otherwise is FALSE.
p q p  q
T T T
T F F
F T F
F F F
Conjunction Truth Table
• Note that a
conjunction
p1  p2  …  pn
of n propositions
will have 2n rows
in its truth table.
• Also: ¬ and  operations together are suffi-
cient to express any Boolean truth table!
40
p q pq
T T T
T F F
F T F
F F F
Operand columns
EXAMPLE
Find the conjunction of the propositions p and q where p is the
proposition “Rebecca’s PC has more than 16 GB free hard disk space”
and q is the proposition “The processor in Rebecca’s PC runs faster
than 1 GHz.
Solution:
The conjunction of these propositions, p ∧ q, is the proposition
“Rebecca’s PC has more than 16 GB free hard disk space, and the
processor in Rebecca’s PC runs faster than 1GHz.” This conjunction
can be expressed more simply as “Rebecca’s 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 conditions given must be true. It is
false, when one or both of these conditions are false.
Logical Connectives
(3) Or (disjunction) : 
Let p and q be propositions. The preposition of “p or q” -
denoted pq, is FALSE when BOTH p and q are FALSE and
TRUE otherwise.
p q pq
T T T
T F T
F T T
F F F
The Disjunction Operator
The binary disjunction operator “” (OR) combines two
propositions to form their logical disjunction.
p=“My car has a bad engine.”
q=“My car has a bad carburetor.”
pq=“Either my car has a bad engine, or
my car has a bad carburetor.”
44
After the downward-
pointing “axe” of “”
splits the wood, you
can take 1 piece OR the
other, or both.

Topic #1.0 – Propositional Logic: Operators
Meaning is like “and/or” in English.
Disjunction Truth Table
• Note that pq means
that p is true, or q is
true, or both are true!
• So, this operation is
also called inclusive or,
because it includes the
possibility that both p and q are true.
• “¬” and “” together are also universal.
45
p q pq
T T T
T F T
F T T
F F F
Note
difference
from AND
Activity
Consider the propositions and state whether it is
true or false:
1) Ice floats in water and 2 + 2 = 4
2) China is not in Europe and 2 + 2 = 4
3) 5 – 3 = 1 or 2 x 2 = 4
Another Activity
Translate the following into logical notation, using p and q and logical
connectives.
p = It is below freezing
q = It is snowing
(a) It is below freezing and snowing
(b) It is below freezing but not snowing
(c) It is not below freezing and it is not snowing
Conditional Statements/Implication
Let p and q be a proposition. The implication pq is the
proposition that is FALSE when p is true, q is false. Otherwise
is TRUE. p is the antecedent and q is the consequence.
p q pq
T T T
T F F
F T T
F F T
Conditional Statements/Implication
The following list presents
some of the variations. These
are all logically equivalent,
that is as far as true or false of
statement is concerned there
is no difference between
them.
 If p, then q.
 If p, q.
 p only if q.
 p is sufficient for q.
 q if p.
 q whenever p.
 q is necessary for p.
 It is necessary for p that q.
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.
50
Solution: Any of the following -
“If Maria learns discrete mathematics, then she will find a good job.
“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.”
Conditional Statements/Implication
Example: Use this proposition and translate this to different
variations of conditional statement.
(1) If she smiles then she is happy.
(2) The door will open only if you have the keys.
(3) Cats are annoyed when its raining
Conditional Statements/Implication
A useful way to understand the truth value of a conditional
statement is to think of an obligation or a contract. For
example, the pledge many politicians make when running for
office is
“If I am elected, then I will lower taxes.”
The Implication Operator
The implication p  q states that p implies q.
I.e., If p is true, then q is true; but if p is not true, then q could be either
true or false.
E.g., let p = “You study hard.”
q = “You will get a good grade.”
p  q = “If you study hard, then you will get a good grade.” (else, it could
go either way)
Topic #1.0 – Propositional Logic: Operators
antecedent consequent
Implication Truth Table
• p  q is false only when
p is true but q is not true.
• p  q does not say
that p causes q!
• p  q does not require
that p or q are ever true!
• E.g. “(1=0)  pigs can fly” is TRUE!
54
p q pq
T T T
T F F
F T T
F F T
The
only
False
case!
Examples of Implications
• “If this lecture ends, then the sun will rise tomorrow.”
True or False?
• “If Tuesday is a day of the week, then I am a penguin.”
True or False?
• “If 1+1=6, then Duterte is president.”
True or False?
• “If the moon is made of green cheese, then I am richer
than Bill Gates.” True or False?
Equivalence/Bi-conditional
Let p and q be a proposition. The bi-conditional pq is the
proposition that is TRUE when p and q have the same truth
values, and FALSE otherwise.
Example: “ p if and only if q”
p q p  q
T T T
T F F
F T F
F F T
The biconditional operator
The biconditional p  q states that p is true if and
only if (IFF) q is true.
p = “Obama wins the 2008 election.”
q = “Obama will be president for all of 2009.”
p  q = “If, and only if, Obama wins the 2008
election, Obama will be president for all of 2009.”
2008 2009
I’m still
here!
Biconditional Truth Table
• p  q means that p and q
have the same truth value.
• Note this truth table is the
exact opposite of ’s!
• p  q means ¬(p  q)
• p  q does not imply
p and q are true, or cause each other.
58
p q p  q
T T T
T F F
F T F
F F T
Equivalence/Biconditional
Example:
(1) Tom is happy if and only if he is healthy
(2) Let p be the statement “You can take the flight” and let q be
the statement “You buy a ticket.” Then p ↔ q is the statement
“You can take the flight if and only if you buy a ticket.”
Implication:
If you buy a ticket you can take the flight.
If you don’t buy a ticket you cannot take the flight.
Converse, Inverse and Contrapositive
For the proposition p  q, the first statement p is the
antecedent or the hypothesis and the second statement q is the
consequent or conclusion. When q became the hypothesis and
p became the consequent this statement is called converse
proposition (q  p). Example the statement “If I get high
grades, then I study hard” is the converse proposition for the
statement “If I study hard, then I will get high grades”.
Converse, Inverse and Contrapositive
Inverse proposition on the other hand is when the proposition p
 q is negated and became p  q. Both converse and inverse
proposition are not necessary true as the conditional proposition.
However the contrapositive proposition and the conditional
proposition are logically equivalent. Which means q  p  p
 q.
Converse, Inverse, Contrapositive
Some terminology, for an implication p  q:
• Its converse is: q  p.
• Its inverse is: ¬p  ¬q.
• Its contrapositive: ¬q  ¬ p.
• One of these three has the same meaning (same truth table)
as p  q. Can you figure out which?
How do we know for sure?
Proving the equivalence of p  q and its contrapositive using truth
tables:
63
p q q p pq q p
F F T T T T
F T F T T T
T F T F F F
T T F F T T
EXAMPLE
What are the contrapositive, the converse, and the inverse of the conditional statement
“The home team wins whenever it is raining?”
Solution: 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 and Contrapositive
Example: Find the converse, inverse and contrapositive
propositions for the following statements.
P = I study hard.
Q = I’ll get high grades.
Converse and Contrapositive
Example: Find the converse and contrapositive propositions for
the following propositions:
(1) The sun goes down only if it is night time.
(2) It is a sunny day and the sky is blue
(3) Scott is a rich kid if and only if he has a sports car.
Nested Propositional Expressions
• Use parentheses to group sub-expressions:
“I just saw my old friend, and either he’s grown or I’ve shrunk.” = p
 (q  r)
• (p  q)  r would mean something different
• p  q  s would be ambiguous
• By convention, “¬” takes precedence over both “” and “”.
• ¬r  p means (¬r)  p , not ¬ (r  p)
A Simple Exercise
Let p=“It rained last night”,
q=“The sprinklers came on last night,”
r=“The lawn was wet this morning.”
Translate each of the following into English:
¬p =
r  ¬p =
(¬ r  p)  q =
68
“It didn’t rain last night.”
“The lawn was wet this morning, and
it didn’t rain last night.”
“Either the lawn wasn’t wet this
morning, or it rained last night, or
the sprinklers came on last night.”
Topic #1.0 – Propositional Logic: Operators
The Exclusive Or Operator
The binary exclusive-or operator “” (XOR) combines two
propositions to form their logical “exclusive or” (exjunction?).
p = “I will earn an A in this course,”
q = “I will drop this course,”
p  q = “I will either earn an A for this course, or I will drop it
(but not both!)”
Exclusive-Or Truth Table
• Note that pq means
that p is true, or q is
true, but not both!
• This operation is
called exclusive or,
because it excludes the
possibility that both p and q are true.
• “¬” and “” together are not universal.
p q pq
T T F
T F T
F T T
F F F
Constructing a Truth Table
Construct a truth table for the propositional form
(pq)
Constructing a Truth Table
Construct a truth table for the propositional form
p(pq)

More Related Content

Similar to Foundation_Logic_1.pptx discrete mathematics

AI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptxAI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptxAsst.prof M.Gokilavani
 
CSC375CSCM75Logic for Computer ScienceUlrich Berger.docx
CSC375CSCM75Logic for Computer ScienceUlrich Berger.docxCSC375CSCM75Logic for Computer ScienceUlrich Berger.docx
CSC375CSCM75Logic for Computer ScienceUlrich Berger.docxfaithxdunce63732
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Sabu Francis
 
NLP Bootcamp 2018 : Representation Learning of text for NLP
NLP Bootcamp 2018 : Representation Learning of text for NLPNLP Bootcamp 2018 : Representation Learning of text for NLP
NLP Bootcamp 2018 : Representation Learning of text for NLPAnuj Gupta
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfMAJDABDALLAH3
 
Knowledge base system appl. p 1,2-ver1
Knowledge base system appl.  p 1,2-ver1Knowledge base system appl.  p 1,2-ver1
Knowledge base system appl. p 1,2-ver1Taymoor Nazmy
 
Math viva [www.onlinebcs.com]
Math viva [www.onlinebcs.com]Math viva [www.onlinebcs.com]
Math viva [www.onlinebcs.com]Itmona
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAsst.prof M.Gokilavani
 
Lec 3 knowledge acquisition representation and inference
Lec 3  knowledge acquisition representation and inferenceLec 3  knowledge acquisition representation and inference
Lec 3 knowledge acquisition representation and inferenceEyob Sisay
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)SURBHI SAROHA
 
Deductive databases
Deductive databasesDeductive databases
Deductive databasesJohn Popoola
 
chapter2 Know.representation.pptx
chapter2 Know.representation.pptxchapter2 Know.representation.pptx
chapter2 Know.representation.pptxwendifrawtadesse1
 

Similar to Foundation_Logic_1.pptx discrete mathematics (20)

AI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptxAI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptx
 
CSC375CSCM75Logic for Computer ScienceUlrich Berger.docx
CSC375CSCM75Logic for Computer ScienceUlrich Berger.docxCSC375CSCM75Logic for Computer ScienceUlrich Berger.docx
CSC375CSCM75Logic for Computer ScienceUlrich Berger.docx
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1
 
NLP Bootcamp 2018 : Representation Learning of text for NLP
NLP Bootcamp 2018 : Representation Learning of text for NLPNLP Bootcamp 2018 : Representation Learning of text for NLP
NLP Bootcamp 2018 : Representation Learning of text for NLP
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdf
 
Chapter 5 (final)
Chapter 5 (final)Chapter 5 (final)
Chapter 5 (final)
 
Knowledge base system appl. p 1,2-ver1
Knowledge base system appl.  p 1,2-ver1Knowledge base system appl.  p 1,2-ver1
Knowledge base system appl. p 1,2-ver1
 
Math viva [www.onlinebcs.com]
Math viva [www.onlinebcs.com]Math viva [www.onlinebcs.com]
Math viva [www.onlinebcs.com]
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
Lec 3 knowledge acquisition representation and inference
Lec 3  knowledge acquisition representation and inferenceLec 3  knowledge acquisition representation and inference
Lec 3 knowledge acquisition representation and inference
 
NLP Bootcamp
NLP BootcampNLP Bootcamp
NLP Bootcamp
 
Artificial intelligence course work
Artificial intelligence  course workArtificial intelligence  course work
Artificial intelligence course work
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
 
Deductive databases
Deductive databasesDeductive databases
Deductive databases
 
AI_Session 20 Horn clause.pptx
AI_Session 20 Horn clause.pptxAI_Session 20 Horn clause.pptx
AI_Session 20 Horn clause.pptx
 
chapter2 Know.representation.pptx
chapter2 Know.representation.pptxchapter2 Know.representation.pptx
chapter2 Know.representation.pptx
 
Geuvers slides
Geuvers slidesGeuvers slides
Geuvers slides
 
Lesson 19
Lesson 19Lesson 19
Lesson 19
 
AI Lesson 19
AI Lesson 19AI Lesson 19
AI Lesson 19
 
Unit -I Toc.pptx
Unit -I Toc.pptxUnit -I Toc.pptx
Unit -I Toc.pptx
 

More from SherwinSangalang3 (7)

AufEx4_12_06.ppt
AufEx4_12_06.pptAufEx4_12_06.ppt
AufEx4_12_06.ppt
 
AufEx4_02_04.ppt
AufEx4_02_04.pptAufEx4_02_04.ppt
AufEx4_02_04.ppt
 
AufEx4_02_01.ppt
AufEx4_02_01.pptAufEx4_02_01.ppt
AufEx4_02_01.ppt
 
AufEx4_01_03.ppt
AufEx4_01_03.pptAufEx4_01_03.ppt
AufEx4_01_03.ppt
 
AufEx4_01_02.ppt
AufEx4_01_02.pptAufEx4_01_02.ppt
AufEx4_01_02.ppt
 
AufEx4_01_01.ppt
AufEx4_01_01.pptAufEx4_01_01.ppt
AufEx4_01_01.ppt
 
CHAP1.pdf
CHAP1.pdfCHAP1.pdf
CHAP1.pdf
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Foundation_Logic_1.pptx discrete mathematics

  • 2. 2024-02-05 2 What is Mathematics, really?
  • 3. 2024-02-05 3 So, what’s this class about?
  • 4. What is discrete mathematics? The study of discrete objects. Discrete mathematics is the part of mathematics devoted to discrete means consisting of distinct or unconnected elements.
  • 5. The kinds of problems solved using discrete mathematics include: • How many ways are there to choose a valid password on a computer system? • What is the probability of winning a lottery? • Is there a link between two computers in a network? • How can I identify spam e-mail messages? • How can I encrypt a message so that no unintended recipient can read it? • What is the shortest path between two cities using a transportation system? • How can a list of integers be sorted so that the integers are in increasing order?
  • 6. The kinds of problems solved using discrete mathematics include: • How many steps are required to do such a sorting? • How can it be proved that a sorting algorithm correctly sorts a list? • How can a circuit that adds two integers be designed? • How many valid Internet addresses are there? You will learn the discrete structures and techniques needed to solve problems such as these. More generally, discrete mathematics is used whenever objects are counted, when relationships between finite (or countable) sets are studied, and when processes involving a finite number of steps are analyzed. A key reason for the growth in the importance of discrete mathematics is that information is stored and manipulated by computing machines in a discrete fashion.
  • 8. Through this course you can develop your mathematical maturity: that is, your ability to understand and create mathematical arguments.You will not get very far in your studies in the mathematical sciences without these skills. Second, discrete mathematics is the gateway to more advanced courses in all parts of the mathematical sciences. Discrete mathematics provides the mathematical foundations for many computer science courses including data structures and algorithms, database theory, formal languages, compiler theory, computer security, and operating systems. Why Study Discrete Math?
  • 9. Math courses based on the material studied in discrete mathematics include logic, set theory, number theory, linear algebra, abstract algebra, combinatorics, graph theory, and probability theory (the discrete part of the subject). Also, discrete mathematics contains the necessary mathematical background for solving problems in operations research (including many discrete optimization techniques), chemistry, engineering, biology, and so on. In the text, we will study applications to some of these areas. Many students find their introductory discrete mathematics course to be significantly more challenging than courses they have Why Study Discrete Math?
  • 10. Lesson 1: Introduction to Logic Chapter 1. Foundations of Logic
  • 11. LEARNING OUTCOMES By: SHERWIN C. SANGALANG At the end of the lesson, the students should be able to: 1. explain and apply basic notions of symbolic logic 2. define proposition and argument and explain propositional connectives. 3. construct truth table and apply logical operators 4. explain and exemplify truth value status of a proposition
  • 12. Logic  Logic is a language for reasoning.  In logic we are interested whether the statement is true or false , and how the truthness/falsehood of a statement can be determined from other statements.  “Logic” is “the study of the principles of reasoning, especially of the structure of propositions as distinguished from their content and of method and validity in deductive reasoning.” (thefreedictionary.com)
  • 13. Logic  Logic – used to distinguish between valid and invalid mathematical arguments.  There are various types of logic such as logic of sentences, logic of objects, logic involving uncertainties, temporal logic etc.
  • 14.
  • 15. Propositional Logic Propositional Logic is the logic of compound statements built from simpler statements using so-called Boolean connectives. Some applications in computer science: • Design of digital electronic circuits. • Expressing conditions in programs. • Queries to databases & search engines. 2024-02-05 15 Topic #1 – Propositional Logic George Boole (1815-1864) Chrysippus of Soli (ca. 281 B.C. – 205 B.C.)
  • 16. Propositional Logic  Propositional logic is a logic at the sentential level.  The smallest unit we deal with in propositional logic is a sentence.  Sentences considered in propositional logic are not arbitrary sentences but are the ones that are either true or false, but not both. This kind of sentences are called propositions.
  • 17. Definition of a Proposition A proposition (p, q, r, …) is simply a statement (i.e., a declarative sentence) with a definite meaning, having a truth value that’s either true (T) or false (F) (never both, neither, or somewhere in between). (However, you might not know the actual truth value, and it might be situation-dependent.) [Later we will study probability theory, in which we assign degrees of certainty to propositions. But for now: think True/False only!] 17 Topic #1 – Propositional Logic
  • 18. Examples of Propositions • “It is raining.” (In a given situation.) • “Beijing is the capital of China.” • “1 + 2 = 3” But, the following are NOT propositions: • “Who’s there?” (interrogative, question) • “La la la la la.” (meaningless interjection) • “Just do it!” (imperative, command) • “Yeah, I sorta dunno, whatever...” (vague) • “1 + 2” (expression with a non-true/false value) 18 Topic #1 – Propositional Logic
  • 19. Propositional Logic  If a proposition is true, then we say it has a truth value of "true"; if a proposition is false, its truth value is "false".  The first proposition has the truth value of "true" and the second "false". Example: "Grass is green", "2 + 5 = 5"
  • 20. Propositional Logic 1. San Jose, is the capital of Occidental Mindoro. 2. 1 + 1 = 2 3. What time is it? 4. Read this carefully. 5. x + 1 = 2
  • 21. Elements of Propositional Logic Simple sentences which are true or false are basic propositions. Larger and more complex sentences are constructed from basic propositions by combining them with connectives. Compound Proposition is a proposition that has its truth value completely determined by the truth values of two or more propositions and the operators (also called connectives) connecting them.
  • 22. Operators / Connectives An operator or connective combines one or more operand expressions into a larger expression. (E.g., “+” in numeric exprs.) Unary operators take 1 operand (e.g., −3); binary operators take 2 operands (eg 3  4). Propositional or Boolean operators operate on propositions or truth values instead of on numbers. 22 Topic #1.0 – Propositional Logic: Operators
  • 23. Elements of Propositional Logic Though there are many connectives, we are going to use the following five basic: NOT (), AND (), OR (), IF_THEN or IMPLY (), IF_AND_ONLY_IF ().
  • 24. Some Popular Boolean Operators Formal Name Nickname Arity Symbol Negation operator NOT Unary ¬ Conjunction operator AND Binary  Disjunction operator OR Binary  Exclusive-OR operator XOR Binary  Implication operator IMPLIES Binary  Biconditional operator IFF Binary ↔ 24
  • 25. Elements of Propositional Logic In such a case rather than stating them for each individual proposition we use variables representing an arbitrary proposition and state properties/relations in terms of those variables. Those variables are called a propositional variable. Propositional variables are also considered a proposition and called a proposition since they represent a proposition hence they behave the same way as propositions.
  • 26. Elements of Propositional Logic P  Q Propositional variables Connective
  • 27. Compound Propositions When two or more propositions are joined together using connectives this statement is called a compound proposition. Example “John is smart or he studies every night.”
  • 28. TRUTH TABLE A truth table is a device that allows us to analyze and compare compound logic statements. In logic, given a proposition, a truth table shows all the possible truth values of a proposition. Example: (for a simple proposition), the truth table is p T F
  • 29. TRUTH TABLE • A truth table is useful if we need to show the possible truth values of compound propositions. • Example: (for compound propositions with p and q as component propositions) • First determine the number of possible combinations of the simple propositions. For 2 component propositions, the number of combinations is 4 (given by the equation “𝑁 = 2𝑛” where N is the number of combinations and n is the number of component propositions.
  • 30. THE BASIC RULES FOR CONSTRUCTING A TRUTH TABLE FOR A COMPOUND STATEMENT 1. The number of rows in the truth table depends upon the number of basic variables in the compound statement. To determine the number of rows required, count the number of basic variables in the statement, but don't re-count multiple occurrences of a variable. • variable---2 rows • variables--4 rows • variables--8 rows • variables--16 rows and so forth.
  • 31. THE BASIC RULES FOR CONSTRUCTING A TRUTH TABLE FOR A COMPOUND STATEMENT 2. The number of columns in a truth table depends upon the number of logical connectives in the statement. The following guidelines are usually reliable. • There will be one column for each basic variable; and • To determine the number of other columns, count the number of logical connectives in the statement; do re-count multiple occurrences of the same connective. The “~” symbol counts as a logical connective. • In addition to the columns for each basic variable, there will usually be one column for each occurrence of a logical connective
  • 32. THE BASIC RULES FOR CONSTRUCTING A TRUTH TABLE FOR A COMPOUND STATEMENT 3. The beginning columns are filled in so as to take into account every possible combination of the basic variables being true or false. Each row represents one of the possible combinations. 4. In order to fill in any other column in the truth table, you must refer to a previous column or columns.
  • 33. The Negation Operator The unary negation operator “¬” (NOT) transforms a prop. into its logical negation. E.g. If p = “I have brown hair.” then ¬p = “I do not have brown hair.” Truth table for NOT: 33 p p T F F T T :≡ True; F :≡ False “:≡” means “is defined as” Operand column Result column Topic #1.0 – Propositional Logic: Operators
  • 34. Logical Connectives (1) Not (negation) : (~) or () Let p be a proposition. The negation of p is denoted by: p, and read as “not p”. Example: Find the negation of the proposition “Today is Friday”.
  • 35. Logical Connectives DEFINITION 1 Let p be a proposition. The negation of p, denoted by¬p (also denoted by ¯), is the statement “It is not the case that p.” The proposition ¬p is read “not p.” The truth value of the negation of p, ¬p, is the opposite of the truth value of p. P
  • 36. EXAMPLE EXAMPLE1. Find the negation of the proposition “Michael’s PC runs Linux” and express this in simple English. SOLUTION: The negation is “It is not the case that Michael’s PC runs Linux.” This negation can be more simply expressed as “Michael’s PC does not run Linux.” ▲
  • 37. EXAMPLE Find the negation of the proposition “Maria’s smartphone has at least 32GB of memory” and express this in simple English. Solution: The negation is “It is not the case that Maria’s smartphone has at least 32GB of memory.” This negation can also be expressed as “Maria’s smartphone does not have at least 32GB of memory” or even more simply as “Maria’s smartphone has less than 32GB of memory.”
  • 38. The Conjunction Operator The binary conjunction operator “” (AND) combines two propositions to form their logical conjunction. E.g. If p=“I will have salad for lunch.” and q=“I will have steak for dinner.”, then pq=“I will have salad for lunch and I will have steak for dinner.” 38 Remember: “” points up like an “A”, and it means “ND” ND Topic #1.0 – Propositional Logic: Operators
  • 39. Logical Connectives (2) And (conjunction) : Let p and q be prepositions. The preposition of “p and q” is denoted by p  q, is TRUE when BOTH p and q are true and otherwise is FALSE. p q p  q T T T T F F F T F F F F
  • 40. Conjunction Truth Table • Note that a conjunction p1  p2  …  pn of n propositions will have 2n rows in its truth table. • Also: ¬ and  operations together are suffi- cient to express any Boolean truth table! 40 p q pq T T T T F F F T F F F F Operand columns
  • 41. EXAMPLE Find the conjunction of the propositions p and q where p is the proposition “Rebecca’s PC has more than 16 GB free hard disk space” and q is the proposition “The processor in Rebecca’s PC runs faster than 1 GHz.
  • 42. Solution: The conjunction of these propositions, p ∧ q, is the proposition “Rebecca’s PC has more than 16 GB free hard disk space, and the processor in Rebecca’s PC runs faster than 1GHz.” This conjunction can be expressed more simply as “Rebecca’s 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 conditions given must be true. It is false, when one or both of these conditions are false.
  • 43. Logical Connectives (3) Or (disjunction) :  Let p and q be propositions. The preposition of “p or q” - denoted pq, is FALSE when BOTH p and q are FALSE and TRUE otherwise. p q pq T T T T F T F T T F F F
  • 44. The Disjunction Operator The binary disjunction operator “” (OR) combines two propositions to form their logical disjunction. p=“My car has a bad engine.” q=“My car has a bad carburetor.” pq=“Either my car has a bad engine, or my car has a bad carburetor.” 44 After the downward- pointing “axe” of “” splits the wood, you can take 1 piece OR the other, or both.  Topic #1.0 – Propositional Logic: Operators Meaning is like “and/or” in English.
  • 45. Disjunction Truth Table • Note that pq means that p is true, or q is true, or both are true! • So, this operation is also called inclusive or, because it includes the possibility that both p and q are true. • “¬” and “” together are also universal. 45 p q pq T T T T F T F T T F F F Note difference from AND
  • 46. Activity Consider the propositions and state whether it is true or false: 1) Ice floats in water and 2 + 2 = 4 2) China is not in Europe and 2 + 2 = 4 3) 5 – 3 = 1 or 2 x 2 = 4
  • 47. Another Activity Translate the following into logical notation, using p and q and logical connectives. p = It is below freezing q = It is snowing (a) It is below freezing and snowing (b) It is below freezing but not snowing (c) It is not below freezing and it is not snowing
  • 48. Conditional Statements/Implication Let p and q be a proposition. The implication pq is the proposition that is FALSE when p is true, q is false. Otherwise is TRUE. p is the antecedent and q is the consequence. p q pq T T T T F F F T T F F T
  • 49. Conditional Statements/Implication The following list presents some of the variations. These are all logically equivalent, that is as far as true or false of statement is concerned there is no difference between them.  If p, then q.  If p, q.  p only if q.  p is sufficient for q.  q if p.  q whenever p.  q is necessary for p.  It is necessary for p that q.
  • 50. 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. 50 Solution: Any of the following - “If Maria learns discrete mathematics, then she will find a good job. “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.”
  • 51. Conditional Statements/Implication Example: Use this proposition and translate this to different variations of conditional statement. (1) If she smiles then she is happy. (2) The door will open only if you have the keys. (3) Cats are annoyed when its raining
  • 52. Conditional Statements/Implication A useful way to understand the truth value of a conditional statement is to think of an obligation or a contract. For example, the pledge many politicians make when running for office is “If I am elected, then I will lower taxes.”
  • 53. The Implication Operator The implication p  q states that p implies q. I.e., If p is true, then q is true; but if p is not true, then q could be either true or false. E.g., let p = “You study hard.” q = “You will get a good grade.” p  q = “If you study hard, then you will get a good grade.” (else, it could go either way) Topic #1.0 – Propositional Logic: Operators antecedent consequent
  • 54. Implication Truth Table • p  q is false only when p is true but q is not true. • p  q does not say that p causes q! • p  q does not require that p or q are ever true! • E.g. “(1=0)  pigs can fly” is TRUE! 54 p q pq T T T T F F F T T F F T The only False case!
  • 55. Examples of Implications • “If this lecture ends, then the sun will rise tomorrow.” True or False? • “If Tuesday is a day of the week, then I am a penguin.” True or False? • “If 1+1=6, then Duterte is president.” True or False? • “If the moon is made of green cheese, then I am richer than Bill Gates.” True or False?
  • 56. Equivalence/Bi-conditional Let p and q be a proposition. The bi-conditional pq is the proposition that is TRUE when p and q have the same truth values, and FALSE otherwise. Example: “ p if and only if q” p q p  q T T T T F F F T F F F T
  • 57. The biconditional operator The biconditional p  q states that p is true if and only if (IFF) q is true. p = “Obama wins the 2008 election.” q = “Obama will be president for all of 2009.” p  q = “If, and only if, Obama wins the 2008 election, Obama will be president for all of 2009.” 2008 2009 I’m still here!
  • 58. Biconditional Truth Table • p  q means that p and q have the same truth value. • Note this truth table is the exact opposite of ’s! • p  q means ¬(p  q) • p  q does not imply p and q are true, or cause each other. 58 p q p  q T T T T F F F T F F F T
  • 59. Equivalence/Biconditional Example: (1) Tom is happy if and only if he is healthy (2) Let p be the statement “You can take the flight” and let q be the statement “You buy a ticket.” Then p ↔ q is the statement “You can take the flight if and only if you buy a ticket.” Implication: If you buy a ticket you can take the flight. If you don’t buy a ticket you cannot take the flight.
  • 60. Converse, Inverse and Contrapositive For the proposition p  q, the first statement p is the antecedent or the hypothesis and the second statement q is the consequent or conclusion. When q became the hypothesis and p became the consequent this statement is called converse proposition (q  p). Example the statement “If I get high grades, then I study hard” is the converse proposition for the statement “If I study hard, then I will get high grades”.
  • 61. Converse, Inverse and Contrapositive Inverse proposition on the other hand is when the proposition p  q is negated and became p  q. Both converse and inverse proposition are not necessary true as the conditional proposition. However the contrapositive proposition and the conditional proposition are logically equivalent. Which means q  p  p  q.
  • 62. Converse, Inverse, Contrapositive Some terminology, for an implication p  q: • Its converse is: q  p. • Its inverse is: ¬p  ¬q. • Its contrapositive: ¬q  ¬ p. • One of these three has the same meaning (same truth table) as p  q. Can you figure out which?
  • 63. How do we know for sure? Proving the equivalence of p  q and its contrapositive using truth tables: 63 p q q p pq q p F F T T T T F T F T T T T F T F F F T T F F T T
  • 64. EXAMPLE What are the contrapositive, the converse, and the inverse of the conditional statement “The home team wins whenever it is raining?” Solution: 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.
  • 65. Converse and Contrapositive Example: Find the converse, inverse and contrapositive propositions for the following statements. P = I study hard. Q = I’ll get high grades.
  • 66. Converse and Contrapositive Example: Find the converse and contrapositive propositions for the following propositions: (1) The sun goes down only if it is night time. (2) It is a sunny day and the sky is blue (3) Scott is a rich kid if and only if he has a sports car.
  • 67. Nested Propositional Expressions • Use parentheses to group sub-expressions: “I just saw my old friend, and either he’s grown or I’ve shrunk.” = p  (q  r) • (p  q)  r would mean something different • p  q  s would be ambiguous • By convention, “¬” takes precedence over both “” and “”. • ¬r  p means (¬r)  p , not ¬ (r  p)
  • 68. A Simple Exercise Let p=“It rained last night”, q=“The sprinklers came on last night,” r=“The lawn was wet this morning.” Translate each of the following into English: ¬p = r  ¬p = (¬ r  p)  q = 68 “It didn’t rain last night.” “The lawn was wet this morning, and it didn’t rain last night.” “Either the lawn wasn’t wet this morning, or it rained last night, or the sprinklers came on last night.” Topic #1.0 – Propositional Logic: Operators
  • 69. The Exclusive Or Operator The binary exclusive-or operator “” (XOR) combines two propositions to form their logical “exclusive or” (exjunction?). p = “I will earn an A in this course,” q = “I will drop this course,” p  q = “I will either earn an A for this course, or I will drop it (but not both!)”
  • 70. Exclusive-Or Truth Table • Note that pq means that p is true, or q is true, but not both! • This operation is called exclusive or, because it excludes the possibility that both p and q are true. • “¬” and “” together are not universal. p q pq T T F T F T F T T F F F
  • 71. Constructing a Truth Table Construct a truth table for the propositional form (pq)
  • 72. Constructing a Truth Table Construct a truth table for the propositional form p(pq)

Editor's Notes

  1. The foundation of the logic we are going to learn here was laid down by a British mathematician George Boole in the middle of the 19th century, and it was further developed and used in an attempt to derive all of mathematics by Gottlob Frege, a German mathematician, towards the end of the 19th century. A British philosopher/mathematician, Bertrand Russell, found a flaw in basic assumptions in Frege's attempt but he, together with Alfred Whitehead, developed Frege's work further and repaired the damage. The logic we study today is more or less along this line.
  2. There are various types of logic such as logic of sentences (propositional logic), logic of objects (predicate logic), logic involving uncertainties, logic dealing with fuzziness, temporal logic etc.
  3. 2024-02-05
  4. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  5. . We do not go inside individual sentences and analyze or discuss their meanings. We are going to be interested only in true or false of sentences, and major concern is whether or not the truth or falsehood of a certain sentence follows from those of a set of sentences, and if so, how.
  6. . We do not go inside individual sentences and analyze or discuss their meanings. We are going to be interested only in true or false of sentences, and major concern is whether or not the truth or falsehood of a certain sentence follows from those of a set of sentences, and if so, how.
  7. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  8. 2024-02-05
  9. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  10. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  11. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  12. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  13. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  14. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  15. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  16. 2024-02-05
  17. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  18. 2024-02-05
  19. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  20. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  21. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  22. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  23. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  24. 2024-02-05
  25. 2024-02-05
  26. 2024-02-05
  27. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  28. 2024-02-05
  29. 2024-02-05
  30. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  31. If I study hard, then I will get high grades (if p then q) She is a good photographer only if she passes the photographers exam (q only if p) cats are annoyed when its raining (p when q) Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  32. If I study hard, then I will get high grades (if p then q) She is a good photographer only if she passes the photographers exam (q only if p) cats are annoyed when its raining (p when q) Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  33. 2024-02-05
  34. If I study hard, then I will get high grades (if p then q) She is a good photographer only if she passes the photographers exam (q only if p) cats are annoyed when its raining (p when q) Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  35. Proposition (or statement) = a declarative statement (in contrast to a command, a question, or an exclamation) which is true or false, but not both.
  36. 2024-02-05
  37. 2024-02-05
  38. 2024-02-05
  39. P  (Q v ~Q)
  40. P  (Q v ~Q)