0% found this document useful (0 votes)
17 views28 pages

BIT1105 2 Math Logic

Mathematics research

Uploaded by

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

BIT1105 2 Math Logic

Mathematics research

Uploaded by

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

BIT1105 –Mathematics and

Statistical Foundation for IT

Chapter 2: Math Logic

Philemon Bariyo
Copyright 2023 ©, ISBAT University, All rights reserved.
Math Logic
2

Topics
 Propositional Logic
 Basic logical connectives
 Truth Tables
 Logical equivalences

© ISBAT UNIVERSITY – 2023 5/6/2023


Learning Objectives
3

 To improve the understanding of fundamental math concepts and

gain programming skills needed in different fields of study

 To develop critical thinking skills through rigorous and logical

reasoning, analytical thinking and problem-solving.

 To improve the ability to communicate ideas clearly and concisely.

© ISBAT UNIVERSITY – 2023 5/6/2023


Propositional Logic
4

Definition: A proposition is a statement that is by


itself either true or false.
Examples of propositions are;
Puppies are cuter than kittens
A mango is a fruit
Joy is a boy
Usain Bolt can outrun everyone in this room

Examples of statements statements that are not propositions;


What time is it ?
Read carefully.
Where do you stay?
How old are you ?
© ISBAT UNIVERSITY – 2023 5/6/2023
Variables and connectives
5

Every statement in propositional logical consists of


variables combined via logical connectives using a
syntax which is rigidly specified.
A variable is a symbol that represents a proposition.
Variables are typically represented by letters, such as
p, q or r.
A connective is a logical operator that connects two or
more propositions to form a new proposition.

© ISBAT UNIVERSITY – 2023 5/6/2023


Variables and connectives
6

Examples of Variables:
p: "The sky is blue."
q: "it is hot outside"
Examples of Connectives:
NOT: "It is not the case that the sky is blue."
AND: "The sky is blue AND it is hot outside."
OR: "Either the sky is blue OR it is hot outside (or
both)."
IF-THEN: "If the sky is blue, then it is hot outside."
IF AND ONLY IF: "The sky is blue if and only if it is
hot outside."
© ISBAT UNIVERSITY – 2023 5/6/2023
Logical connectives
7

Connective NOT (¬)


This is an operator that negates a proposition. It takes a single
proposition as its input and outputs the opposite truth value of that
proposition. If the input proposition is true, the output of NOT is false,
and if the input proposition is false, the output of NOT is true.

Examples

1) p: "The cat is black."


¬p: "The cat is not black. "
The proposition ¬p is read as " not p"

2) q: "2 + 2 = 5."
¬q: "2 + 2 ≠ 5."

3) r: "Today is Friday."
¬r: "Today is not Friday."
© ISBAT UNIVERSITY – 2023 5/6/2023
Truth table for Connective NOT (¬p)
8

Let p represent a proposition that can be either true (T) or false (F). The
¬p column shows the output of applying the NOT connective to the
proposition p.

p ¬p
T F
F T
NOT connective works by negating the truth value of a proposition. It shows
that if p is true, then ¬p is false, and if p is false, then ¬p is true. This is the
basic principle of the NOT connective, and it is a fundamental concept in
propositional logic.

© ISBAT UNIVERSITY – 2023 5/6/2023


Connective AND (p∧q)
9

Let p and q be propositions. The conjunction of the two


propositions p and q is denoted by p ∧ q.
p ∧ q is true only when both p and q are true and is false
otherwise.
Example: Find the conjunction of the proposition p and q where;
p is the proposition: "It is Friday"
q is the proposition: "It is raining“
Solution:
The conjunction p ∧ q is the proposition "It is Friday and it is raining "
Note that this conjunction is true only on rainy Fridays and false
on any other day that is not a Friday and on Fridays when it does
not rain.
© ISBAT UNIVERSITY – 2023 5/6/2023
Truth table for Connective AND (p∧q)
10

© ISBAT UNIVERSITY – 2023 5/6/2023


Connective OR (p∨q)
11

Let p and q be propositions. The disjunction of the two


propositions p and q is denoted by p ∨ q.
p ∨ q is false only when both p and q are false and is true
otherwise.
Example: Find the disjunction of the proposition p and q where;
p is the proposition: "It is Friday"
q is the proposition: "It is raining“
Solution:
The disjunction p ∨ q is the proposition "It is Friday or it is raining "
Note: This disjunction is true on any day that is either a Friday or any
other rainy day that is not a Friday and on Fridays when it rains.

