Propositions 命題
A proposition is a declarative sentence that is either true or false, but not both.
命題是一個對的或者錯的陳述句麸塞,但不能既是對的又是錯的
Definition 定義
-
非 not
-
與 and
-
或 or
-
異或 exclusive
-
條件語句 onditional statement
-
雙向條件語句 biconditional statement
T | T | F | T | T | F | T | T |
T | F | F | F | T | T | F | F |
F | T | T | F | T | T | T | F |
F | F | T | F | F | F | T | T |
Truth Tables of Compound Propositions 復(fù)合命題的真值表
Example 11 (P10):
The Truth Table of
T T F T T T T F T T F F F T F F F T F F T T F F
Precedence of Logical Operations 邏輯運算符的優(yōu)先級
Operator | Precedence |
---|---|
1 | |
2 | |
3 | |
4 | |
5 |
Logic and Bit Operations 邏輯值和位操作
- Boolean variable 布爾值
- bit operations 位操作
- bit string 位串
- length of a string 位串的長度
- bitwise OR/AND/XOR 按位與/或/亦或
- 1 為 true, 0 為 false
1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 |
1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 |
0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |
Exercises
- Which of these sentences are propositions? What are the truth values of those that are propositions?
a) Boston is the capital of Massachusetts.
b) Miami is the capital of Florida.
d) 5 + 7 = 10.
e) x + 2 = 11.
f ) Answer this question. - Let p and q be the propositions
p: I bought a lottery ticket this week.
q: I won the million dollar jackpot.
Express each of these propositions as an English sentence.
e) p ? q
h) ?p ∨ (p ∧ q) - Let p, q, and r be the propositions
p: You get an A on the final exam.
q: You do every exercise in this book.
r: You get an A in this class.
Write these propositions using p, q, and r and logical connectives (including negations).
d) You get an A on the final, but you don’t do every exercise in this book; nevertheless, you get an A in this
class.
e) Getting an A on the final and doing every exercise in this book is sufficient for getting an A in this class. - Determine whether each of these conditional statements is true or false.
c) If 1 + 1 = 2, then dogs can fly. - Write each of these statements in the form “if p, then q” in English. [Hint: Refer to the list of common ways to express conditional statements provided in this section.]
a) It is necessary to wash the boss’s car to get promoted.
b) Winds from the south imply a spring thaw.
c) A sufficient condition for the warranty to be good is that you bought the computer less than a year ago.
d) Willy gets caught whenever he cheats.
e) You can access the website only if you pay a subscription fee.
f ) Getting elected follows from knowing the right people.
g) Carol gets seasick whenever she is on a boat. - State the converse, contrapositive, and inverse of each of these conditional statements.
b) I go to the beach whenever it is a sunny summer day. - Construct a truth table for each of these compound propositions.
f ) (p ? q) ⊕ (p ??q) - 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?”
- Is the assertion “This statement is false” a proposition?