01 Logic
- Logic is ”the study of reasoning”
Propositions
- A proposition (ประพจน์) is a declarative sentence that is either TRUE or FALSE, but no both.
- ประโยคบอกเล่าหรือประโยคปฏิเสธที่ เป็นจริงหรือเป็นเท็จอย่างใดอย่างหนึ่ง เท่านั้น!!
Compound Propositions
- We can build composite propositions from simpler propositions by using 5 connectives:
- and (), or (), not (), implies (), if and only if ()
Truth Tables
Related
- The truth values of compound propositions can be described by truth tables
Conditional Proposition
- เป็น Condition part, hypothesis, antecedent, premise
- เป็น Conclusion, consequence
- can also be read as:
- “If , then ”
- “ when ”
- “A sufficient condition for is ”
- “A necessary condition for is ”
Biconditional Proposition
- Input เหมือนกันเป็น TRUE ต่างกันเป็น FALSE ตรงข้ามกับ XOR Gate นะ!!! ระวังจำสับสน
- The exclusive or (XOR) is also equivalent to the negation of a logical biconditional
- can also be read as:
- “ is a necessary and sufficient condition for ”
- and sometimes written as “ iff ”
Logical Equivalence
- ประพจน์ สมมูลกับ เมื่อ และ มีค่าความจริงเหมือนกันทุกกรณี (ดูใน Truth Table) เขียนแทนด้วย “p q”
- Logically equivalent = Same in every possible combination
- ปัญหาอยู่ตรงที่ว่า จะรู้ว่า Logcally equivalent กันเนี่ย ถ้ามีทั้งหมด 10 symbols ไม่ต้องเขียน Truth Table แถวเลยหรอ?!!!
- เพราะว่า The size of the truth table grows “exponentially” as the number of symbols increases.
Basic Logical Equivalences (สมมูลที่สำคัญ ๆ)
Biconditional Law
Implication Law
Contrapositive Law
De Morgan’s Law
Associative Laws (The Grouping is Not Important)
- เครื่องหมาย ใน เหมือนกับ นอก!
Distributive Law
- Check Link อีกทีว่าถูกต้องมั้ย
- เครื่องหมาย ใน ต่างกับ นอก!
Quantifications (ตัวบ่งปริมาณ)
Universal Quantification ()
- , is true, if is true for every in → to show, examine all objects
- , is false, if is false for at least one in → to show, give one counterexample
Existential Quantification ()
- , is true, if is true for at least one in → to show, give one example
- , is false, if is false for every in → to show, examine all objects
Generalized De Morgan’s Law
and have the same truth values.
and have the same truth values.
- ง่าย ๆ ก็คือกระจาย เข้าไปใน quantified statement นั่นเอง
Nested Quantifiers
- ง่าย ๆ ก็คือการมีประพจน์ มากกว่า 1 ตัว = 2 ตัว นั่นแหละ
| TRUE เมื่อมี (x, y) อย่างน้อยหนึ่งคู่ที่ทำให้เงื่อนไขเป็นจริง | ||
|---|---|---|
| TRUE เมื่อ x หนึ่งตัวที่เมื่อนำไปจับคู่กับ y ทุกตัวแล้วเป็นจริง | False → Diffcult ให้ใช้ De Morgan’s Law | |
| TRUE เมื่อนำ x ทุกตัวไปจับคู่กับ y บางตัวแล้วเป็นจริง | ||
| FALSE ทันทีเมื่อพบข้อแย้งอย่างน้อยหนึ่งคู่ที่แทนแล้วไม่จริง |
Linked from
- 02 Method of Proofs
- 03 Sets, Relations, and Functions
- 08 Finite-State Automata and Turing Machines
- Nested Quantifier
- 03 Logic Gates and Boolean Algebra
- Chapter 1 - Sets, Relations and Languages
- Chapter 7 - First-Order Logic
- Lesson 09 - Causal Reasoning
- Lesson 10 - Propositions
- Lecture 2 - Quantum Logic Gates