SlideShare a Scribd company logo
1 of 40
TN 110: INTRODUCTION TO
DISCRETE MATHEMATICS
Instructor: Mr. Paschal Charles
Assistant Lecturer
Office No. AB11
THE FOUNDATIONS: LOGIC AND PROOFS
Propositional Logic
Proposions
 This is a declarative sentence (i.e a sentence that
declares a fact) that is either TRUE or FALSE, but not
both.
Example 1.
All the following declarative sentences are propositions.
1. Washington, DC., is the capital of the U.S.A
2. Arusha is the capital of Tanzania
3. 1 + 2 = 3
4. 2 + 3 = 6
2
THE FOUNDATIONS: LOGIC AND PROOFS
…Example 1.
Proposition 1 and 3 are TRUE, whereas 2 and 4 are
FALSE.
Example 2.
1. What time is it?
2. Read this carefully.
3. 𝑥 + 1 = 2
4. 𝑥 + 𝑦 = 𝑧
Sentences 1 and 2 are NOT propositions because
they are NOT declarative sentences
Mayengo,
M.
M
3
THE FOUNDATIONS: LOGIC AND PROOFS
…Example 2.
1. What time is it?
2. Read this carefully.
3. 𝑥 + 1 = 2
4. 𝑥 + 𝑦 = 𝑧
Sentences 3 and 4 are not propositions because they
are neither TRUE nor FALSE.
NOTE: Sentence 3 and 4 can be turned into
proposition if we assign the values to the variables.
Mayengo,
M.
M
4
THE FOUNDATIONS: LOGIC AND PROOFS
Propositional variables
 The use of letters to represent propositions
 Conventional letters used for propositional variables
are 𝑝, 𝑞, 𝑟, 𝑠, …
 The truth value of a proposition is TRUE, is denoted
by 𝑇
 The truth value of a proposition is FALSE, is
denoted by 𝐹
Mayengo,
M.
M
5
THE FOUNDATIONS: LOGIC AND PROOFS
Definition 1
Let 𝑝 be a proposition. The 𝑛𝑒𝑔𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑝, denoted as
~𝑝, is the statement “it is not the case that 𝑝”. The
proposition ~𝑝 is read “not 𝑝“
The truth value of the negation of 𝑝, ~𝑝, is the
opposite of the truth value of 𝑝.
Mayengo,
M.
M
Example 3
Find the negation of the proposition
“Michael’s PC runs LINUX” and express it in simple English
6
THE FOUNDATIONS: LOGIC AND PROOFS
…Example 3
“Michael’s PC runs LINUX”
Solution 3
“It is not the case that Michael’s PC runs LINUX”
and express it in simple English
In simple English we say; “Michael’s PC does not
runs LINUX”
Mayengo,
M.
M
7
THE FOUNDATIONS: LOGIC AND PROOFS
Example 4
Find the negation of the proposition
“John’s smartphone has at least 32GB of memory”
and express it in simple English.
Solution 4
“It is not the case that John’s smartphone has at least
32GB of memory”
In simple English we say: “John’s smartphone does
not have at least 32GB of memory”
Or even more simply as: “John’s smartphone has less
than 32GB of memory”
Mayengo,
M.
M
8
T
HE
F
OUNDATIONS
:
L
OGIC
AND
P
ROOFS
Table 1.
The truth
table for
the
negation
of the
propositi
on
Truth Table
Mayengo,
M.
M
9
THE FOUNDATIONS: LOGIC AND PROOFS
Definition 2
Let 𝑝 and 𝑞 be a propositions. The conjunction 𝑜𝑓 𝑝,
denoted as 𝑝⋀q, is the proposition “𝑝 𝑎𝑛𝑑 𝑞”. The
conjunction 𝑝⋀q is TRUE when both 𝑝 and 𝑞 are
TRUE and FALSE otherwise.
Mayengo,
M.
M
10
T
HE
F
OUNDATIONS
:
L
OGIC
AND
P
ROOFS
Table 2.
The truth
table for
the
conjuncti
on of two
propositi
ons
Truth Table
Mayengo,
M.
M
11
THE FOUNDATIONS: LOGIC AND PROOFS
Definition 3
Let 𝑝 and 𝑞 be a propositions. The disjunction 𝑜𝑓 𝑝,
denoted as 𝑝 ∨ q, is the proposition “𝑝 𝑜𝑟 𝑞”. The
disjunction 𝑝 ∨ q is FALSE when both 𝑝 and 𝑞 are
FALSE and TRUE otherwise.
Mayengo,
M.
M
12
T
HE
F
OUNDATIONS
:
L
OGIC
AND
P
ROOFS
Table 3.
The truth
table for
the
disjuncti
on of two
propositi
ons
Truth Table
13
THE FOUNDATIONS: LOGIC AND PROOFS
Facts:
 The use of connective 𝑜𝑟 in a disjunction
corresponds to one of the two ways the word 𝑜𝑟 is
used in English, namely, as an inclusive or.
 A disjunction is TRUE when at least one of the two
propositions is TRUE
Mayengo,
M.
M
14
THE FOUNDATIONS: LOGIC AND PROOFS
Example 5
Find the conjunction of the propositions 𝑝 and 𝑞 where 𝑝 is
the proposition “Peter’s PC has more than 16GB free hard
disc space” and 𝑞 is the proposition “The processor in
Peter’s PC runs faster than 1GHz”
Solution 5
The conjunction of these propositions, 𝑝 ∧ 𝑞, is the
proposition “Peter’s PC has more than 16GB free hard
disc space, and its processor runs faster than 1GHz”
Hint: For this conjunction to be true, both conditions given
must be true. It is false when one of these conditions are
false.
Mayengo,
M.
M
15
THE FOUNDATIONS: LOGIC AND PROOFS
Example 6
What is the disjunction of 𝑝 and 𝑞 where 𝑝 and 𝑞 are the
same propositions as in Example 5 above?
Solution 6
The disjunction of 𝑝 and 𝑞, 𝑝 ∨ 𝑞, is the propositions
“Peter’s PC has at least 16GB free hard disc space, or the
processor in Peter’s PC runs faster than 1GHz”
Hint: This proposition is FALSE when both of these
conditions are FALSE, otherwise it is TRUE.
Mayengo,
M.
M
16
THE FOUNDATIONS: LOGIC AND PROOFS
Definition 4
Let 𝑝 and 𝑞 be a propositions.
The exclusive or 𝑜𝑓 𝑝 𝑎𝑛𝑑 𝑞, denoted as 𝑝⨁q, is the
proposition that is TRUE when exactly one of 𝑝 and q
is TRUE and FALSE otherwise
Mayengo,
M.
M
17
T
HE
F
OUNDATIONS
:
L
OGIC
AND
P
ROOFS
Table 4.
The truth
table for
the
exclusive
or of two
propositio
ns
Truth Table
Yes, this is how it should look like. You
had a better try…!
Mayengo,
M.
M
18
THE FOUNDATIONS: LOGIC AND PROOFS
Conditional statements
Definition 5
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 premise)
and q is called the conclusion.
Mayengo,
M.
M
19
THE FOUNDATIONS: LOGIC AND PROOFS
Conditional statements
 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.
 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).
 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 them
if not all.
Mayengo,
M.
M
20
THE FOUNDATIONS: LOGIC AND PROOFS
Mayengo,
M.
M
 “if p, then q”
 “p implies q”
 “if p, q”
 “p only if q”
 “p is sufficient for q”
 “a sufficient condition for q
is p”
 “q if p”
 “q whenever p”
 “q when p”
 “q is necessary for p”
 “a necessary condition for p
is q”
 “q follows from p”
 “q unless ~p”
Conditional statements
You are likely to encounter most if not all of the following ways to
express this conditional statement:
21
THE FOUNDATIONS: LOGIC AND PROOFS
Example 7
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.
Solution 7
From the definition of conditional statements, we see
that p → q represents the statement;
“If Maria learns discrete mathematics, then she will
find a good job.”
Mayengo,
M.
M
22
THE FOUNDATIONS: LOGIC AND PROOFS
There are many other ways to express this
conditional statement in English. Among the most
natural of these are:
1. “Maria will find a good job when she learns
discrete mathematics.”
2. “For Maria to get a good job, it is sufficient for her
to learn discrete mathematics.” and
3. “Maria will find a good job unless she does not
learn discrete mathematics.”
Mayengo,
M.
M
23
THE FOUNDATIONS: LOGIC AND PROOFS
Converse, Contrapositive and Inverse
 We can form 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.
1. The proposition q → p is called the converse of
p → q.
2. The contrapositive of p → q is the proposition ~q
→~p.
3. The proposition ~p →~q is called the inverse of
p → q.
 We will see that of these three conditional statements
formed from p → q, only the contrapositive always has
the same truth value as p → q.
Mayengo,
M.
M
24
THE FOUNDATIONS: LOGIC AND PROOFS
Example 9
What are the contrapositive, the converse, and the inverse of the
conditional statement
“The home team wins whenever it is raining?”
Solution 9
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.
Mayengo,
M.
M
25
THE FOUNDATIONS: LOGIC AND PROOFS
Biconditionals
 We now introduce another way to combine propositions
that expresses that two propositions have the same
truth value.
Mayengo,
M.
M
Definition 6
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.
26
THE FOUNDATIONS: LOGIC AND PROOFS
Biconditionals
 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 ←.
Mayengo,
M.
M
27
THE FOUNDATIONS: LOGIC AND PROOFS
Biconditionals
 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).
Mayengo,
M.
M
28
THE FOUNDATIONS: LOGIC AND PROOFS
Mayengo,
M.
M
29
30
Mayengo,
M.
M
THE FOUNDATIONS: LOGIC AND PROOFS
Mayengo,
M.
M
Example 10
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.”
 This statement is true if p and q are either both true or both
false, that is, if you buy a ticket and can take the flight or if you
do not buy a ticket and you cannot take the flight.
 It is false when p and q have opposite truth values, that is,
when you do not buy a ticket, but you can take the flight and
when you buy a ticket but you cannot take the flight.
 The truth table for biconditionals is left for your practice
31
THE FOUNDATIONS: LOGIC AND PROOFS
Implicit Use of Biconditionals
 You should be aware that biconditionals are not always
explicit in natural language. In particular, the “if and only if”
construction used in biconditionals is rarely used in common
language. Instead, biconditionals are often expressed using
an “if, then” or an “only if” construction.
 The other part of the “if and only if” is implicit. That is, the
converse is implied, but not stated. For example, consider the
statement in English “If you finish your meal, then you can
have dessert.”
 What is really meant is “You can have dessert if and only if
you finish your meal.” This last statement is logically
equivalent to the two statements “If you finish your meal, then
you can have dessert” and “You can have dessert only if you
finish your meal.”
Mayengo,
M.
M
32
THE FOUNDATIONS: LOGIC AND PROOFS
Implicit Use of Biconditionals
 Because of this imprecision in natural language, we
need to make an assumption whether a conditional
statement in natural language implicitly includes its
converse.
 Because precision is essential in mathematics and
in logic, we will always distinguish between the
conditional statement p → q and the biconditional
statement p ↔ q.
Mayengo,
M.
M
33
THE FOUNDATIONS: LOGIC AND PROOFS
Truth Tables of Compound Propositions
 We have now introduced four important logical connectives—
conjunctions, disjunctions, conditional statements, and
biconditional statements—as well as negations.
 We can use these connectives to build up complicated
compound propositions involving any number of propositional
variables.
 We can use truth tables to determine the truth values of these
compound propositions.
 We use a separate column to find the truth value of each
compound expression that occurs in the compound
proposition as it is built up.
 The truth values of the compound proposition for each
combination of truth values of the propositional variables in it
is found in the final column of the table.
Mayengo,
M.
M
34
THE FOUNDATIONS: LOGIC AND PROOFS
Truth Tables of Compound Propositions
Example 11.
Construct the truth table of the compound proposition
(𝑝 ∨ ~𝑞) → (𝑝 ∧ 𝑞).
Solution 11:
 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.
Mayengo,
M.
M
35
THE FOUNDATIONS: LOGIC AND PROOFS
Truth Tables of Compound Propositions
Example 11.
Construct the truth table of the compound proposition
(𝑝 ∨ ~𝑞) → (𝑝 ∧ 𝑞).
Solution 11:
Mayengo,
M.
M
36
THE FOUNDATIONS: LOGIC AND PROOFS
Precedence of Logical Operators
 We can construct compound propositions using the negation operator
and the logical operators defined so far.
 We will generally use parentheses to specify the order in which logical
operators in a compound proposition are to be applied. For instance, (p ∨
q) ∧ (~r) is the conjunction of p ∨ q and ~r.
 However, to reduce the number of parentheses, we specify that the
negation operator is applied before all other logical operators.
 This means that ~p ∧ q is the conjunction of ~p and q, namely, (~p) ∧
q, not the negation of the conjunction of p and q, namely ~(p ∧ q).
 Another general rule of precedence is that the conjunction operator takes
precedence over the disjunction operator, so that p ∧ q ∨ r means (p ∧ q)
∨ r rather than p ∧ (q ∨ r).
 Because this rule may be difficult to remember, we will continue to use
parentheses so that the order of the disjunction and conjunction
operators is clear.
Mayengo,
M.
M
37
THE FOUNDATIONS: LOGIC AND PROOFS
Precedence of Logical Operators
 Finally, it is an accepted rule that the conditional
and biconditional operators → and ↔ have lower
precedence than the conjunction and disjunction
operators, ∧ and ∨.
 Consequently, p ∨ q → r is the same as (p ∨ q) → r.
 We will use parentheses when the order of the
conditional operator and biconditional operator is at
issue, although the conditional operator has
precedence over the biconditional operator.
Mayengo,
M.
M
38
THE FOUNDATIONS: LOGIC AND PROOFS
Logic and Bit Operations
 Computers represent information using bits.
 A bit is a symbol with two possible values, namely, 0 (zero) and 1
(one).
 This meaning of the word bit comes from binary digit, because
zeros and ones are the digits used in binary representations of
numbers.
 The well-known statistician John Tukey introduced this
terminology in 1946.
 A bit can be used to represent a truth value, because there are
two truth values, namely, true and false. As is customarily done,
we will use a 1 bit to represent true and a 0 bit to represent false.
That is, 1 represents T (true), 0 represents F (false).
 A variable is called a Boolean variable if its value is either true
or false. Consequently, a Boolean variable can be represented
using a bit.
Mayengo,
M.
M
39
THE FOUNDATIONS: LOGIC AND PROOFS
Logic and Bit Operations
 Computer bit operations correspond to the logical
connectives by replacing true by a one and false by
a zero in the truth tables for the operators ∧, ∨, and
⊕.
 We will also use the notation OR, AND, and XOR
for the operators ∨,∧, and ⊕, as is done in various
programming languages.
Mayengo,
M.
M
40

More Related Content

Similar to Discrete Math Logic and Proofs

desmath(1).ppt
desmath(1).pptdesmath(1).ppt
desmath(1).pptMemMem25
 
Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptxRavind8
 
Mathmatical reasoning
Mathmatical reasoningMathmatical reasoning
Mathmatical reasoningindu psthakur
 
proposition Logic-1.pptx Discrete Mathematics
proposition Logic-1.pptx Discrete Mathematicsproposition Logic-1.pptx Discrete Mathematics
proposition Logic-1.pptx Discrete MathematicsVimalKumar375828
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicUniversity of Potsdam
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxPriyalMayurManvar
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdfjayarao21
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdfsmarwaneid
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicTaymoor Nazmy
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptNandiniSR2
 

Similar to Discrete Math Logic and Proofs (20)

Propositional logic
Propositional logicPropositional logic
Propositional logic
 
desmath(1).ppt
desmath(1).pptdesmath(1).ppt
desmath(1).ppt
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
 
Logic&proof
Logic&proofLogic&proof
Logic&proof
 
Mathmatical reasoning
Mathmatical reasoningMathmatical reasoning
Mathmatical reasoning
 
proposition Logic-1.pptx Discrete Mathematics
proposition Logic-1.pptx Discrete Mathematicsproposition Logic-1.pptx Discrete Mathematics
proposition Logic-1.pptx Discrete Mathematics
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional Logic
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptx
 
DM(1).pptx
DM(1).pptxDM(1).pptx
DM(1).pptx
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdf
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logic
 
Logic.pptx
Logic.pptxLogic.pptx
Logic.pptx
 
Pnp
PnpPnp
Pnp
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.ppt
 
Bab 1 proposisi
Bab 1 proposisiBab 1 proposisi
Bab 1 proposisi
 
4 ch 2 logical reasoning
4 ch 2 logical reasoning4 ch 2 logical reasoning
4 ch 2 logical reasoning
 
Per3 logika&pembuktian
Per3 logika&pembuktianPer3 logika&pembuktian
Per3 logika&pembuktian
 
Chapter1p1.pdf
Chapter1p1.pdfChapter1p1.pdf
Chapter1p1.pdf
 

More from ITNet

lecture 8 b main memory
lecture 8 b main memorylecture 8 b main memory
lecture 8 b main memoryITNet
 
lecture 9.pptx
lecture 9.pptxlecture 9.pptx
lecture 9.pptxITNet
 
lecture 10.pptx
lecture 10.pptxlecture 10.pptx
lecture 10.pptxITNet
 
lecture 11.pptx
lecture 11.pptxlecture 11.pptx
lecture 11.pptxITNet
 
lecture 12.pptx
lecture 12.pptxlecture 12.pptx
lecture 12.pptxITNet
 
lecture 13.pptx
lecture 13.pptxlecture 13.pptx
lecture 13.pptxITNet
 
lecture 15.pptx
lecture 15.pptxlecture 15.pptx
lecture 15.pptxITNet
 
kandegeeee.pdf
kandegeeee.pdfkandegeeee.pdf
kandegeeee.pdfITNet
 
Ia 124 1621324160 ia_124_lecture_02
Ia 124 1621324160 ia_124_lecture_02Ia 124 1621324160 ia_124_lecture_02
Ia 124 1621324160 ia_124_lecture_02ITNet
 
