Math 1 - CH 01 Logic and Proofs PDF
Document Details

Uploaded by IngenuousTigerSEye
Tags
Summary
This document provides notes and exercises on propositional logic, covering topics such as truth values, propositional equivalences, and logical operators. It includes examples and solutions to illustrative problems.
Full Transcript
Math 1 CH 01: Logic and Proofs Content The Foundations: Logic and Proofs Propositional Logic Applications of Propositional Logic Propositional Equivalences Predicates and Quantifiers Nested Quantifiers Rules of Inference Introduction to Proofs Proof Methods and Str...
Math 1 CH 01: Logic and Proofs Content The Foundations: Logic and Proofs Propositional Logic Applications of Propositional Logic Propositional Equivalences Predicates and Quantifiers Nested Quantifiers Rules of Inference Introduction to Proofs Proof Methods and Strategy Propositional Logic Logic rules are used to distinguish between valid and invalid mathematical arguments. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both. o Propositions are the basic building blocks of logic. Propositional Logic EXAMPLE 1: All the following declarative sentences are propositions. Proposition T/F Washington, D.C., is the capital of the United States of True America Qena is the capital of Canada False 1+1=2 True 2+2=3 False Propositional Logic EXAMPLE 2: Some sentences that are not propositions. Proposition What time is it? not declarative sentence Read this carefully. not declarative sentence x + 1 = 2. neither true nor false x + y = z. neither true nor false Propositional Logic Logical Operations Negation (Β¬π) Conjunction (π β§ π) Disjunction (π β¨ π) Exclusive (π β π) Conditional (π β π) p q πβ§π p q πβ¨π p q πβπ p q π βπ p Β¬π T T T T T T T T F T T T T F T F F T F T T F T T F F F T F T F F T T F T T F T T F F F F F F F F F F F T Propositional Logic EXAMPLE 7: Let π be the statement βMaria learns discrete mathematicsβ and π the statement βMaria will find a good job.β Express the statement π β π as a statement in English. Solution 7: βIf Maria learns discrete mathematics, then she will find a good job.β Propositional Logic EXAMPLE 8: What is the value of the variable π₯ after the statement ππ 2 + 2 = 4 π‘βππ π₯ βΆ= π₯ + 1 if π₯ = 0 before this statement is encountered? Solution 8: Because 2 + 2 = 4 is true, the assignment statement π₯ βΆ= π₯ + 1 is executed. Hence, π₯ has the value 0 + 1 = 1 after this statement is encountered. Propositional Logic Related conditional statements π β π CONVERSE CONTRAPOSITIVE INVERSE π β π Β¬π β Β¬π Β¬π β Β¬π Only the contrapositive always has the same truth value as π β π. Propositional Logic The biconditional statement π β π is the proposition βp if and only if q.β o The biconditional statement π β π is true when π and π have the same truth values and is false otherwise. Example 10: βYou can take the flight if and only if you buy a ticket.β Propositional Logic EXAMPLE 11: Construct the truth table of the compound proposition (π β¨ Β¬π) β (π β§ π). Propositional Logic Precedence of Logical Operators Exercises 1. Which of these sentences are propositions? What are the truth values of those that are propositions? Sentence 2+3=5 5 + 7 = 10 x + 2 = 11. Answer this question Exercises 1. Which of these sentences are propositions? What are the truth values of those that are propositions? Sentence Answer 2+3=5 true proposition 5 + 7 = 10 false proposition x + 2 = 11. not a proposition Answer this question not a proposition Exercises 8. Suppose that Smartphone A has 256MB RAM and 32GB ROM, and the resolution of its camera is 8 MP; Smartphone B has 288 MB RAM and 64 GB ROM, and the resolution of its camera is 4 MP; and Smartphone C has 128 MB RAM and 32 GB ROM, and the resolution of its camera is 5 MP. Determine the truth value of each of these propositions. Sentence Smartphone B has the most RAM of these three smartphones. Smartphone C has more ROM or a higher resolution camera than Smartphone B. Smartphone B has more RAM, more ROM, and a higher resolution camera than Smartphone A. If Smartphone B has more RAM and more ROM than Smartphone C, then it also has a higher resolution camera. Smartphone A has more RAM than Smartphone B if and only if Smartphone B has more RAM than Smartphone A. Exercises 8. Suppose that Smartphone A has 256MB RAM and 32GB ROM, and the resolution of its camera is 8 MP; Smartphone B has 288 MB RAM and 64 GB ROM, and the resolution of its camera is 4 MP; and Smartphone C has 128 MB RAM and 32 GB ROM, and the resolution of its camera is 5 MP. Determine the truth value of each of these propositions. Sentence Answer Smartphone B has the most RAM of these three smartphones. True Smartphone C has more ROM or a higher resolution camera than Smartphone B. True Smartphone B has more RAM, more ROM, and a higher resolution camera than False Smartphone A. If Smartphone B has more RAM and more ROM than Smartphone C, then it also has False a higher resolution camera. Smartphone A has more RAM than Smartphone B if and only if Smartphone B has False more RAM than Smartphone A. Exercises 14. Let π, π, and π be the propositions π :You have the flu; π :You miss the final examination; π :You pass the course. Express each of these propositions as an English sentence. Sentence π β π Β¬π β π π β Β¬π π β¨ π β¨ π (π β Β¬π) β¨ (π β Β¬π) (π β§ π) β¨ (Β¬π β§ π) Exercises 14. Let π, π, and π be the propositions π :You have the flu; π :You miss the final examination; π :You pass the course. Express each of these propositions as an English sentence. Sentence Answer π β π If you have the flu, then you miss the final exam. Β¬π β π You do not miss the final exam if and only if you pass the course. π β Β¬π If you miss the final exam, then you do not pass the course. π β¨ π β¨ π You have the flu, or miss the final exam, or pass the course. (π β Β¬π) β¨ (π β Β¬π) if you have the flu, then you do not pass the course or if you miss the final exam then you do not pass the course. (π β§ π) β¨ (Β¬π β§ π) You have the flu and miss the final exam, or you do not miss the final exam and do pass the course. Exercises 18. Determine whether these biconditionals are true or false. Sentence 1 + 1 = 3 if and only if monkeys can fly 0 > 1 if and only if 2 > 1. Exercises 18. Determine whether these biconditionals are true or false. Sentence Answer 1 + 1 = 3 if and only if monkeys can fly This is πΉ β πΉ, which is true. 0 > 1 if and only if 2 > 1. This is πΉ β π, which is false. Exercises 19. Determine whether each of these conditional statements is true or false. Sentence If 1 + 1 = 2, then 2 + 2 = 5. If 1 + 1 = 3, then 2 + 2 = 4. Exercises 19. Determine whether each of these conditional statements is true or false. Sentence Answer If 1 + 1 = 2, then 2 + 2 = 5. π β πΉ, False If 1 + 1 = 3, then 2 + 2 = 4. πΉ β π, True Exercises 30. State the converse, contrapositive, and inverse of each of these conditional statements. a) If it snows tonight, then I will stay at home. b) I go to the beach whenever it is a sunny summer day. c) When I stay up late, it is necessary that I sleep until noon. Exercises 30. State the converse, contrapositive, and inverse of each of these conditional statements. a) If it snows tonight, then I will stay at home. b) I go to the beach whenever it is a sunny summer day. c) When I stay up late, it is necessary that I sleep until noon. Converse Contrapositive Inverse If I stay home, then it will snow If I do not stay at home, then it If it does not snow tonight, then I tonight will not snow tonight. will not stay home. Whenever it is a sunny summer Whenever it is not a sunny I do not go to the beach. day, I go to the beach summer day, I do not go to the Whenever it is not a sunny day, beach. If I sleep until noon, then I stayed If I do not sleep until noon, then I If I donβt stay up late, then I donβt up late. do not stay up late. sleep until noon. Exercises 31. How many rows appear in a truth table for each of these compound propositions? proposition π β Β¬π (π β¨ Β¬π) β§ (π β¨ Β¬π ) π β¨ π β¨ Β¬π β¨ Β¬π β¨ Β¬π‘ β¨ π’ (π β§ π β§ π‘) β (π β§ π‘) Exercises 31. How many rows appear in a truth table for each of these compound propositions? proposition Answer π β Β¬π 2' = 2 (π β¨ Β¬π) β§ (π β¨ Β¬π ) 2( = 16 π β¨ π β¨ Β¬π β¨ Β¬π β¨ Β¬π‘ β¨ π’ 2) = 64 (π β§ π β§ π‘) β (π β§ π‘) 2( = 16 Exercises 33. Construct a truth table for each of these compound propositions. a) π β§ Β¬π b) π β¨ Β¬π c) π β¨ Β¬π β π d) (π β¨ π) β (π β§ π) e) (π β π) β (Β¬π β Β¬π) f) (π β π) β (π β π) Exercises 33. Construct a truth table for each of these compound propositions. a) π β§ Β¬π b) π β¨ Β¬π π Β¬π π β§ Β¬π π β¨ Β¬π T F F T F T F T Exercises 33. Construct a truth table for each of these compound propositions. a) π β¨ Β¬π β π π π Β¬π π β¨ Β¬π (π β¨ Β¬π) β π T T F T T T F T T F F T F F T F F T T F Exercises 33. Construct a truth table for each of these compound propositions. a) (π β¨ π) β (π β§ π) π π π β¨ π π β§ π (π β¨ π) β (π β§ π) T T T T T T F T F F F T T F F F F F F T Exercises 33. Construct a truth table for each of these compound propositions. a) (π β π) β (Β¬π β Β¬π) π π π β π Β¬π β Β¬π (π β π) β (Β¬π β Β¬π) T T T T T T F F F T F T T T T F F T T T Exercises 33. Construct a truth table for each of these compound propositions. a) (π β π) β (π β π) π π π β π π β π (π β π) β (π β π) T T T T T T F F T T F T T F F F F T T T Exercises 41. Construct a truth table for (π β π) β (π β π ). Exercises 41. Construct a truth table for (π β π) β (π β π ). Exercises 42. Explain, without using a truth table, why (π β¨ Β¬π) β§ (π β¨ Β¬π) β§ (π β¨ Β¬π) is true when π, π, and π have the same truth value and it is false otherwise. Exercises 42. Explain, without using a truth table, why (π β¨ Β¬π) β§ (π β¨ Β¬π) β§ (π β¨ Β¬π) is true when π, π, and π have the same truth value and it is false otherwise. This statement is true if and only if all three clauses, π β¨ Β¬π, π β¨ Β¬π, and π β¨ Β¬π are true. Suppose π, π , and π are all true. Because each clause has an unnegated variable, each clause is true. Similarly, if π, π , and π are all false, then because each clause has a negated variable, each clause is true. On the other hand, if one of the variables is true and the other two false, then the clause containing the negation of that variable will be false, making the entire conjunction false; and similarly, if one of the variables is false and the other two true, then the clause containing that variable unnegated will be false, again making the entire conjunction false. Exercises 46. What is the value of π₯ after each of these statements is encountered in a computer program, if π₯ = 1 before the statement is reached? if x + 2 = 3 then x := x + 1 if (x + 1 = 3) OR (2x + 2 = 3) then x := x + 1 Exercises 46. What is the value of π₯ after each of these statements is encountered in a computer program, if π₯ = 1 before the statement is reached? if x + 2 = 3 then x := x + 1 The condition is true, the statement is executed, so x is incremented and now has the value 2. if (x + 1 = 3) OR (2x + 2 = 3) then x := x + 1 The condition is false, the statement is not executed, so x is not incremented and now still has the value 1. Exercises In fuzzy logic, a proposition has a truth value that is a number between 0 and 1, inclusive. A proposition with a truth value of 0 is false and one with a truth value of 1 is true. Truth values that are between 0 and 1 indicate varying degrees of truth. o For instance, the truth value 0.8 can be assigned to the statement βFred is happy,β because Fred is happy most of the time. o The truth value 0.4 can be assigned to the statement βJohn is happy,β because John is happy slightly less than half the time. Exercises 49. The truth value of the negation of a proposition in fuzzy logic is 1 minus the truth value of the proposition. What are the truth values of the statements βFred is not happyβ and βJohn is not happy?β Exercises 49. The truth value of the negation of a proposition in fuzzy logic is 1 minus the truth value of the proposition. What are the truth values of the statements βFred is not happyβ and βJohn is not happy?β For "Fred is not happy," the truth value is 1 - 0.8 = 0.2. For "John is not happy,'' the truth value is 1- 0.4 = 0.6. Exercises 50. The truth value of the conjunction of two propositions in fuzzy logic is the minimum of the truth values of the two propositions. What are the truth values of the statements βFred and John are happyβ and βNeither Fred nor John is happyβ? Exercises 50. The truth value of the conjunction of two propositions in fuzzy logic is the minimum of the truth values of the two propositions. What are the truth values of the statements βFred and John are happyβ and βNeither Fred nor John is happyβ? For "Fred and John are happy," Γ min(0.8; 0.4) = 0.4 For "Neither Fred nor John is happy" Γ min(0.2; 0.6) = 0.2 Tasks Section 1 2 5 Section 1 9 46 (c, d, e) 13 47 18 (a, b) 51 fuzzy logic 19 (c, d) 29 32 34 40 43 Content The Foundations: Logic and Proofs Propositional Logic Applications of Propositional Logic Propositional Equivalences Predicates and Quantifiers Nested Quantifiers Rules of Inference Introduction to Proofs Proof Methods and Strategy Applications of Propositional Logic Translating English Sentences System Specifications Boolean Searches Logic Puzzles Logic Circuits Applications of Propositional Logic Translating EXAMPLE 1: English Sentences How can this English sentence be translated into a logical expression? System βYou can access the Internet from campus only if you are a computer Specifications science major or you are not a freshman.β Boolean Searches Solution: Logic π = βYou can access the Internet from campus,β Puzzles π = βπππ’ πππ π πππππ’π‘ππ π ππππππ πππππ, β π = βπππ’ πππ π ππππ βπππ, β Logic βππππ¦ ππβ ππ πππ π€ππ¦ π ππππππ‘πππππ π π‘ππ‘πππππ‘ Circuits π β (π β¨ Β¬π ). Applications of Propositional Logic Translating EXAMPLE 3: English Sentences Express the specification using logical connectives. System βThe automated reply cannot be sent when the file system is fullβ Specifications Boolean Solution: Searches π = βThe automated reply can be sentβ Logic π = βπβπ ππππ π π¦π π‘ππ ππ ππ’ππ. β Puzzles π β Β¬π. Logic Circuits Applications of Propositional Logic Translating Check the consistency of the system specification (no conflictions). English Sentences We have to prove that all the specifications be true. System Specifications Boolean Searches Logic Puzzles Logic Circuits Applications of Propositional Logic Example 4: Determine if these system specifications are consistent: oβThe diagnostic message is stored in the buffer or it is retransmitted.β oβThe diagnostic message is not stored in the buffer.β oβIf the diagnostic message is stored in the buffer, then it is retransmitted.β Solution: let op = βThe diagnostic message is stored in the bufferβ oq = βThe diagnostic message is retransmitted.β Applications of Propositional Logic The specification can be written as: o π β π = βThe diagnostic message is stored in the buffer or it is retransmitted.β o Β¬π = βThe diagnostic message is not stored in the buffer.β o π β π = βIf the diagnostic message is stored in the buffer, then it is retransmitted.β 1. To make Β¬π true, π must be false. 2. To make π β π true, we have π is false, then we set π to be true. 3. To make π β π true, we have π is false and π is true. So, false β true = true. From 1, 2, and 3, we conclude that the specification is consistent. Applications of Propositional Logic Translating EXAMPLE 6: Web Page Searching, Information retrieval and Databases English Sentences Using Boolean searching to find Web pages about universities in New System Mexico, we can look for pages matching Specifications ππΈπ π΄ππ· ππΈππΌπΆπ π΄ππ· πππΌππΈπ ππΌππΌπΈπ. Boolean Searches To find pages that deal with universities in New Mexico or Arizona, we Logic can search for pages matching Puzzles (ππΈπ π΄ππ· ππΈππΌπΆπ ππ π΄π πΌππππ΄) π΄ππ· πππΌππΈπ ππΌππΌπΈπ. Logic What are Google Search Operators? Circuits Applications of Propositional Logic Translating EXAMPLE 7: English Sentences An island that has two kinds of inhabitants, knights, who always tell System the truth, and their opposites, knaves, who always lie. You encounter Specifications two people A and B. What are A and B if A says βB is a knightβ and B says βThe two of us are opposite types?β Boolean Searches Logic Solution: β¦TASK Puzzles Logic Example 8: TASK β¦ read and comprehend Circuits Applications of Propositional Logic Translating EXAMPLE 9: English Sentences Determine the output for the combinatorial circuit in Figure 2. System Specifications Boolean Searches Logic Puzzles Logic Circuits Exercises Translate the given statement into propositional logic using the propositions provided. 1. You cannot edit a protected Wikipedia entry unless you are an administrator. Express your answer in terms of π: βπππ’ πππ ππππ‘ π ππππ‘πππ‘ππ πππππππππ πππ‘ππ¦β and π: βπππ’ πππ ππ πππππππ π‘πππ‘ππ. β Exercises 1. You cannot edit a protected Wikipedia entry unless you are an administrator. Express your answer in terms of π: βπππ’ πππ ππππ‘ π ππππ‘πππ‘ππ πππππππππ πππ‘ππ¦β and π: βπππ’ πππ ππ πππππππ π‘πππ‘ππ. β e β π (You can edit a protected Wikipedia entry, then you are an admin) or Β¬π β Β¬π (if you are not an admin, you cannot edit a Wikipedia entry) Exercises 3. You can graduate only if you have completed the requirements of your major and you do not owe money to the university and you do not have an overdue library book. Express your answer in terms of π: βπππ’ πππ πππππ’ππ‘π, β π: βπππ’ ππ€π πππππ¦ π‘π π‘βπ π’πππ£πππ ππ‘π¦, β π: βπππ’ βππ£π πππππππ‘ππ π‘βπ ππππ’πππππππ‘π ππ π¦ππ’π πππππ, β and π: βπππ’ βππ£π ππ ππ£ππππ’π πππππππ¦ ππππ. β Exercises 3. You can graduate only if you have completed the requirements of your major and you do not owe money to the university and you do not have an overdue library book. Express your answer in terms of π: βπππ’ πππ πππππ’ππ‘π, β π: βπππ’ ππ€π πππππ¦ π‘π π‘βπ π’πππ£πππ ππ‘π¦, β π: βπππ’ βππ£π πππππππ‘ππ π‘βπ ππππ’πππππππ‘π ππ π¦ππ’π πππππ, β and π: βπππ’ βππ£π ππ ππ£ππππ’π πππππππ¦ ππππ. β π β (π β§ (Β¬π) β§ (Β¬π)). Exercises 8. Express these system specifications using the propositions π βπβπ π’π ππ πππ‘πππ π π£ππππ πππ π π€πππ, β π βπ΄ππππ π ππ πππππ‘ππ, β and π βπβπ π’π ππ βππ ππππ π‘βπ π π’ππ πππππ‘πππ πππβ and logical connectives (including negations). Sentence Proposition βThe user has paid the subscription fee, but does not enter a valid password.β βAccess is granted whenever the user has paid the subscription fee and enters a valid password.β βAccess is denied if the user has not paid the subscription fee.β βIf the user has not entered a valid password but has paid the subscription fee, then access is granted.β Exercises 8. Express these system specifications using the propositions π βπβπ π’π ππ πππ‘πππ π π£ππππ πππ π π€πππ, β π βπ΄ππππ π ππ πππππ‘ππ, β and π βπβπ π’π ππ βππ ππππ π‘βπ π π’ππ πππππ‘πππ πππβ and logical connectives (including negations). Sentence Proposition βThe user has paid the subscription fee, but does not enter βπutβ means βandβ: r β§ Β¬p. a valid password.β βAccess is granted whenever the user has paid the βπ€βππππ£ππβ πππππ βππβ: π β§ p βq. subscription fee and enters a valid password.β βAccess is denied if the user has not paid the subscription π‘βπ πππππ‘πππ ππ π , π π π€π βππ£π βΆ Β¬π β Β¬π. fee.β βIf the user has not entered a valid password but has paid Β¬π β§ π β π. the subscription fee, then access is granted.β Exercises 9. Are these system specifications consistent? βThe system is in multiuser state if and only if it is operating normally. If the system is operating normally, the kernel is functioning. The kernel is not functioning or the system is in interrupt mode. If the system is not in multiuser state, then it is in interrupt mode. The system is not in interrupt mode.β Exercises 9. Are these system specifications consistent? βThe system is in multiuser state if and only if it is operating normally. If the system is operating normally, the kernel is functioning. The kernel is not functioning or the system is in interrupt mode. If the system is not in multiuser state, then it is in interrupt mode. The system is not in interrupt mode.β The system is in multiuser state p it is operating normally q the kernel is functioning r the system is in interrupt mode s Exercises 1. The system is in multiuser state if and only if it is operating normally. oπβπ Both π and π be π‘ππ’π, or both be ππππ π. 2. If the system is operating normally, the kernel is functioning. oπβπ Anything except π = π‘ππ’π and π = ππππ π. 3. The kernel is not functioning or the system is in interrupt mode. o Β¬π β¨ π π = ππππ π, or π = π‘ππ’π. 4. If the system is not in multiuser state, then it is in interrupt mode. o Β¬p β π Anything except π = ππππ π and π = ππππ π 5. The system is not in interrupt mode. The system is in multiuser state p o Β¬π π must be ππππ π it is operating normally q the kernel is functioning r the system is in interrupt mode s Exercises [In step 5 and 4] If we set π = ππππ π, then we set π = π‘ππ’π. [In step 4 and 3] Since we have π = ππππ π, then we set π = ππππ π. [In step 3 and 2] Since we have π = ππππ π, then we set π = ππππ π. [In step 2, 1, and 4] We have π = ππππ π, but we have π = π‘ππ’π So, these specifications are not consistent Exercises 44. Find the output of each of these combinatorial circuits. Exercises 44. Find the output of each of these combinatorial circuits. (Β¬π) β¨ (Β¬π). Β¬(π β¨ ((Β¬π) β§ π))) Exercises 47. Construct a combinatorial circuit using inverters, OR gates, and AND gates that produces the output ((Β¬π β¨ Β¬π) β§ Β¬π) β¨ (Β¬π β§ (π β¨ π)) from input bits π, π, and π. Exercises 47. Construct a combinatorial circuit using inverters, OR gates, and AND gates that produces the output ((Β¬π β¨ Β¬π) β§ Β¬π) β¨ (Β¬π β§ (π β¨ π)) from input bits π, π, and π. TASKS Section 2 2 4 45 46