Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

CSC 203 Discrete Structure Lesson Note

The document provides an overview of propositional logic, defining propositions, logical connectives, and their truth values. It explains various logical operations such as negation, conjunction, disjunction, implication, biconditional, and exclusive-or, along with examples and truth tables. Additionally, it discusses concepts like tautology, contradiction, satisfiability, and logical equivalence, along with laws such as DeMorgan's Law and the associative and distributive laws.

Uploaded by

tfalebita
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

CSC 203 Discrete Structure Lesson Note

The document provides an overview of propositional logic, defining propositions, logical connectives, and their truth values. It explains various logical operations such as negation, conjunction, disjunction, implication, biconditional, and exclusive-or, along with examples and truth tables. Additionally, it discusses concepts like tautology, contradiction, satisfiability, and logical equivalence, along with laws such as DeMorgan's Law and the associative and distributive laws.

Uploaded by

tfalebita
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

CSC 203

DISCRETE STRUCTURE
Department of Computer
Science
Kwara State University,
Malete.
LOGIC
What is propositional logic?
This is a branch of logic that deals with propositions
and their relationships through logical connectives.

What is a proposition?
A proposition is a declarative statement that is either
True (1) or False (0) but cannot be both. T is used to
denote TRUE and F to denote FALSE.
PROPOSITIONAL LOGIC
Examples of propositions:
 Milk is white
 Abuja is the capital of Nigeria
 Humans are just fish with legs
 2+3=5

Examples of non-propositions:
 Sit down
 What time is it?
 x+1=2
 2+x>8
Logical Connectives
1. NOT (¬) or NEGATION: This flips the value of the proposition.
This corresponds to the English “It is not the case”. (e.g. if P denotes
“the earth is round”, then ¬P denotes “The earth is not round”).
2. AND (∧) or CONJUNCTION: This is true if and only if both
propositions are true. This corresponds to the English “and”,
“although”, “but”, “however”.(e.g. if P denotes “I am at home” and
Q denotes “It is raining” then P ∧ Q denotes “I am at home and it is
raining”).
3. OR (∨) or DISJUNCTION: This is true if either proposition or both
are true. This corresponds to the English “or” and “unless”.(e.g. if P
denotes “I am at home” and Q denotes “It is raining” then P ∨ Q
denotes “I am at home or it is raining).
4. CONDITIONAL (→) or IMPLICATION: This is false when the
antecedent(P) is true and the consequent(Q) is false. True in all other
courses. This corresponds to English “if-then”. (e.g. if P denotes “I am
at home” and Q denotes “It is raining” then P → Q denotes “if i am
at home then it is raining”).

From P → Q, we can form new conditional statements and they are:


 ¬P → ¬Q is the inverse of P → Q
Q→P is the converse of P → Q
 ¬ Q → ¬ P is the contrapositive of P → Q
Example: Find the inverse, converse, and contrapositive of “If
you study hard, you will pass the exam”
Solution
Inverse: If you do not study hard, you will not pass the exam
Converse: If you pass the exam, you studied hard
Contrapositive: If you do not pass the exam, you did not study
hard

5. IF AND ONLY IF (↔) or BICONDITIONAL: This is true when


both well formed formulas have the same truth value. This
corresponds to the English iff (if and only if). (e.g. if P denotes “I
am at home” and Q denotes “It is raining” then P ↔ Q denotes
“I am at home if and only if it is raining”).
6. EXCLUSIVE-OR ꚛ: This is true if and only if one of the
proposition is true. If both propositions are true or false, the
output is false. (e.g. if P denotes “It is hot in this room” and Q
denotes “it is cold in this room” then P ꚛ Q denotes “It is either
hot or cold in this room”)
Example 1
Translate the following into an English statement:
P= I cheat R= I write an exam
Q= I will get caught S= I will fail
(R Ʌ P) → (Q Ʌ S)

Ans:If I write an exam and I cheat then I will get caught and I will fail
Example 2
Translate the following into propositional logic:
If James does not die then Mary will not get any money and
James family will be happy.
Solution
P= James dies
Q=Mary will get money
R=James family will be happy

(¬P)→(¬Q Ʌ R)
Example 3
Translate the following into propositional logic:
A student gets A in CSC 201 if and only if his weighted total is ≥ 95%

Solution
P= A student gets A in CSC 201
Q= His weighted total is ≥ 95%

P↔Q
Interpreting propositional logic syntax
Each well formed formula can be drawn syntactically showing all connectives
and which wffs they attach to.
Truth Table
We can calculate complex well formed formulas (wff) using truth tables.
Truth table list all the possibilities of truth for each set of simple
propositions.
P P Q P Q R
1 1 1 1 1 1
1 1 0
0 1 0 1 0 1
0 1 1 0 0
0 0 0 1 1
0 1 0
0 0 1
0 0 0
Truth Conditions
1. Negation (¬)
P ¬P

1 0

0 1

Mathematically,
Val (¬P)= 1- Val(P)
2. Conjunction (Ʌ):
P Q PɅQ
1 1 1
1 0 0
0 1 0
0 0 0

Mathematically,
Min(Val(P), Val(Q))
3. Disjunction (v)
P Q PvQ
1 1 1
1 0 1
0 1 1
0 0 0

Mathematically,
Max(Val(P),Val(Q))
4. Conditional/Implication (→)
P Q P→Q
1 1 1
1 0 0
0 1 1
0 0 1