© ISBAT UNIVERSITY – 2023 5/6/2023


Truth table for Connective OR (p∨q)
12

Note: One criticism of the truth table for Connective OR is that it is sometimes
insufficient to represent the nuances of natural language. In some cases, the word
"or" in natural language can indicate an exclusive disjunction.
In an exclusive disjunction only one of the two options can be true.
For example, "You can have either a salad or a sandwich for lunch, but not both."
The exclusive or (xor) of two propositions, p and q, is a logical connective that is
true only when exactly one of the two propositions is true, and false otherwise. The
exclusive or is often symbolized as ⊕. p q p⊕q
F F T
Truth Table
F T T
T F T
T T F
© ISBAT UNIVERSITY – 2023 5/6/2023
Conditional connective (→)
13

The conditional connective is denoted by the symbol →,


and is also known as the implication (if---then---)
connective.
Examples
If you get 100% in the final, then you will get an A.
If you learn discrete maths, then you will find a job.
Let p and q be propositions. The conditional
statement p → q is the proposition "if p then q."
Note: In p → q, p is called the hypothesis (or
premise) and q is called the conclusion (or
consequence).
© ISBAT UNIVERSITY – 2023 5/6/2023
Conditional connective, Example
14

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”
1. If the politician is elected, voters will expect this
politician to lower taxes.
2. But if the politician is not elected, voters will not have
any expectation that this person will lower taxes, although
the politician may sufficient influence to cause those in
power to lower taxes.
3) It is only when the politician is elected but does not lower
taxes that voters can say the campaign pledge has been
broken.
© ISBAT UNIVERSITY – 2023 5/6/2023
Truth table for conditional Connective (p → q)
15

The conditional statement is only false when


the hypothesis (p) is true and the consequence
(q) is false; otherwise it is true.

© ISBAT UNIVERSITY – 2023 5/6/2023


The bi-conditional connective (p ↔ q)
16
The conditional statement of two propositions p and q is
denoted by p ↔ q.
p ↔ q is true only when both p and q have the same truth
values (either both are true or both are false) and is false
otherwise. This means p is necessary and sufficient for q.
Examples;
1."I will go to the party if and only if (iff) John is also going
to the party“
2. "An integer is even if and only if (iff) it is divisible by 2“
3. "A figure is a square if and only if (iff) it has four equal
sides and four right angles"
© ISBAT UNIVERSITY – 2023 5/6/2023
Truth table for bi-conditional Connective (p ↔ q)
17

p q p↔q
T T T
T F F
F T F
F F T
The statement "p if and only if q" means that p is true if and only if q is true,
which can be broken down into two separate implications: if p is true, then q
must also be true, and if q is true, then p must also be true. Hence;

© ISBAT UNIVERSITY – 2023 5/6/2023


Converse, contrapositive and Inverse
18

© ISBAT UNIVERSITY – 2023 5/6/2023


Converse, contrapositive and Inverse
19

Example: Consider the statement;


“ The home team wins whenever it is raining” which is
also written as “if it is raining, the home team
wins”
 The contrapositive 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.


© ISBAT UNIVERSITY – 2023 5/6/2023
Converse, contrapositive and Inverse
20

© ISBAT UNIVERSITY – 2023 5/6/2023


Logical Equivalences
21

 When two compound propositions p and q always


have the same truth value, we say the statements
are logically equivalent. This is written as (P ≡ q)
 Therefore the conditional statement p → q and its
contrapositive ¬q→ ¬p are logically equivalent.

© ISBAT UNIVERSITY – 2023 5/6/2023


Logical Equivalences – De Morgan’s Laws
22

Example:
Given that p → q is logically equivalent to ¬p ∨ q, show
that ¬(p → q )is logically equivalent to p ∧ ¬ q

© ISBAT UNIVERSITY – 2023 5/6/2023


A Tautology and a Contradiction
23

(p ∨ ¬p) is a tautology. It is always true, regardless of whether p is true


or false.
(p ∧ ¬p) is a contradiction. It is always false, regardless of whether p is
true or false.

© ISBAT UNIVERSITY – 2023 5/6/2023


Practice Questions
24

© ISBAT UNIVERSITY – 2023 5/6/2023


Practice Questions
25

© ISBAT UNIVERSITY – 2023 5/6/2023


Practice Questions
26

© ISBAT UNIVERSITY – 2023 5/6/2023


Practice Questions
27

© ISBAT UNIVERSITY – 2023 5/6/2023


28

Thank you

© ISBAT UNIVERSITY – 2023 5/6/2023

You might also like