Ia 124 1621324143 ia_124_lecture_01
Ia 124 1621324143 ia_124_lecture_01Ia 124 1621324143 ia_124_lecture_01
Ia 124 1621324143 ia_124_lecture_01ITNet
 
Cp 121 lecture 01
Cp 121 lecture 01Cp 121 lecture 01
Cp 121 lecture 01ITNet
 
Cp 111 5 week
Cp 111 5 weekCp 111 5 week
Cp 111 5 weekITNet
 
Teofilo kisanji university mbeya (TEKU) ambassador 2020
Teofilo kisanji university mbeya (TEKU) ambassador 2020Teofilo kisanji university mbeya (TEKU) ambassador 2020
Teofilo kisanji university mbeya (TEKU) ambassador 2020ITNet
 
Tn 110 lecture 8
Tn 110 lecture 8Tn 110 lecture 8
Tn 110 lecture 8ITNet
 
Tn 110 lecture 2 logic
Tn 110 lecture 2 logicTn 110 lecture 2 logic
Tn 110 lecture 2 logicITNet
 
internet
internetinternet
internetITNet
 
Im 111 lecture 1
Im 111   lecture 1Im 111   lecture 1
Im 111 lecture 1ITNet
 
development study perspective full
development study perspective fulldevelopment study perspective full
development study perspective fullITNet
 
Gender issues in developement
Gender issues in developementGender issues in developement
Gender issues in developementITNet
 
Religion
ReligionReligion
ReligionITNet
 

More from ITNet (20)

lecture 8 b main memory
lecture 8 b main memorylecture 8 b main memory
lecture 8 b main memory
 
lecture 9.pptx
lecture 9.pptxlecture 9.pptx
lecture 9.pptx
 
lecture 10.pptx
lecture 10.pptxlecture 10.pptx
lecture 10.pptx
 
lecture 11.pptx
lecture 11.pptxlecture 11.pptx
lecture 11.pptx
 
lecture 12.pptx
lecture 12.pptxlecture 12.pptx
lecture 12.pptx
 
lecture 13.pptx
lecture 13.pptxlecture 13.pptx
lecture 13.pptx
 
lecture 15.pptx
lecture 15.pptxlecture 15.pptx
lecture 15.pptx
 
kandegeeee.pdf
kandegeeee.pdfkandegeeee.pdf
kandegeeee.pdf
 
Ia 124 1621324160 ia_124_lecture_02
Ia 124 1621324160 ia_124_lecture_02Ia 124 1621324160 ia_124_lecture_02
Ia 124 1621324160 ia_124_lecture_02
 
Ia 124 1621324143 ia_124_lecture_01
Ia 124 1621324143 ia_124_lecture_01Ia 124 1621324143 ia_124_lecture_01
Ia 124 1621324143 ia_124_lecture_01
 
Cp 121 lecture 01
Cp 121 lecture 01Cp 121 lecture 01
Cp 121 lecture 01
 
Cp 111 5 week
Cp 111 5 weekCp 111 5 week
Cp 111 5 week
 
Teofilo kisanji university mbeya (TEKU) ambassador 2020
Teofilo kisanji university mbeya (TEKU) ambassador 2020Teofilo kisanji university mbeya (TEKU) ambassador 2020
Teofilo kisanji university mbeya (TEKU) ambassador 2020
 
Tn 110 lecture 8
Tn 110 lecture 8Tn 110 lecture 8
Tn 110 lecture 8
 
Tn 110 lecture 2 logic
Tn 110 lecture 2 logicTn 110 lecture 2 logic
Tn 110 lecture 2 logic
 
internet
internetinternet
internet
 
Im 111 lecture 1
Im 111   lecture 1Im 111   lecture 1
Im 111 lecture 1
 
development study perspective full
development study perspective fulldevelopment study perspective full
development study perspective full
 
Gender issues in developement
Gender issues in developementGender issues in developement
Gender issues in developement
 
Religion
ReligionReligion
Religion
 

Recently uploaded

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

Discrete Math Logic and Proofs

  • 1. TN 110: INTRODUCTION TO DISCRETE MATHEMATICS Instructor: Mr. Paschal Charles Assistant Lecturer Office No. AB11
  • 2. THE FOUNDATIONS: LOGIC AND PROOFS Propositional Logic Proposions  This is a declarative sentence (i.e a sentence that declares a fact) that is either TRUE or FALSE, but not both. Example 1. All the following declarative sentences are propositions. 1. Washington, DC., is the capital of the U.S.A 2. Arusha is the capital of Tanzania 3. 1 + 2 = 3 4. 2 + 3 = 6 2
  • 3. THE FOUNDATIONS: LOGIC AND PROOFS …Example 1. Proposition 1 and 3 are TRUE, whereas 2 and 4 are FALSE. Example 2. 1. What time is it? 2. Read this carefully. 3. 𝑥 + 1 = 2 4. 𝑥 + 𝑦 = 𝑧 Sentences 1 and 2 are NOT propositions because they are NOT declarative sentences Mayengo, M. M 3
  • 4. THE FOUNDATIONS: LOGIC AND PROOFS …Example 2. 1. What time is it? 2. Read this carefully. 3. 𝑥 + 1 = 2 4. 𝑥 + 𝑦 = 𝑧 Sentences 3 and 4 are not propositions because they are neither TRUE nor FALSE. NOTE: Sentence 3 and 4 can be turned into proposition if we assign the values to the variables. Mayengo, M. M 4
  • 5. THE FOUNDATIONS: LOGIC AND PROOFS Propositional variables  The use of letters to represent propositions  Conventional letters used for propositional variables are 𝑝, 𝑞, 𝑟, 𝑠, …  The truth value of a proposition is TRUE, is denoted by 𝑇  The truth value of a proposition is FALSE, is denoted by 𝐹 Mayengo, M. M 5
  • 6. THE FOUNDATIONS: LOGIC AND PROOFS Definition 1 Let 𝑝 be a proposition. The 𝑛𝑒𝑔𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑝, denoted as ~𝑝, is the statement “it is not the case that 𝑝”. The proposition ~𝑝 is read “not 𝑝“ The truth value of the negation of 𝑝, ~𝑝, is the opposite of the truth value of 𝑝. Mayengo, M. M Example 3 Find the negation of the proposition “Michael’s PC runs LINUX” and express it in simple English 6
  • 7. THE FOUNDATIONS: LOGIC AND PROOFS …Example 3 “Michael’s PC runs LINUX” Solution 3 “It is not the case that Michael’s PC runs LINUX” and express it in simple English In simple English we say; “Michael’s PC does not runs LINUX” Mayengo, M. M 7
  • 8. THE FOUNDATIONS: LOGIC AND PROOFS Example 4 Find the negation of the proposition “John’s smartphone has at least 32GB of memory” and express it in simple English. Solution 4 “It is not the case that John’s smartphone has at least 32GB of memory” In simple English we say: “John’s smartphone does not have at least 32GB of memory” Or even more simply as: “John’s smartphone has less than 32GB of memory” Mayengo, M. M 8
  • 9. T HE F OUNDATIONS : L OGIC AND P ROOFS Table 1. The truth table for the negation of the propositi on Truth Table Mayengo, M. M 9
  • 10. THE FOUNDATIONS: LOGIC AND PROOFS Definition 2 Let 𝑝 and 𝑞 be a propositions. The conjunction 𝑜𝑓 𝑝, denoted as 𝑝⋀q, is the proposition “𝑝 𝑎𝑛𝑑 𝑞”. The conjunction 𝑝⋀q is TRUE when both 𝑝 and 𝑞 are TRUE and FALSE otherwise. Mayengo, M. M 10
  • 11. T HE F OUNDATIONS : L OGIC AND P ROOFS Table 2. The truth table for the conjuncti on of two propositi ons Truth Table Mayengo, M. M 11
  • 12. THE FOUNDATIONS: LOGIC AND PROOFS Definition 3 Let 𝑝 and 𝑞 be a propositions. The disjunction 𝑜𝑓 𝑝, denoted as 𝑝 ∨ q, is the proposition “𝑝 𝑜𝑟 𝑞”. The disjunction 𝑝 ∨ q is FALSE when both 𝑝 and 𝑞 are FALSE and TRUE otherwise. Mayengo, M. M 12
  • 13. T HE F OUNDATIONS : L OGIC AND P ROOFS Table 3. The truth table for the disjuncti on of two propositi ons Truth Table 13
  • 14. THE FOUNDATIONS: LOGIC AND PROOFS Facts:  The use of connective 𝑜𝑟 in a disjunction corresponds to one of the two ways the word 𝑜𝑟 is used in English, namely, as an inclusive or.  A disjunction is TRUE when at least one of the two propositions is TRUE Mayengo, M. M 14
  • 15. THE FOUNDATIONS: LOGIC AND PROOFS Example 5 Find the conjunction of the propositions 𝑝 and 𝑞 where 𝑝 is the proposition “Peter’s PC has more than 16GB free hard disc space” and 𝑞 is the proposition “The processor in Peter’s PC runs faster than 1GHz” Solution 5 The conjunction of these propositions, 𝑝 ∧ 𝑞, is the proposition “Peter’s PC has more than 16GB free hard disc space, and its processor runs faster than 1GHz” Hint: For this conjunction to be true, both conditions given must be true. It is false when one of these conditions are false. Mayengo, M. M 15
  • 16. THE FOUNDATIONS: LOGIC AND PROOFS Example 6 What is the disjunction of 𝑝 and 𝑞 where 𝑝 and 𝑞 are the same propositions as in Example 5 above? Solution 6 The disjunction of 𝑝 and 𝑞, 𝑝 ∨ 𝑞, is the propositions “Peter’s PC has at least 16GB free hard disc space, or the processor in Peter’s PC runs faster than 1GHz” Hint: This proposition is FALSE when both of these conditions are FALSE, otherwise it is TRUE. Mayengo, M. M 16
  • 17. THE FOUNDATIONS: LOGIC AND PROOFS Definition 4 Let 𝑝 and 𝑞 be a propositions. The exclusive or 𝑜𝑓 𝑝 𝑎𝑛𝑑 𝑞, denoted as 𝑝⨁q, is the proposition that is TRUE when exactly one of 𝑝 and q is TRUE and FALSE otherwise Mayengo, M. M 17
  • 18. T HE F OUNDATIONS : L OGIC AND P ROOFS Table 4. The truth table for the exclusive or of two propositio ns Truth Table Yes, this is how it should look like. You had a better try…! Mayengo, M. M 18
  • 19. THE FOUNDATIONS: LOGIC AND PROOFS Conditional statements Definition 5 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 premise) and q is called the conclusion. Mayengo, M. M 19
  • 20. THE FOUNDATIONS: LOGIC AND PROOFS Conditional statements  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.  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).  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 them if not all. Mayengo, M. M 20
  • 21. THE FOUNDATIONS: LOGIC AND PROOFS Mayengo, M. M  “if p, then q”  “p implies q”  “if p, q”  “p only if q”  “p is sufficient for q”  “a sufficient condition for q is p”  “q if p”  “q whenever p”  “q when p”  “q is necessary for p”  “a necessary condition for p is q”  “q follows from p”  “q unless ~p” Conditional statements You are likely to encounter most if not all of the following ways to express this conditional statement: 21
  • 22. THE FOUNDATIONS: LOGIC AND PROOFS Example 7 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. Solution 7 From the definition of conditional statements, we see that p → q represents the statement; “If Maria learns discrete mathematics, then she will find a good job.” Mayengo, M. M 22
  • 23. THE FOUNDATIONS: LOGIC AND PROOFS There are many other ways to express this conditional statement in English. Among the most natural of these are: 1. “Maria will find a good job when she learns discrete mathematics.” 2. “For Maria to get a good job, it is sufficient for her to learn discrete mathematics.” and 3. “Maria will find a good job unless she does not learn discrete mathematics.” Mayengo, M. M 23
  • 24. THE FOUNDATIONS: LOGIC AND PROOFS Converse, Contrapositive and Inverse  We can form 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. 1. The proposition q → p is called the converse of p → q. 2. The contrapositive of p → q is the proposition ~q →~p. 3. The proposition ~p →~q is called the inverse of p → q.  We will see that of these three conditional statements formed from p → q, only the contrapositive always has the same truth value as p → q. Mayengo, M. M 24
  • 25. THE FOUNDATIONS: LOGIC AND PROOFS Example 9 What are the contrapositive, the converse, and the inverse of the conditional statement “The home team wins whenever it is raining?” Solution 9 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. Mayengo, M. M 25
  • 26. THE FOUNDATIONS: LOGIC AND PROOFS Biconditionals  We now introduce another way to combine propositions that expresses that two propositions have the same truth value. Mayengo, M. M Definition 6 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. 26
  • 27. THE FOUNDATIONS: LOGIC AND PROOFS Biconditionals  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 ←. Mayengo, M. M 27
  • 28. THE FOUNDATIONS: LOGIC AND PROOFS Biconditionals  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). Mayengo, M. M 28
  • 29. THE FOUNDATIONS: LOGIC AND PROOFS Mayengo, M. M 29
  • 31. THE FOUNDATIONS: LOGIC AND PROOFS Mayengo, M. M Example 10 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.”  This statement is true if p and q are either both true or both false, that is, if you buy a ticket and can take the flight or if you do not buy a ticket and you cannot take the flight.  It is false when p and q have opposite truth values, that is, when you do not buy a ticket, but you can take the flight and when you buy a ticket but you cannot take the flight.  The truth table for biconditionals is left for your practice 31
  • 32. THE FOUNDATIONS: LOGIC AND PROOFS Implicit Use of Biconditionals  You should be aware that biconditionals are not always explicit in natural language. In particular, the “if and only if” construction used in biconditionals is rarely used in common language. Instead, biconditionals are often expressed using an “if, then” or an “only if” construction.  The other part of the “if and only if” is implicit. That is, the converse is implied, but not stated. For example, consider the statement in English “If you finish your meal, then you can have dessert.”  What is really meant is “You can have dessert if and only if you finish your meal.” This last statement is logically equivalent to the two statements “If you finish your meal, then you can have dessert” and “You can have dessert only if you finish your meal.” Mayengo, M. M 32
  • 33. THE FOUNDATIONS: LOGIC AND PROOFS Implicit Use of Biconditionals  Because of this imprecision in natural language, we need to make an assumption whether a conditional statement in natural language implicitly includes its converse.  Because precision is essential in mathematics and in logic, we will always distinguish between the conditional statement p → q and the biconditional statement p ↔ q. Mayengo, M. M 33
  • 34. THE FOUNDATIONS: LOGIC AND PROOFS Truth Tables of Compound Propositions  We have now introduced four important logical connectives— conjunctions, disjunctions, conditional statements, and biconditional statements—as well as negations.  We can use these connectives to build up complicated compound propositions involving any number of propositional variables.  We can use truth tables to determine the truth values of these compound propositions.  We use a separate column to find the truth value of each compound expression that occurs in the compound proposition as it is built up.  The truth values of the compound proposition for each combination of truth values of the propositional variables in it is found in the final column of the table. Mayengo, M. M 34
  • 35. THE FOUNDATIONS: LOGIC AND PROOFS Truth Tables of Compound Propositions Example 11. Construct the truth table of the compound proposition (𝑝 ∨ ~𝑞) → (𝑝 ∧ 𝑞). Solution 11:  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. Mayengo, M. M 35
  • 36. THE FOUNDATIONS: LOGIC AND PROOFS Truth Tables of Compound Propositions Example 11. Construct the truth table of the compound proposition (𝑝 ∨ ~𝑞) → (𝑝 ∧ 𝑞). Solution 11: Mayengo, M. M 36
  • 37. THE FOUNDATIONS: LOGIC AND PROOFS Precedence of Logical Operators  We can construct compound propositions using the negation operator and the logical operators defined so far.  We will generally use parentheses to specify the order in which logical operators in a compound proposition are to be applied. For instance, (p ∨ q) ∧ (~r) is the conjunction of p ∨ q and ~r.  However, to reduce the number of parentheses, we specify that the negation operator is applied before all other logical operators.  This means that ~p ∧ q is the conjunction of ~p and q, namely, (~p) ∧ q, not the negation of the conjunction of p and q, namely ~(p ∧ q).  Another general rule of precedence is that the conjunction operator takes precedence over the disjunction operator, so that p ∧ q ∨ r means (p ∧ q) ∨ r rather than p ∧ (q ∨ r).  Because this rule may be difficult to remember, we will continue to use parentheses so that the order of the disjunction and conjunction operators is clear. Mayengo, M. M 37
  • 38. THE FOUNDATIONS: LOGIC AND PROOFS Precedence of Logical Operators  Finally, it is an accepted rule that the conditional and biconditional operators → and ↔ have lower precedence than the conjunction and disjunction operators, ∧ and ∨.  Consequently, p ∨ q → r is the same as (p ∨ q) → r.  We will use parentheses when the order of the conditional operator and biconditional operator is at issue, although the conditional operator has precedence over the biconditional operator. Mayengo, M. M 38
  • 39. THE FOUNDATIONS: LOGIC AND PROOFS Logic and Bit Operations  Computers represent information using bits.  A bit is a symbol with two possible values, namely, 0 (zero) and 1 (one).  This meaning of the word bit comes from binary digit, because zeros and ones are the digits used in binary representations of numbers.  The well-known statistician John Tukey introduced this terminology in 1946.  A bit can be used to represent a truth value, because there are two truth values, namely, true and false. As is customarily done, we will use a 1 bit to represent true and a 0 bit to represent false. That is, 1 represents T (true), 0 represents F (false).  A variable is called a Boolean variable if its value is either true or false. Consequently, a Boolean variable can be represented using a bit. Mayengo, M. M 39
  • 40. THE FOUNDATIONS: LOGIC AND PROOFS Logic and Bit Operations  Computer bit operations correspond to the logical connectives by replacing true by a one and false by a zero in the truth tables for the operators ∧, ∨, and ⊕.  We will also use the notation OR, AND, and XOR for the operators ∨,∧, and ⊕, as is done in various programming languages. Mayengo, M. M 40