









































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










































1 Propositional Logic
▶ Propositional Logic
▶ Predicate Logic and Sets
1 Propositional Logic
1 Propositional Logic
1 Propositional Logic
Let p : “PIN is correct,” q : “Balance is sufficient.”
1 Propositional Logic
p ¬ p q p → q T F T T T F F F F T T T F T F T Table 2: Truth table for NOT and IMPLIES
1 Propositional Logic
p q p ↔ q T T T T F F F T F F F T
Table 3: Truth table for BICONDITIONAL
1 Propositional Logic
In Ghana’s voting system: “Not (valid ID AND registered)” ≡ “Not valid ID OR not registered.”
1 Propositional Logic
Show ¬( p ∧ q ) ≡ ¬ p ∨ ¬ q using a truth table.
p q ¬( p ∧ q ) ¬ p ∨ ¬ q Equal? T T F F T T F T T T F T T T T F F T T T
1 Propositional Logic
Model: “If user is registered OR has guest access, allow entry.”
def allow_entry ( registered , guest_access ) : return registered or guest_access
1 Propositional Logic
Construct the truth table for ¬( p → q ).
1 Propositional Logic
Model: “If payment is made AND item is in stock, then order is processed” for a Jumia Ghana order. Write the logical expression and construct its truth table.
1 Propositional Logic
Write a Python function for: “Allow transaction if PIN is correct OR user is verified by SMS.”
2 Predicate Logic and Sets
A predicate P ( x ) is a statement about variable x , e.g., P ( x ): “ x is a KNUST student.”
2 Predicate Logic and Sets
Translate: “Some KNUST students use MTN Mobile Money.” Let P ( x ): “ x is a KNUST student,” Q ( x ): “ x uses MTN Mobile Money.” Answer: ∃ x ( P ( x ) ∧ Q ( x )).