From 055e733ba7e3c19418f09b23e849d02743f94c1d Mon Sep 17 00:00:00 2001 From: tomit4 Date: Sun, 24 May 2026 18:06:01 -0700 Subject: [PATCH] :construction: Started chapter 2 --- chapter_2/examples.md | 0 chapter_2/exercises.md | 326 +++++++++++++++++++++++++++++++++++++ chapter_2/notes.md | 93 +++++++++++ chapter_2/test_yourself.md | 43 +++++ 4 files changed, 462 insertions(+) create mode 100644 chapter_2/examples.md create mode 100644 chapter_2/exercises.md create mode 100644 chapter_2/notes.md create mode 100644 chapter_2/test_yourself.md diff --git a/chapter_2/examples.md b/chapter_2/examples.md new file mode 100644 index 0000000..e69de29 diff --git a/chapter_2/exercises.md b/chapter_2/exercises.md new file mode 100644 index 0000000..36038f7 --- /dev/null +++ b/chapter_2/exercises.md @@ -0,0 +1,326 @@ +**Exercise Set 2.1** + +Page 74 + +In each of 1-4 represent the common form of each argument using letters to stand +for component sentences, and fill in the blanks so that the argument in part (b) +has the same logical form as the argument in part (a). + +1. + +a. + +If all integers are rational, then the number $1$ is rational. + +All integers are rational. + +Therefore, the number $1$ is rational. + +b. + +If all algebraic expressions can be written in prefix notation ,then + +______. + +______. + +Therefore, $(a + 2b)(a^2 - b)$ can be written in prefix notation. + +2. + +a. + +If all computer programs contain errors, then this program contains an error. + +This program does not contain an error. + +Therefore, it is not the case that all computer programs contain errors. + +b. + +If ______, then ______. + +2 is not odd. + +Therefore, it is not the case that all prime numbers are odd. + +3. + +a. + +This number is even or this number is odd. + +This number is not even. + +Therefore, this number is odd. + +b. + +______ or logic is confusing. + +My mind is not shot. + +Therefore, ______. + +4. + +a. + +If the program syntax is faulty, then the computer will generate an error +message. + +If the computer generates an error message, then the program will not run. + +Therefore, if the program syntax is faulty, then the program will not run. + +b. + +If this simple graph ______, then it is complete. + +If this graph ______, then any two of its vertices can be joined by a path. + +Therefore, if this simple graph has 4 vertices and 6 edges, then ______. + +5. Indicate which of the following sentences are statements. + +a. 1,024 is the smallest four-digit number that is a perfect square. + +b. She is a mathematics major. + +c. $128 = 2^6$ + +d. $x = 2^6$ + +Write the statements in 6-9 in symbolic form using the symbols $\neg$, $\wedge$, +$\vee$ and the indicated letters to represent component statements. + +6. Let $s = $ "stocks are increasing" and $i = $ "interest rates are steady." + +a. Stocks are increasing but interest rates are steady. + +b. Neither are stocks increasing nor are interest rates steady. + +7. Juan is a math major but not a computer science major. ($m = $ "Juan is a + math major," $c = $ "Juan is a computer science major") + +8. Let $h = $ "John is healthy," $w = $ "John is wealthy," and $s = $ "John is + wise." + +a. John is healthy and wealthy but not wise. + +b. John is not wealthy but he is healthy and wise. + +c. John is neither healthy, wealthy, nor wise. + +d. John is neither wealthy nor wise, but he is healthy. + +e. John is wealthy, but he is not both healthy and wise. + +9. Let $p = $ "$x > 5$," $q = $ "$x = 5$," and $r = $ "$10 > x$." + +a. $x \geq 5$ + +b. $10 > x > 5$ + +c. $10 > x \geq 5$ + +10. Let $p$ be the statement "DATAENDFLAG is off," $q$ the statement "ERROR + equals 0," and $r$ the statement "SUM is less than 1,000." Express the + following sentences in symbolic notation. + +a. DATAENDFLAG is off, ERROR equals 0, and SUM is less than 1,000. + +b. DATAENDFLAG is off but ERROR is not equal to 0. + +c. DATAENDFLAG is off; however, ERROR is not 0 or SUM is greater than or equal +to 1,000. + +e. Either DATAENDFLAG is on or it is the case that both ERROR equals 0 and SUM +is less than 1,000. + +11. In the following sentence, is the word _or_ used in its inclusive or + exclusive sense? A team wins the playoffs if it wins two games in a row or a + total of three games. + +Write truth tables for the statement forms 12-15. + +12. $\neg p \wedge q$ + +13. $\neg (p \wedge q) \vee (p \vee q)$ + +14. $p \wedge (q \wedge r)$ + +15. $p \wedge (\neg q \vee r)$ + +Determine whether the statement forms in 16-24 are logically equivalent. In each +case, construct a truth table and include a sentence justifying your answer. +Your sentence should show that you understand the meaning of logical +equivalence. + +16. $p \vee (p \wedge q) \text{ and } p$ + +17. $\neg (p \wedge q) \text{ and } \neg p \wedge \neg q$ + +18. $p \vee \mathbf{t} \text{ and } \mathbf{t}$ + +19. $p \wedge \mathbf{t} \text{ and } $ + +20. $p \wedge \mathbf{c} \text{ and } p \vee \mathbf{c}$ + +21. $(p \wedge q) \wedge r \text{ and } p \wedge (q \wedge r)$ + +22. $p \wedge (q \vee r) \text{ and } (p \wedge q) \vee (p \wedge r)$ + +23. $(p \wedge q) \vee r \text{ and } p \wedge (q \vee r)$ + +24. $(p \vee q) \vee (p \wedge r) \text{ and } (p \vee q) \wedge r$ + +Use De Morgan's laws to write negations for the statements in 25-30. + +25. Hal is a math major and Hal's sister is a computer science major. + +26. Sam is an orange belt and Kate is a red belt. + +27. The connector is loose or the machine is unplugged. + +28. The train is late or my watch is fast. + +29. This computer program has a logical error in the first ten lines or it is + being run with an incomplete data set. + +30. The dollar is at an all-time high and the stock market is at a record low. + +31. Let $s$ be a string of length 2 with characters from $\{0, 1, 2\}$, and + define statements $a$, $b$, $c$, and $d$ as follows: + +$a = $ "the first character of $s$ is 0" + +$b = $ "the first character of $s$ is 1" + +$c = $ "the second character of $s$ is 1" + +$c = $ "the second character of $s$ is 2". + +Describe the set of all strings for which each of the following is true. + +a. $(a \vee b) \wedge (c \vee d)$ + +b. $(\neg(a \vee b)) \wedge (c \vee d)$ + +c. $((\neg a) \vee b) \wedge (c \vee (\neg d))$ + +Assume $x$ is a particular real number and use De Morgan's laws to write +negations for the statements in 32-37. + +32. $-2 < x < 7$ + +33. $-10 < x < 2$ + +34. $x < 2 \text{ or } x > 5$ + +35. $x \leq -1 \text{ or } x > 1$ + +36. $1 > x \geq -3$ + +37. $0 > x \geq -7$ + +In 38 and 39, imagine that _num_orders_ and _num_instock_ are particular values, +such as might occur during execution of a computer program. Write negations for +the following statements. + +38. $(\text{num_orders } > 100 \text{ and } \text{num_instock } \leq 500) \text{ or } \text{num_instock } < 200$ + +39. $(\text{num_orders } < 50 \text{ and } \text{num_instock } > 300) \text{ or } (50 \leq \text{ num_orders } < 75 \text{ and } \text{num_instock} > 500)$ + +Use truth tables to establish which of the statement forms in 40-43 are +tautologies and which are contradictions. + +40. $(p \wedge q) \vee (\neg p \vee (p \wedge \neg q))$ + +41. $(p \wedge \neg q) \wedge (\neg p \vee q)$ + +42. $((\neg p \wedge q) \wedge (q \wedge r)) \wedge \neg q$ + +43. $(\neg p \vee q) \vee (p \wedge \neg q)$ + +44. Recall that $a < x < b$ means that $a < x$ and $x < b$. Also $a \leq b$ + means that $a < b$ or $a = b$. Find all real numbers that satisfy the + following inequalities. + +a. $2 < x \leq 0$ + +b. $1 \leq x < -1$ + +45. Determine whether the statements in (a) and (b) are logically equivalent. + +a. Bob is both a math and computer science major and Ann is a math major, but +Ann is not both a math and computer science major. + +b. It is not the case that both Bob and Ann are both math and computer science +majors, but it is the case that Ann is a math major and Bob is both a math and +computer science major. + +46. Let the symbol $\oplus$ denote _exclusive or_; so + $p \plus q \equiv (p \vee q) \wedge \neg(p \wedge q)$. Hence the truth table + for $p \plus q$ is as follows: + +| $p$ | $q$ | $p \plus q$ | +| --- | --- | ----------- | +| T | T | F | +| T | F | T | +| F | T | T | +| F | F | F | + +a. Find simpler statement forms that are logically equivalent to $p \plus p$ and +$(p \oplus p) \oplus p$. + +b. Is $(p \oplus q) \oplus r \equiv p \oplus (q \oplus r)$? Justify your answer. + +c. Is $(p \oplus q) \wedge r \equiv (p \wedge r) \oplus (q \wedge r)$? Justify +your answer. + +47. In logic and in standard English, a double negative is equivalent to a + positive. There is one fairly common English usage in which a "double + positive" is equivalent to a negative. What is it? Can you think of others? + +In 48 and 49 below, a logical equivalence is derived from Theorem 2.1.1. Supply +a reason for each step. + +48. + +$$ p \vee \neg q \vee (p \wedge q) \equiv p \wedge (\neg q \vee q) \text{ by (a)} $$ + +$$ \quad \equiv p \wedge (q \vee \neg q) \text{ by (b)} $$ + +$$ \quad \equiv p \wedge \mathbf{t} \text{ by (c)} $$ + +$$ \quad \equiv p \text{ by (d)} $$ + +Therefore, $(p \wedge \neg q) \vee (p \wedge q) \equiv p$. + +49. + +$$ (p \vee \neg q) \wedge (\neg p \vee \neg q) $$ + +$$ \quad \equiv (\neg q \vee p) \wedge (\neg q \vee \neg p) \text{ by (a)} $$ + +$$ \quad \equiv \neg q \vee (p \wedge \neg p) \text{ by (b)} $$ + +$$ \quad \equiv q \vee \mathbf{c} \text{ by (c)} $$ + +$$ \quad \equiv \neg q \text{ by (d)} $$ + +Therefore, $(p \vee \neg q) \wedge (\neg p \vee \neg q) \equiv \neg q$. + +Use Theorem 2.1.1 to verify the logical equivalences in 50-54. Supply a reason +for each step. + +50. $(p \wedge \neg q) \vee p \equiv p$ + +51. $p \wedge (\neg q \vee p) \equiv p$ + +52. $\neg(p \vee \neg q) \vee (\neg p \wedge \neg q) \equiv \neg p$ + +53. $\neg((\neg p \wedge q) \vee (\neg p \wedge \neg q)) \vee (p \wedge q) \equiv p$ + +54. $(p \wedge (\neg(\neg p \vee q))) \vee (p \wedge q) \equiv p$ diff --git a/chapter_2/notes.md b/chapter_2/notes.md new file mode 100644 index 0000000..bb8eefd --- /dev/null +++ b/chapter_2/notes.md @@ -0,0 +1,93 @@ +Page 61 + +**Definition** + +A **statement** (or **proposition**) is a sentence that is true or false but not +both. + +--- + +Page 63 + +**Definition** + +If $p$ is a statement variable, the **negation** of $p$ is "not $p$" or "It is +not the case that $p$" and is denoted $\neg p$. It has opposite truth value from +$p$: if $p$ is true, $\neg p$ is false; if $p$ is false, $\neg p$ is true. + +--- + +Page 64 + +**Definition** + +If $p$ and $q$ are statement variables, the **conjunction** of $p$ and $q$ is +"$p$ and $q$", denoted $p \wedge q$. It is true when, and only when, both $p$ +and $q$ are true. If either $p$ or $q$ is false, or if both are false, +$p \wedge q$ is false. + +--- + +Page 64 + +**Definition** + +If $p$ and $q$ are statement variables, the **disjunction** of $p$ and $q$ is +"$p$ or $q$", denoted $p \vee q$. It is true when either $p$ is true, or $q$ is +true, or both $p$ and $q$ are true; it is false only when both $p$ and $q$ are +false. + +--- + +Page 65 + +**Definition** + +A **statement form** (or **propositional form**) is an expression made up of +statement variables (such as $p$, $q$, and $r$) and logical connectives (such as +$\neg$, $\wedge$, and $\vee$) that becomes a statement when actual statements +are substituted for the component statement variables. The **truth table** for a +given statement form displays the truth values that correspond to all possible +combinations of truth values for its component statement variables. + +--- + +Page 67 + +**Definition** + +Two _statement forms_ are called **logically equivalent** if, and only if, they +have identical truth values for each possible substitution of statements for +their statement variables. The logical equivalence of statements forms $P$ and +$Q$ is denoted by writing $P \equiv Q$. + +Two _statements_ are called **logically equivalent** if, and only if, they have +logically equivalent forms when identical component statement variables are used +to replace identical component statements. + +--- + +Page 69 + +**De Morgan's Laws** + +The negation of an _and_ statement is logically equivalent to the _or_ statement +in which each component is negated. + +The negation of an _or_ statement is logically equivalent to the _and_ statement +in which each component is negated. + +--- + +Page 71 + +**Definition** + +A **tautology** is a statement form that is always true regardless of the truth +values of the individual statements substituted for its statement variables. A +statement whose form is a tautology is a **tautological statement**. + +A **contradiction** is a statement form that is always false regardless of the +truth values of the individual statements substituted for its statement +variables. A statement whose form is a contradiction is a **contradictory +statement**. diff --git a/chapter_2/test_yourself.md b/chapter_2/test_yourself.md new file mode 100644 index 0000000..8656012 --- /dev/null +++ b/chapter_2/test_yourself.md @@ -0,0 +1,43 @@ +**Test Yourself** + +Page 73 + +1. An _and_ statement is true when, and only when, both components are _______. + +**Solution** + +True. + +2. An _or_ statement is false when, and only when, both components are _______. + +**Solution** + +False. + +3. Two statement forms are logically equivalent when, and only when, they always + have _______. + +**Solution** + +The same truth values. + +4. De Morgan's laws says (1) that the negation of an _and_ statement is + logically equivalent to the _______ statement in which each component is + _______, and (2) that the negation of an _or_ statement is logically + equivalent to the _______ statement in which each component is _______. + +**Solution** + +or; negated; and; negated. + +5. A tautology is a statement that is always _______. + +**Solution** + +true + +6. A contradiction is a statement that is always _______. + +**Solution** + +false