vault backup: 2025-02-06 13:22:51
This commit is contained in:
38
.obsidian/workspace.json
vendored
38
.obsidian/workspace.json
vendored
@@ -27,12 +27,12 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Penetration Testing/Exploitation Assignment/Discovery.md",
|
||||
"file": "AI & Data Mining/Week 21/Week 21 - Transformational Proofs in Propositional Logic.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "Discovery"
|
||||
"title": "Week 21 - Transformational Proofs in Propositional Logic"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -216,23 +216,29 @@
|
||||
},
|
||||
"active": "ae922dd6b04c31a4",
|
||||
"lastOpenFiles": [
|
||||
"Penetration Testing/Exploitation Assignment/Discovery.md",
|
||||
"AI & Data Mining/Week 21/Week 21 - Transformational Proofs in Propositional Logic.md",
|
||||
"AI & Data Mining/Week 21",
|
||||
"Client Server Systems/PHPStorm Repo/students.sqlite",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/Views/index.phtml",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/index.php",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/Views/page1.phtml",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/Views/studentISv1.phtml",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/studentISv1.php",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/Models/StudentsDataSet.php",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/Models/studentISv1.php",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/Models/StudentData.php",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/images/new_uos_logo.jpg",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_2/fonts/glyphicons-halflings-regular.svg",
|
||||
"Client Server Systems/PHPStorm Repo/images/new_uos_logo.jpg",
|
||||
"Client Server Systems/PHPStorm Repo/fonts/glyphicons-halflings-regular.svg",
|
||||
"Client Server Systems/PHPStorm Repo/ajax_workshop_1/favicon.png",
|
||||
"images/Pasted image 20250131145917.png",
|
||||
"images/Pasted image 20250131144439.png",
|
||||
"images/Pasted image 20250131144425.png",
|
||||
"Penetration Testing/Exploitation Assignment/Discovery.md",
|
||||
"Penetration Testing/Exploitation Assignment",
|
||||
"AI & Data Mining/Week 20/Week 20 - Intro to Propositional Logic.md",
|
||||
"AI & Data Mining/Week 20/Chapter 20 Tutorial - Introduction to Propositional Logic.md",
|
||||
"AI & Data Mining/Week 20/Propositional Logic Examples.md",
|
||||
"Networking and Security/Week 20/hashcat-exercise/test-dict",
|
||||
"Networking and Security/Week 20/hashcat-exercise/view-sample-password.sh",
|
||||
"Networking and Security/Week 20/hashcat-exercise/crack-these-please-sha512",
|
||||
"Networking and Security/Week 20/hashcat-exercise/crack-these-please-sha256",
|
||||
"Networking and Security/Week 20/hashcat-exercise/crack-these-please-md5",
|
||||
"Networking and Security/Week 20/hashcat-exercise/500_passwords.txt",
|
||||
"Networking and Security/Week 20/hashcat-exercise/50-crack-these-please",
|
||||
"Networking and Security/Week 20/hashcat-exercise",
|
||||
"Networking and Security/Week 20/hashcat-exercise-files.zip",
|
||||
"AI & Data Mining/Week 19/Timeline of History.md",
|
||||
"Penetration Testing/Week 20/Week 20 - Web Attacks.md",
|
||||
"CWC 3 - Fit for Trade.md",
|
||||
@@ -247,12 +253,6 @@
|
||||
"Penetration Testing/Week 19/AI Summary.md",
|
||||
"Penetration Testing/Week 19/Week 19 - Buffer Overflow.md",
|
||||
"Client Server Systems/PHPStorm Repo/php-s1/MVCtemplate-23-24/images/new_uos_logo.jpg",
|
||||
"Client Server Systems/PHPStorm Repo/php-s1/MVCtemplate-23-24/fonts/glyphicons-halflings-regular.svg",
|
||||
"Client Server Systems/PHPStorm Repo/php-s1/workshop6/images/new_uos_logo.jpg",
|
||||
"Client Server Systems/PHPStorm Repo/php-s1/workshop6/fonts/glyphicons-halflings-regular.svg",
|
||||
"Client Server Systems/PHPStorm Repo/php-s1/workshop5/images/new_uos_logo.jpg",
|
||||
"Client Server Systems/PHPStorm Repo/php-s1/workshop5/fonts/glyphicons-halflings-regular.svg",
|
||||
"Client Server Systems/PHPStorm Repo/php-s1/workshop4/images/new_uos_logo.jpg",
|
||||
"AI & Data Mining/Week 18/Week 18 - What AI?????.md",
|
||||
"Networking and Security/Week 18/Workshop.md",
|
||||
"Data Structures/AI Notes/Stack.md",
|
||||
|
@@ -0,0 +1,154 @@
|
||||
**Notes on Slides and Exercises**
|
||||
|
||||
**Slide 0: Learning Objectives**
|
||||
- Prove equivalence of formulae using truth tables.
|
||||
- Remember and use laws of equivalence.
|
||||
- Carry out a transformational proof.
|
||||
|
||||
**Slide 1: Contents**
|
||||
- Why is propositional logic called Boolean logic/algebra?
|
||||
- Using truth tables to prove two formulae are identical in meaning.
|
||||
- A problem with truth tables.
|
||||
- Laws of logic.
|
||||
- Famous applications.
|
||||
- Summary, reading and references.
|
||||
|
||||
**Slide 2: George Boole (1815-1864)**
|
||||
- Son of a shoemaker, self-taught mathematician.
|
||||
- Professed mathematics at Queens College, Cork, Ireland.
|
||||
- Seminal work: attempted to apply algebraic and arithmetic principles to logic.
|
||||
|
||||
**Slide 3: Logical Equivalence (≡)**
|
||||
- Two formulae are equivalent if they have identical truth values under all possible assignments.
|
||||
- Example: p ≡ p ∨ p (Idempotence)
|
||||
|
||||
**Slide 4: Two Approaches to Logical Equivalence**
|
||||
1. Truth tables
|
||||
- Example: p ≡ ¬p (Negation)
|
||||
2. Transformational proofs
|
||||
- Uses laws of logic to prove equivalence.
|
||||
|
||||
**Slide 5: Logical Equivalence with One Variable**
|
||||
- Truth table for p ≡ p ∨ p (Idempotence)
|
||||
- T | T | T
|
||||
F | F | F
|
||||
|
||||
**Slide 6: Logical Equivalence with Two Variables**
|
||||
- Truth table for p ∨ q ≡ q ∨ p (Commutativity)
|
||||
- T | T | T | T
|
||||
F | T | T | T
|
||||
T | F | T | F
|
||||
F | F | F | F
|
||||
|
||||
**Slide 7: Exercise - De Morgan's First Law**
|
||||
- Prove ¬(p ∧ q) ≡ ¬p ∨ ¬q using a truth table.
|
||||
|
||||
**Slide 8: Solution to Exercise**
|
||||
- Truth table for ¬(p ∧ q) ≡ ¬p ∨ ¬q
|
||||
- T | F | F | T | F | F | T | F | F | F
|
||||
F | F | F | F | F | F | F | F | F | T
|
||||
|
||||
**Slide 9: Logical Equivalence with Three Variables**
|
||||
- Truth table for (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) (Associativity)
|
||||
- Example: (2 × 3) × 4 = 2 × (3 × 4)
|
||||
|
||||
**Slide 10: A Problem with Truth Tables**
|
||||
- Truth tables become increasingly tedious as the number of variables increases.
|
||||
- n | Number of rows in truth table (2^n)
|
||||
1 | 2
|
||||
2 | 4
|
||||
3 | 8
|
||||
|
||||
**Slide 11: Laws of Logic**
|
||||
- Idempotence: p ≡ p ∨ p, p ≡ p ∧ p
|
||||
- Commutativity: p ∨ q ≡ q ∨ p, p ∧ q ≡ q ∧ p
|
||||
- Associativity: (p ∨ q) ∨ r ≡ p ∨ (q ∨ r), etc.
|
||||
- Negation law: ¬¬p ≡ p
|
||||
- Law of equivalence: p ⇔ q ≡ (p ⇒ q) ∧ (q ⇒ p)
|
||||
- Law of implication: p ⇒ q ≡ ¬p ∨ q
|
||||
- Contraposition Law: p ⇒ q ≡ ¬q ⇒ ¬p
|
||||
- De Morgan's first law: ¬(p ∧ q) ≡ ¬p ∨ ¬q
|
||||
- De Morgan's second law: ¬(p ∨ q) ≡ ¬p ∧ ¬q
|
||||
|
||||
**Slide 12: Proof of De Morgan's Second Law**
|
||||
- Using laws of logic to prove ¬(p ∨ q) ≡ ¬p ∧ ¬q.
|
||||
|
||||
**Slide 13: Idempotence**
|
||||
- Proof of p ∧ p ≡ p using laws of logic.
|
||||
- p ∧ p ≡ ¬¬p ∧ ¬¬p (Negation law twice)
|
||||
- ≡ ¬(¬p ∨ ¬p) (De Morgan's second law)
|
||||
- ≡ ¬false (Law of contradiction)
|
||||
- ≡ p (Simplification)
|
||||
|
||||
**Slide 14: Commutative Laws of Logic**
|
||||
- Proof of p ∧ q ≡ q ∧ p using laws of logic.
|
||||
- p ∧ q ≡ ¬¬p ∧ ¬¬q (Negation law twice)
|
||||
- ≡ ¬(¬p ∨ ¬q) (De Morgan's second law)
|
||||
- ≡ ¬(¬q ∨ ¬p) (Commutativity of ∨)
|
||||
- ≡ q ∧ p (Negation law twice)
|
||||
|
||||
**Slide 15: Associative Laws of Logic**
|
||||
- Example: (a × b) × c ≡ a × (b × c)
|
||||
|
||||
**Slide 16: Distributive Laws of Logic**
|
||||
- Example: a × (b + c) ≡ (a × b) + (a × c)
|
||||
|
||||
**Slide 17: T versus true and F versus false**
|
||||
- T represents a formula is true, F represents it is false.
|
||||
- Example: p ∧ true ≡ p (Law of simplification)
|
||||
|
||||
**Slide 18: Laws involving true and false**
|
||||
- Law of excluded middle: p ∨ ¬p ≡ true
|
||||
- Law of contradiction: p ∧ ¬p ≡ false
|
||||
- Laws of simplification: p ∧ true ≡ p, p ∨ true ≡ true, p ∧ false ≡ false, p ∨ false ≡ p
|
||||
|
||||
**Slide 19: Two More Laws of Simplification**
|
||||
- Proofs for:
|
||||
- p ∨ (p ∧ q) ≡ p
|
||||
- p ∧ (p ∨ q) ≡ p
|
||||
|
||||
**Slide 20: Transformational Proofs**
|
||||
- Two implicit rules:
|
||||
- Substitution Rule: Replace a sub-formula with an equivalent one without changing the meaning.
|
||||
- Transitivity Rule: If p ≡ q and q ≡ r, then p ≡ r.
|
||||
- Example: Modus Tollens (¬q ∧ (p ⇒ q) ⇒ ¬p)
|
||||
- Proof using laws of logic.
|
||||
|
||||
**Slide 21: Exercise**
|
||||
- Fill in the missing steps to prove (p ∨ q) ∧ (¬p ∨ q) ≡ q using transformational proofs.
|
||||
- Solution:
|
||||
- (p ∨ q) ∧ (¬p ∨ q)
|
||||
- ≡ (q ∨ p) ∧ (¬p ∨ q) (Commutativity)
|
||||
- ≡ q ∨ (p ∧ ¬p) (Distributive law)
|
||||
- ≡ q ∨ false (Law of contradiction)
|
||||
- ≡ q (Simplification)
|
||||
|
||||
**Slide 22: Example - Accommodation**
|
||||
- Prove ¬p ⇒ (q ∨ r) ≡ (¬p ∧ ¬q) ⇒ r using transformational proofs.
|
||||
- Solution:
|
||||
- Proof using laws of logic.
|
||||
|
||||
**Slide 23: Famous Applications**
|
||||
- Analysis of complex conditional commands in programming.
|
||||
- Design of digital circuits.
|
||||
- Algebraic approach to formal specifications in software engineering.
|
||||
|
||||
**Slide 24: Summary**
|
||||
- Boole's system was the foundation for propositional logic.
|
||||
- Two approaches to establishing equivalence:
|
||||
- Truth tables (tedious with many variables)
|
||||
- Transformational proofs (uses laws of logic)
|
||||
- Summary slides on Boole's system, truth tables, and transformational proofs.
|
||||
|
||||
**Slide 25: Reading and References**
|
||||
- Recommended textbook: Russell, S., & Norvig, P. (2022). Artificial Intelligence: A Modern Approach (4th ed.). Pearson.
|
||||
- Additional references:
|
||||
- Nissanke, M. (1999). Introductory Logic and Sets for Computer Scientists. Addison-Wesley.
|
||||
- Gray, P. (1984). Logic, Algebra and Databases. John Wiley & Sons.
|
||||
|
||||
**Exercises:**
|
||||
1. Prove the laws of idempotence, commutative, associative, and distributive using truth tables.
|
||||
2. Prove De Morgan's laws using truth tables or transformational proofs.
|
||||
3. Prove the laws involving true and false using truth tables or transformational proofs.
|
||||
4. Prove the laws of simplification using truth tables or transformational proofs.
|
||||
5. Prove the equivalence of two given formulae using transformational proofs (as demonstrated in slides 21 and 22).
|
BIN
Client Server Systems/.DS_Store
vendored
BIN
Client Server Systems/.DS_Store
vendored
Binary file not shown.
Submodule Client Server Systems/PHPStorm Repo updated: 2238305d65...f64a9eadbe
Reference in New Issue
Block a user