Mathematically,
=1 iff Val(P) ≤ Val(Q)
5. Biconditional (↔)
P Q P↔Q
1 1 1
1 0 0
0 1 0
0 0 1
6. Exclusive Orꚛ
P Q PꚛQ
T T F
T F T
F T T
F F F
Example 1
Analyze the statement below using the truth table:
If you get more doubles than any other player you will lose, or that if you lose
you must have bought the most properties.

Solution:
P= You get more doubles than any other player
Q= You will lose
R= You must have bought the most properties

Using logical connectives:


(P →Q) v (Q → R)
Using truth table:
Example 2
Analyze the statement below using the truth table.
It is either too hot or too cold in this room.
Solution
P= It is too hot in this room P Q PꚛQ
Q= It is too cold in this room T T F
T F T
Using logical connectives:
F T T
P ꚛQ F F F
Example 3
Analyze the statement below using the truth table:
The bus will arrive on time if and only if there is no traffic congestion.
Solution
P= The bus will arrive on time P Q ¬Q P↔ ¬Q
Q= There is traffic congestion
T T F F
Using logical connectives: T F T T
P↔ ¬Q F
F
T
F
F
T
T
F
Example 4
Analyze the statement below using the truth table:
If I write an exam and I cheat, then I will get caught and I will fail.
Solution
P= I write an exam R=I will get caught
Q= I cheat S= I will fail

(P Ʌ Q) → (R Ʌ S)
Using the truth table:
TAUTOLOGY, CONTRADICTION, AND CONTINGENCY
• A tautology is a compound proposition which is always true for all
possible truth values of the propositions that occur in it.
Example 1: P v ¬P
Example 2: (((P→Q) Ʌ (Q→R)) → (P → R))
• A contradiction is a compound proposition which is always false for all
possible truth value of the propositions that occur in it.
Example 1: P Ʌ ¬P

• Example 2: ¬(((P v Q) Ʌ ¬P) → Q)


• A Contingency is a compound proposition which is sometimes true and
sometimes false for all possible truth values of the propositions that occur in it.
Example 1: P Ʌ Q

Example 2: (Q Ʌ P) V (Q Ʌ ¬P)
SATISFIABILITY VS UNSATISFIABILITY
• Satisfiability: A compound proposition is satisfiable if there is at least one true result
in its truth table.
• Unsatisfiability: A compound proposition is unsatisfiable if it does not have a single
true result in its truth table.

VALID VS INVALID PROPOSITION


• Valid proposition: A compound proposition is valid when it is a tautology.
• Invalid proposition: A compound proposition is invalid when it is either a
contradiction or contingency.
LOGICAL EQUIVALENCE
Logical equivalence is a concept in logic that describes the relationship between two or
more statements that have the same truth value in all possible situations. It is often denoted
by ↔ or ≡.
Example
Using the truth table, determine if the following compound propositions are logically
equivalent: P→Q and Q v ¬P

The last column of the two truth tables are identical. Therefore, (P→Q) and (Q v ¬P) are
logically equivalent.
DeMorgan’s Law
This law is used to simplify or transform expressions that explicitly
involve negation (¬). It addresses how negation interacts with logical
conjunctions (∧) and disjunctions (∨).e.g
Negation of a conjunction: ¬(P ∧ Q) ≡ (¬P V ¬Q)

Negation of a disjunction: ¬(P V Q) = (¬P ∧ ¬Q)


Using De Morgan’s law, determine the equivalence of the following
logical statement:
1. ¬((P Ʌ Q) V (R))
2. ¬((P V Q) → (Q Ʌ P))
Solution
3. ¬((P Ʌ Q) V (R)) ≡ ((¬P V ¬Q ) Ʌ (¬R))
2. ¬((P V Q) → (Q Ʌ P)) ≡ ¬(¬(P V Q) V (Q Ʌ P))
¬((¬P Ʌ ¬Q) V (Q Ʌ P))
((P V Q) Ʌ (¬Q V ¬P))
Associative Law
The associative law refers to the property of logical connectives where
the grouping of propositions does not affect the truth value of the
compound statement. e.g
(P V Q) V R ≡ P V (Q V R)
P Q R (P V Q) (P V Q) V R P Q R (Q V R) P V (Q V R)
T T T T T
T T F T T T T T T T
T F T T T T T F T T
T F F T T T F T T T
F T T T T T F F F T
F T F T T F T T T T
F F T F T F T F T T
F F F F F F F T T T
F F F F F
Distributive Law
The distributive law in logic describes how conjunction (denoted by ∧)
and disjunction (denoted by ∨) interact with each other in
propositional logic. E.g
(P ∧ (Q V R)) ≡ (P ∧ Q) V (P ∧ R)
P Q R (Q V R) P ∧ (Q V P Q R (P ∧ Q) (P ∧ R) (P ∧ Q) V (P ∧
R) R)
T T T T T T T T T T T
T T F T T T T F T F T
T F T T T T F T F T T
T F F F F T F F F F F
F T T T F F T T F F F
F T F T F F T F F F F
F F T T F F F T F F F
F F F F F F F F F F F
Double Negation Law
The Double Negation Law in logic states that a proposition is
equivalent to the negation of its negation. e.g
¬(¬P) ≡ P
P ¬P ¬(¬P)
T F T
F T F

You might also like