ตรรกะและการพิสูจน์
แนะนำใหม่
5:38
Discrete Mathematics
Discrete mathematics is the mathematics of objects you can list: statements, sets, graphs and arrangements. The first three units build the proof engine…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| proposition/ˌprɒpəˈzɪʃn/ | บทสรุป |
| truth table/truːθ ˈteɪbl/ | ตารางความจริง |
| contrapositive/ˌkɒntrəˈpɒzɪtɪv/ | บทสรุปย้อนกลับ |
| converse/ˈkɒnvɜːs/ | บทสรุปถอยหลัง |
| De Morgan's laws/də ˈmɔːɡənz lɔːz/ | กฎเด摩根 |
| predicate logic/ˈpredɪkeɪt ˈlɒdʒɪk/ | ตรรกศาสตร์เชิงประพจน์ |
| quantifier/ˈkwɒntɪfaɪə/ | ตัวบอกปริมาณ |
| direct proof/daɪˈrekt pruːf/ | การพิสูจน์โดยตรง |
| contraposition/ˌkɒntrəpəˈzɪʃn/ | การพิสูจน์โดยวิธีตรงข้าม |
| proof by contradiction/pruːf baɪ ˌkɒntrəˈdɪkʃn/ | การพิสูจน์โดยวิธีแย้ง |
Did the tester break the claim?
- A spec says: "If the list is sorted, the search returns the right index." A tester feeds in an unsorted list, gets a wrong index and files a bug: "the claim is false."
- This test does not show the claim is false. The claim only promises something about sorted lists. This lesson makes that kind of reading exact, then turns it into proofs.
Propositions and the truth table
- A proposition 命题 is a statement that is true or false. Join them with ¬ (not), ∧ (and), ∨ (or), → (if…then) and ↔ (if and only if).
- A truth table 真值表 lists every combination of T and F for the variables, so it settles any formula. With $n$ variables there are $2^n$ rows.
| $p$ | $q$ | ${p{\land}q}$ | ${p{\lor}q}$ | ${p{\to}q}$ | ${p{\leftrightarrow}q}$ |
|---|---|---|---|---|---|
| T | T | T | T | T | T |
| T | F | F | T | F | F |
| F | T | F | T | T | F |
| F | F | F | F | T | T |
- $p \to q$ is false in one row only: $p$ true and $q$ false. When $p$ is false, the implication is true whatever $q$ is.
สูตรใช้ตัวแปร p, q, r และ s ตารางความจริงจะมีจำนวนแถวเท่าใด?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
ตัวแปรแต่ละตัวเป็น T หรือ F ดังนั้นจึงมี $2^4 = 16$ รูปแบบ
Reading "if p then q"
- $p \to q$ is false in one row only: $p$ true and $q$ false. When $p$ is false the claim makes no promise, so it counts as true. That is why the unsorted list broke nothing.
- $p \to q \equiv \neg p \lor q$. The contrapositive 逆否命题 $\neg q \to \neg p$ has the same truth table; the converse 逆命题 $q \to p$ does not.

ข้ออ้างว่า "หากเรียงลำดับแล้ว การค้นหาจะคืนค่าดัชนีที่ถูกต้อง" ถูกพิสูจน์ว่าเป็นเท็จโดยรายการที่ไม่เรียงลำดับซึ่งให้ดัชนีผิด
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
เมื่อ p เป็นเท็จ แล้ว p → q จะเป็นจริงไม่ว่าเกิดอะไรขึ้น การเรียงลำดับที่ถูกต้องแต่ได้ดัชนีผิดจะเป็นกรณีเดียวที่จะทำให้อ้างการนี้ล้มเหลว
จับคู่รูปแบบแต่ละแบบกับข้อความที่อธิบายสำหรับข้ออ้าง p → q
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
ตรงข้ามและ ¬p ∨ q มีตารางความจริงเหมือนกับ p → q ส่วนกลับด้านไม่มี; p ∧ ¬q คือการปฏิเสธของ p → q
Negation flips everything it passes
- De Morgan's laws 德摩根律: $\neg(p \land q) \equiv \neg p \lor \neg q$ and $\neg(p \lor q) \equiv \neg p \land \neg q$. The negation goes inside and the connective flips.
- Predicate logic 谓词逻辑 adds the quantifiers 量词 $\forall$ (for all) and $\exists$ (there exists). Negation swaps them and negates the predicate: $\neg\forall x\,P(x) \equiv \exists x\,\neg P(x)$.
Claim: "every email has exactly one address." Its negation: "some email has no address, or some email has two or more addresses." One email that breaks the rule is enough.
Push the negation inside
Set a and b and compare ¬(a ∧ b) with ¬a ∨ ¬b, then the OR form. The two sides agree on every row, and the naive rewrite without flipping the connective fails on a counterexample.
การปฏิเสธของ ∀x P(x) คือ —
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
ตัวอย่างเพียงหนึ่งก็เพียงพอ: การปฏิเสธจะสลับตัวชี้วัดและปฏิเสธคำบอกเล่า
สูตรใดสมมูลกับ ¬(p ∧ q)? เลือกทุกข้อที่ใช้ได้
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
De Morgan ให้ ¬p ∨ ¬q การเขียน p → ¬q ใหม่ในรูป ¬p ∨ ¬q ได้ผลเหมือนกัน และ q → ¬p ก็เช่นกัน ส่วน ¬p ∧ ¬q ลืมเปลี่ยนตัวเชื่อม
Three proof shapes
- Direct proof 直接证明: assume $p$ and derive $q$. Contraposition 逆否证明: prove $\neg q \to \neg p$ instead, which helps when the negatives are easier to work with.
- Proof by contradiction 反证法: assume $p \land \neg q$ and derive something impossible. Choosing the shape decides which assumptions you get to compute with.
การสมมติ p ∧ ¬q และดึงข้อสรุปที่เป็นไปไม่ได้คือ —
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
การพิสูจน์โดยความขัดแย้งสมมติว่าข้ออ้างล้มเหลว ความไม่เป็นไปได้แสดงว่าไม่สามารถล้มเหลวได้
Name the shape, then prove
Claim: if $n^2$ is even, then $n$ is even. "$n^2$ even" is hard to use, so prove the contrapositive.
Suppose $n$ is odd: $n = 2k + 1$. Then $n^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1$, which is odd. So "$n$ odd" gives "$n^2$ odd", and the claim follows.
- State the strategy in the first line ("by contraposition"), so the reader knows what you are assuming.
เรียงลำดับการพิสูจน์แบบตรงข้ามของ "ถ้า n² เป็นจำนวนคู่ แล้ว n เป็นจำนวนคู่"
ความยาก 3/5 · 200 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
ตั้งชื่อรูปทรงก่อน จากนั้นพิจารณาจากสมมติฐาน ¬q ไปยังบทสรุป ¬p
Marks that slip away
- Proving the converse. Showing $q \to p$ when $p \to q$ was asked proves the wrong thing.
- Negating without flipping. $\neg(p \land q)$ is $\neg p \lor \neg q$, not $\neg p \land \neg q$.
- Examples as proof. Ten examples do not prove a "for all" claim. One counterexample does disprove it.
You've got it
- $p \to q$ is false only when $p$ is true and $q$ is false; $p \to q \equiv \neg p \lor q \equiv \neg q \to \neg p$.
- Negation flips ∧/∨ (De Morgan) and swaps $\forall$/$\exists$.
- Translate the claim, choose a shape (direct, contraposition, contradiction), name it, then write justified steps.
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้