1.1 Propositional Logic 命題邏輯

Propositions 命題

A proposition is a declarative sentence that is either true or false, but not both.
命題是一個對的或者錯的陳述句麸塞,但不能既是對的又是錯的

Definition 定義

  1. \lnot 非 not
  2. \land 與 and
  3. \lor 或 or
  4. \oplus 異或 exclusive
  5. \to 條件語句 onditional statement
  6. \leftrightarrow 雙向條件語句 biconditional statement
p q \lnot p p \land q p \lor q p \oplus q p \to q p \leftrightarrow q
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 (p \lor \lnot q) \to (p \land q)

p q \lnot q p \lor \lnot q p \land q (p \lor \lnot q) \to (p \land q)
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
\lnot 1
\land 2
\lor 3
\to 4
\leftrightarrow 5

Logic and Bit Operations 邏輯值和位操作

  • Boolean variable 布爾值
  • bit operations 位操作
  • bit string 位串
  • length of a string 位串的長度
  • bitwise OR/AND/XOR 按位與/或/亦或
  • 1 為 true, 0 為 false
p q \lnot p p \land q p \lor q p \oplus q p \to q p \leftrightarrow q
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

  1. 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.
  2. 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)
  3. 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.
  4. Determine whether each of these conditional statements is true or false.
    c) If 1 + 1 = 2, then dogs can fly.
  5. 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.
  6. 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.
  7. Construct a truth table for each of these compound propositions.
    f ) (p ? q) ⊕ (p ??q)
  8. 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?”
  9. Is the assertion “This statement is false” a proposition?
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末乎折,一起剝皮案震驚了整個濱河市脖隶,隨后出現(xiàn)的幾起案子布讹,更是在濱河造成了極大的恐慌,老刑警劉巖刻伊,帶你破解...
    沈念sama閱讀 223,126評論 6 520
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異椒功,居然都是意外死亡捶箱,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,421評論 3 400
  • 文/潘曉璐 我一進店門动漾,熙熙樓的掌柜王于貴愁眉苦臉地迎上來丁屎,“玉大人,你說我怎么就攤上這事旱眯〕看ǎ” “怎么了?”我有些...
    開封第一講書人閱讀 169,941評論 0 366
  • 文/不壞的土叔 我叫張陵删豺,是天一觀的道長共虑。 經(jīng)常有香客問我,道長呀页,這世上最難降的妖魔是什么妈拌? 我笑而不...
    開封第一講書人閱讀 60,294評論 1 300
  • 正文 為了忘掉前任,我火速辦了婚禮蓬蝶,結(jié)果婚禮上尘分,老公的妹妹穿的比我還像新娘。我一直安慰自己丸氛,他們只是感情好培愁,可當(dāng)我...
    茶點故事閱讀 69,295評論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著缓窜,像睡著了一般定续。 火紅的嫁衣襯著肌膚如雪谍咆。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,874評論 1 314
  • 那天香罐,我揣著相機與錄音卧波,去河邊找鬼。 笑死庇茫,一個胖子當(dāng)著我的面吹牛港粱,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播旦签,決...
    沈念sama閱讀 41,285評論 3 424
  • 文/蒼蘭香墨 我猛地睜開眼查坪,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了宁炫?” 一聲冷哼從身側(cè)響起偿曙,我...
    開封第一講書人閱讀 40,249評論 0 277
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎羔巢,沒想到半個月后望忆,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,760評論 1 321
  • 正文 獨居荒郊野嶺守林人離奇死亡竿秆,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,840評論 3 343
  • 正文 我和宋清朗相戀三年启摄,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片幽钢。...
    茶點故事閱讀 40,973評論 1 354
  • 序言:一個原本活蹦亂跳的男人離奇死亡歉备,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出匪燕,到底是詐尸還是另有隱情蕾羊,我是刑警寧澤,帶...
    沈念sama閱讀 36,631評論 5 351
  • 正文 年R本政府宣布帽驯,位于F島的核電站龟再,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏尼变。R本人自食惡果不足惜吸申,卻給世界環(huán)境...
    茶點故事閱讀 42,315評論 3 336
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望享甸。 院中可真熱鬧截碴,春花似錦、人聲如沸蛉威。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,797評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽蚯嫌。三九已至哲虾,卻和暖如春蜂嗽,著一層夾襖步出監(jiān)牢的瞬間匿辩,已是汗流浹背播揪。 一陣腳步聲響...
    開封第一講書人閱讀 33,926評論 1 275
  • 我被黑心中介騙來泰國打工富稻, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人汪诉。 一個月前我還...
    沈念sama閱讀 49,431評論 3 379
  • 正文 我出身青樓废恋,卻偏偏與公主長得像,于是被迫代替她去往敵國和親扒寄。 傳聞我的和親對象是個殘疾皇子鱼鼓,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,982評論 2 361