1 / 45

ساختمان های گسسته فصل اول: پایه های منطق و اثبات بخش 5 . 1: قواعد استنتاج ( Rules of Inference )

ساختمان های گسسته فصل اول: پایه های منطق و اثبات بخش 5 . 1: قواعد استنتاج ( Rules of Inference ). آرگومان معتبر ( Valid Arguments ). فرض کنید شما دو جمله زیر را در اختیار دارید: شما به طور منظم در کلاس شرکت می کنید ( P ) اگر شما به طور منظم در کلاس شرکت کنید درس را می گذرانید ( p  q )

Download Presentation

ساختمان های گسسته فصل اول: پایه های منطق و اثبات بخش 5 . 1: قواعد استنتاج ( Rules of Inference )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ساختمان های گسستهفصل اول: پایه های منطق و اثباتبخش 5.1: قواعد استنتاج (Rules of Inference)

  2. آرگومان معتبر (Valid Arguments) فرض کنید شما دو جمله زیر را در اختیار دارید: شما به طور منظم در کلاس شرکت می کنید (P) اگر شما به طور منظم در کلاس شرکت کنید درس را می گذرانید (p  q) بنابراین می توان نتیجه گرفت که شما درس را می گذرانید p  q p  q

  3. تعاریف یک آرگومان (Argument) در منطق گزاره ای یک رشته از گزاره ها می باشد. همه گزاره ها بجز گزاره آخر را مقدمات (premises) می گویند. (p1, p2, … , pn) گزاره آخر را نتیجه (conclusion) می نامند. (q) یک آرگومان معتبر (valid) است در صورتی که: اگر همه مقدمات درست باشند لزوما نتیجه نیز درست باشد. (p1 p2 …  pn)  q باید راستگو ( tautology) باشد

  4. روش تصدیق (Modus Ponens)، قیاس استثنایی یا قائده وضع مقدم (p  (p→q)) → q p p  q  q

  5. مثال روش تصدیق (Modus Ponens) دو جمله زیر را در نظر بگیرید: هوا بارانی است اگر هوا بارانی باشد زمین خیس می شود p = ” هوا بارانی است“ q = ” زمین خیس است“ بر اساس این قانون الان زمین باید خیس باشد

  6. قانون نقیض انتزاع (Modus Tollens) ¬q and p → q p → q ¬q →¬p ¬q and ¬q →¬p ¬p  q p  q  p

  7. مثال قانون نقیض انتزاع (Modus Tollens) دو جمله زیر را در نظر بگیرید: زمین خیس نیست اگر هوا بارانی باشد زمین خیس می شود p = ” هوا بارانی است“ q = ” زمین خیس است“ بر اساس این قانون الان هوا بارانی نیست

  8. خلاصه قواعد استنتاج (Rules of Inference)

  9. مثال اثبات (Proof) فرضیات (hypotheses) زیر را داریم: امروز بعد از ظهر آفتابی نیست و از دیروز سردتر است اگر ما برای شنا به دریا برویم آنگاه هوا آفتابی است اگر برای شنا نرویم به قایق سواری خواهیم رفت اگر به قایق سواری برویم غروب در خانه خواهیم بود آیا بر اساس این فرضیات می توان نتیجه گرفت که ما عصر خانه هستیم؟ (( p  q)  (r  p)  ( r  s)  (s  t))  t ? p = امروز بعد از ظهر آفتابی است q = از دیروز سردتر است r = ما برای شنا به دریا می رویم s = به قایق سواری خواهیم رفت t = غروب در خانه خواهیم بود

  10. مثال اثبات (Proof) ¬p  q 1st hypothesis (فرضیه اول) ¬p Simplification (ساده سازی عطفی) using step 1 r → p 2nd hypothesis (فرضیه دوم) ¬r Modus tollens (نقیض انتزاع) using steps 2&3 ¬r → s 3rd hypothesis (فرضیه سوم) s Modus ponens (روش تصدیق) using steps 4&5 s → t 4th hypothesis (فرضیه سوم) t Modus ponens (روش تصدیق) using steps 6&7

  11. مثال اثبات اگر باران نبارد یا هوا مه آلود نباشد، آنگاه مسابقه قایق سواری و آموزش غریق نجات برگزار می گردد. ( r  f)  (s  d) اگر مسابقه قایق سواری برگزار شود آنگاه مراسم اهدای مدال نیز برگزار می گردد. s  t مراسم اهدای مدال نیز برگزار نگردید  t می توان نتیجه گرفت که ”باران باریده“ است؟

  12. مثال اثبات ¬t فرضیه 3 s → t فرضیه 2 ¬s با قانون نقیض انتزاع و مرحله 1و2 (¬r¬f)→(sl) فرضیه 1 ¬(sl)→¬(¬r¬f) وارون مرحله 4 (¬s¬l)→(rf) قانون دمورگان و نقیض مضاعف ¬s¬l تفصیل فصلی و مرحله 3 rf روش تصدیق و مرحله 6و7 r ساده سازی عطفی مرحله 8

  13. قواعد استنتاج برای سور عمومی فرض می کنیم که x P(x) راست است: می توانیم استنباط نماییم که به ازای هر عدد ثابت c0مقدارP(c0) راست است به این نوع استدلال نمونه سازی عمومی (universal instantiation) می گویند. فرض می کنیم که به ازای هر (همه) عدد ثابت c0مقدارP(c0) راست است: می توانیم استنباط نماییم که x P(x) راست است به این نوع استدلال تعمیم عمومی (universal generalization) می گویند.

  14. قواعد استنتاج برای سور وجودی فرض می کنیم که x P(x) راست است: می توانیم استنباط نماییم که به ازای برخی از اعداد ثابت cمقدارP(c) راست است به این نوع استدلال نمونه سازی وجودی (existential instantiation) می گویند. فرض می کنیم که به ازای برخی از اعداد ثابت cمقدارP(c) راست است: می توانیم استنباط نماییم که x P(x) راست است به این نوع استدلال تعمیم وجودی (existential generalization) می گویند.

  15. مثال اثبات فرضیات: علی دانشجوی این کلاس است و گواهی نامه رانندگی دارد همه آنها که گواهی نامه رانندگی دارند می توانند رانندگی کنند آیا می توان نتیجه گرفت: ”یک نفر در این کلاس وجود دارد که می تواند رانندگی کند“؟ C(Ali) R(Ali) x (R(x)→T(x)) x (C(x)T(x))

  16. مثال اثبات x (R(x)→T(x)) 3rd hypothesis R(Ali) → T(Ali) Universal instantiation using step 1 R(Ali) 2nd hypothesis T(Ali) Modes ponens using steps 2 & 3 C(Ali) 1st hypothesis C(Ali)  T(Ali) Conjunction using steps 4 & 5 x (C(x)T(x)) Existential generalization using step 6 پس می توان نتیجه گرفت: ”یک نفر در این کلاس وجود دارد که می تواند رانندگی کند“؟

  17. بخش 6.1: مقدمه ای بر اثبات ها (Introduction to Proofs)بخش 7.1: استراتژی و روش های اثبات (Proof Methods and Strategy)

  18. واژگان فنی قضیه (Theorem): یک جمله که می توان نشان داد که راست است. برخی مواقع به آن حقیقت (fact) می گویند قضیه های کم اهمیت را گزاره (Proposition) نیز می نامند اثبات (Proof): برهان آوردن (Demonstration) برای اینکه یک قضیه درست است اصل بدیهی (Axiom): جمله ای که فرض می شود که درست است لم (Lemma): یک قضیه کم اهمیت که برای اثبات یک قضیه استفاده می شود نتیجه یا فرع (Corollary): یک قضیه که می تواند به طور مستقیم از یک قضیه ثابت شده، ثابت شود. حدس (Conjecture): یک جمله که به عنوان یک جمله راست پیشنهاد می شود. حدس Goldbach: هر عدد طبیعی زوج بزرگتر از 2 مجموع دو عدد اول است

  19. روش های اثبات (Proof methods) ما در مورد 10 روش اثبات بحث خواهیم نمود: اثبات مستقیم (Direct proofs) اثبات غیر مستقیم (Indirect proofs) Vacuous proofs Trivial proofs Proof by contradiction Proof by cases Proofs of equivalence Existence proofs Uniqueness proofs Counterexamples

  20. اثبات مستقیم (Direct proofs) عبارت p→q را در نظر می گیریم: اگر p دروغ (False) باشد این استلزام همیشه درست است. بنابراین کافی است نشان دهیم اگر p راست باشد آنگاه q نیز باید راست باشد. برای اثبات مستقیم فرض می کنیم p درست است و نشان می دهیم که q باید درست باشد. قضیه: توان دو هر عدد زوج، زوج است. شکل دیگر: (n2 زوج است) → (n زوج است) (اثبات) فرض می کنیم n زوج است: n = 2k n2 = (2k)2 = 4k2 = 2(2k2)

  21. اثبات غیر مستقیم (Indirect proofs) عبارت p→q را در نظر می گیریم آنگاه ¬q→¬p را وارون (contrapositive) می نامند اگر (¬q) دروغ باشد (q راست باشد) این استلزام همیشه درست است. بنابراین کافی است نشان دهیم اگر (¬q) راست باشد (q دروغ باشد) آنگاه (¬p) نیز باید راست (p دروغ باشد) باشد. در واقع اثبات غیر مستقیم، یک اثبات مستقیم در شرایط وارون آن شرط است

  22. مثال اثبات غیر مستقیم قضیه: اگر n2 فرد باشد آنگاه n نیز فرد است شکل دیگر: (n فرد است) → (n2 فرد است): شکل وارون: شکل دیگر: (n2 زوج است) → (n زوج است) (اثبات) فرض می کنیم n زوج است: n = 2k n2 = (2k)2 = 4k2 = 2(2k2) در چه شرایطی به جای اثبات مستقیم از اثبات غیر مستقیم استفاده می کنیم؟

  23. مثال انتخاب بین اثبات مستقیم و غیر مستقیم ثابت کنید اگر n3+5 فرد باشد آنگاه n زوج است به کمک اثبات مستقیم: n3+5 = 2k+1 در نتیجه n3 = 2k-4 به نتیجه درخور توجه ای نمی رسیم از اثبات غیر مستقیم کمک می گیریم: وارون: اگر n فرد باشد آنگاه n3+5 زوج است (اثبات) فرض می کنیم n فرد است: n=2k+1 n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 = 2(4k3+6k2+3k+3) n3+5 = 2 k’ (زوج است)

  24. برهان خلف (Proof by contradiction) برای اثبات جمله p فرض می کنیم که p دروغ است فرض می کنیم ¬p درست است ثابت می کنیم که ¬p نمی تواند اتفاق بیافتد پس تضاد (خلاف) وجود دارد برای اثبات p→q به کمک برهان خلف کافی: برای نادرست شدن p→q : باید p درست و q نادرست باشد. نشان می دهیم که در این حالت به تضاد می رسیم در نتیجه p→q درست است

  25. Proof by contradiction example 1 Theorem (by Euclid): There are infinitely many prime numbers. Proof. Assume there are a finite number of primes List them as follows: p1, p2 …, pn. Consider the number q = p1p2 … pn + 1 This number is not divisible by any of the listed primes If we divided pi into q, there would result a remainder of 1 We must conclude that q is a prime number, not among the primes listed above This contradicts our assumption that all primes are in the list p1, p2 …, pn.

  26. Proof by contradiction example 2 Prove that if n is an integer and n3+5 is odd, then n is even Rephrased: If n3+5 is odd, then n is even Assume p is true and q is false Assume that n3+5 is odd, and n is odd n=2k+1 for some integer k (definition of odd numbers) n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 = 2(4k3+6k2+3k+3) As 2(4k3+6k2+3k+3) is 2 times an integer, it must be even Contradiction!

  27. Vacuous and Trivial proofs Vacuous proof Consider an implication: p→q If it can be shown that p is false, then the implication is always true By definition of an implication Trivial Proof Consider an implication: p→q If it can be shown that q is true, then the implication is always true By definition of an implication

  28. Proof by cases Show a statement is true by showing all possible cases are true Thus, you are showing a statement of the form: (p1 p2 …  pn)  q is true by showing that: [(p1p2…pn)q]  [(p1q)(p2q)…(pnq)] Make sure you get ALL the cases The biggest mistake is to leave out some of the cases

  29. Proof by cases example Prove that Note that b ≠ 0 Cases: Case 1: a ≥ 0 and b > 0 Then |a| = a, |b| = b, and Case 2: a ≥ 0 and b < 0 Then |a| = a, |b| = -b, and Case 3: a < 0 and b > 0 Then |a| = -a, |b| = b, and Case 4: a < 0 and b < 0 Then |a| = -a, |b| = -b, and

  30. Proofs of equivalences This is showing the definition of a bi-conditional Given a statement of the form “p if and only if q” Show it is true by showing (p→q)(q→p) is true

  31. Proofs of equivalence example Show that m2=n2 if and only if m=n or m=-n Rephrased: (m2=n2) ↔ [(m=n)(m=-n)] [(m=n)(m=-n)] → (m2=n2) Proof by cases! Case 1: (m=n)→ (m2=n2) (m)2 = m2, and (n)2 = n2, so this case is proven Case 2: (m=-n) → (m2=n2) (m)2 = m2, and (-n)2 = n2, so this case is proven (m2=n2) → [(m=n)(m=-n)] Subtract n2 from both sides to get m2-n2=0 Factor to get (m+n)(m-n) = 0 Since that equals zero, one of the factors must be zero Thus, either m+n=0 (which means m=-n) Or m-n=0 (which means m=n)

  32. Existence proofs Given a statement: x P(x) We only have to show that a P(c) exists for some value of c Two types: Constructive: Find a specific value of c for which P(c) is true. Nonconstructive: Show that such a c exists, but don’t actually find it Assume it does not exist, and show a contradiction

  33. Constructive existence proof example Show that a square exists that is the sum of two other squares Proof: 32 + 42 = 52 Show that a cube exists that is the sum of three other cubes Proof: 33 + 43 + 53 = 63

  34. Non-constructive existence proof example Prove that either 2*10500+15 or 2*10500+16 is not a perfect square A perfect square is a square of an integer Rephrased: Show that a non-perfect square exists in the set {2*10500+15, 2*10500+16} Proof: The only two perfect squares that differ by 1 are 0 and 1 Thus, any other numbers that differ by 1 cannot both be perfect squares Thus, a non-perfect square must exist in any set that contains two numbers that differ by 1 Note that we didn’t specify which one it was!

  35. Uniqueness proofs A theorem may state that only one such value exists To prove this, you need to show: Existence: that such a value does indeed exist Either via a constructive or non-constructive existence proof Uniqueness: that there is only one such value

  36. Uniqueness proof example If the real number equation 5x+3=a has a solution then it is unique Existence We can manipulate 5x+3=a to yield x=(a-3)/5 Is this constructive or non-constructive? Uniqueness If there are two such numbers, then they would fulfill the following: a = 5x+3 = 5y+3 We can manipulate this to yield that x = y Thus, the one solution is unique!

  37. مثال نقض (Counterexamples) Given a universally quantified statement, find a single example which it is not true Note that this is DISPROVING a UNIVERSAL statement by a counterexample x ¬R(x), where R(x) means “x has red hair” Find one person (in the domain) who has red hair Every positive integer is the square of another integer The square root of 5 is 2.236, which is not an integer

  38. What’s wrong with this proof? If n2 is an even integer, then n is an even integer. Proof) Suppose n2 is even. Then n2 = 2 k for some integer k. Let n = 2 l for some integer l. Then n is an even integer.

  39. Proof by cases Show a statement is true by showing all possible cases are true (n+1)2 ≥ 3n for all positive integer n. For all integer n, n2 ≥ n.

  40. Forward and Backward Reasoning (x+y) / 2 > √xy for all positive real number x and y.

  41. Counterexamples Given a universally quantified statement, find a single example which it is not true Note that this is DISPROVING a UNIVERSAL statement by a counterexample x ¬R(x), where R(x) means “x has red hair” Find one person (in the domain) who has red hair Every positive integer is the square of another integer The square root of 5 is 2.236, which is not an integer

  42. Counterexample Prove or disprove: Every positive integer is the sum of two squares of integers.

  43. What’s wrong with this proof? If n2 is an even integer, then n is an even integer. Proof) Suppose n2 is even. Then n2 = 2 k for some integer k. Let n = 2 l for some integer l. Then n is an even integer.

  44. Examples Prove that there are 100 positive integers that are not perfect squares. Show that if a, b are odd integers and a≠b, then there is a unique integer c such that |a-c| = |b-c|.

  45. Proof methods We will discuss ten proof methods: Direct proofs Indirect proofs Vacuous proofs Trivial proofs Proof by contradiction Proof by cases Proofs of equivalence Existence proofs Uniqueness proofs Counterexamples

More Related