101_Lecture 7 CS 1813 – Discrete Mathematics

12 113 0
101_Lecture 7 CS 1813 – Discrete Mathematics

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Lecture CS 1813 Discrete Mathematics Equational Reasoning Back to the Future: High-School Algebra CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Some Laws of Algebra  a+0=a {+ identity}  (-a) + a = {+ complement}  a× 1=a {× identity}  a× 0=0 {× null}  a+b=b+a {+ commutative}  a + (b+c) = (a+b) + c {+ associative}  a× (b+c) = a× b + a× c {distributive law} Equations go both ways CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Theorem (-1) × (-1) = (-1) × (-1) = ((-1) × (-1)) + {+ id} = ((-1) × (-1)) + ((-1) + 1) {+ comp} = (((-1)× (-1)) + (-1)) + {+ assoc} = (((-1)× (-1)) + (-1)× 1) + {× id} = ((-1)× ((-1) + 1)) + {dist law} = ((-1)× 0) + {+ comp} = + {× null} = + {+ comm} = {+ id} QED proof by equational reasoning CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Laws of Boolean Algebra From Fig 2.1, Hall & O’Donnell, Discrete Math with a Computer, Springer, 2000 page CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Laws of Boolean Algebra From Fig 2.1, Hall & O’Donnell, Discrete Math with a Computer, Springer, 2000 page CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Theorem (a ∧ False) ∨ (b ∧ True) = b equations {rule} substitution [formula in eqn / variable in rule] (p ∧ False) ∨ (q ∧ True) names changed to clarify substitutions = = = = False ∨ (q ∧ True) (q ∧ True) ∨ False q ∧ True q {∧ null} [p /a] {∨ comm} [False /a] [q∧True /b] {∨ id} [q ∧ True /a] {∧ id} [q /a] CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page QED Using ng i t r o p m I ls o o t Equational Proof Checker import Stdm th7 = (P `And` FALSE) `Or` ( Q `And` TRUE) `thmEq` Q pr7 = startProof ((P `And` FALSE) `Or` (Q `And` TRUE)) (FALSE `Or` (Q `And` TRUE), andNull) ((Q `And` TRUE) `Or` FALSE, orComm) (Q `And` TRUE, orID) (Q, andID) Notepad window Gr in d e e n fro ica m te s u Prelude> :cd DMf00se cmd r Prelude> :cd Lectures Prelude> :load lecture07.hs Reading file "lecture07.hs": Reading file "Stdm.lhs": Reading file "lecture07.hs": Hugs session for: C:\HUGS98\lib\Prelude.hs Stdm.lhs lecture07.hs Main> check_equation th7 pr7 The proof is correct Hugs Session CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Equations the Proof Checker Knows andNull orNull andID orID andIdempotent orIdempotent andComm orComm andAssoc orAssoc andDistOverOr orDistOverAnd deMorgansLawAnd deMorgansLawOr negTrue negFalse andCompl orCompl dblNeg currying implication contrapositive absurdity CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Theorem (a ∧ b) ∨ b = b ∨ absorption equations {rule} substitution [formula in eqn / variable in rule] (p ∧ q) ∨ q names changed to clarify substitutions = = = = = (p ∧ q) ∨ (q ∧ True) (q ∧ p) ∨ (q ∧ True) q ∧ (p ∨ True) q ∧ True q {∧ id} [q /a] {∧ comm} [p /a] [q /b] {∧ dist over ∨} [q /a] [True /b] [p /c] {∨ null} [p /a] {∧ id} [q/a] QED CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Theorem (a ∨ b) ∧ b = b ∧ absorption equations {rule} substitution [formula in eqn / variable in rule] (p ∨ q) ∧ q names changed to clarify substitutions … exercise … =q CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 10 Consistent, But Not Minimal redundancy among laws of Boolean algebra Deriving the contrapositive law Theorem (contrapositive): a → b = ¬b → ¬a A proof using laws other than the contrapositive law equations {rule} substitution [formula in eqn / variable in rule] p →q = (¬p) ∨ q {imp} [p /a] [q /b] = ¬(¬((¬p) ∨ q)) {dbl neg} [(¬p) ∨ q /a] = ¬((¬(¬p)) ∧ (¬q)) {DeMorgan ∨} [¬p /a] [q /b] = ¬(p ∧ (¬q)) {dbl neg} [p /a] = (¬p) ∨ (¬(¬q)) {DeMorgan ∧} [p /a] [¬q /b] = (¬(¬q)) ∨ (¬p) ! {∨ comm} [¬p /a] [¬(¬(q)) /b] y p op ut?{imp} [¬q /a] [¬p /b] l s = (¬q) → (¬p) f is hortc o o pr the s QED s i Th re’s CS 1813 Discrete Mathematics, Univ e h W Oklahoma Copyright © 2000 by Rex Page 11 End of Lecture CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 12 ... hortc o o pr the s QED s i Th re’s CS 1813 Discrete Mathematics, Univ e h W Oklahoma Copyright © 2000 by Rex Page 11 End of Lecture CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000... reasoning CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Laws of Boolean Algebra From Fig 2.1, Hall & O’Donnell, Discrete Math with a Computer, Springer, 2000 page CS 1813 Discrete. .. Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page Laws of Boolean Algebra From Fig 2.1, Hall & O’Donnell, Discrete Math with a Computer, Springer, 2000 page CS 1813 Discrete Mathematics,

Ngày đăng: 17/08/2017, 21:10

Từ khóa liên quan

Mục lục

  • Lecture 7 CS 1813 – Discrete Mathematics

  • Some Laws of Algebra

  • Theorem (-1)  (-1) = 1

  • Laws of Boolean Algebra page 1

  • Laws of Boolean Algebra page 2

  • Theorem (a  False)  (b  True) = b

  • Using Equational Proof Checker

  • Equations the Proof Checker Knows

  • Theorem (a  b)  b = b  absorption

  • Theorem (a  b)  b = b  absorption

  • Consistent, But Not Minimal redundancy among laws of Boolean algebra

  • End of Lecture 7

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan