SlideShare a Scribd company logo
1 of 41
Download to read offline
. Preface


        目標 這門課應該教導同學如何用邏輯與數學
           來思考 (how to think logically and
           mathematically)。
        內容 包括五個部份:mathematical
           reasoning(數學推理)、combinatorial
           analysis(組合分析)、discrete
           structure(離散結構)、algorithmic
           thinking(演算法的思考)、applications
           and modeling(應用與模型)

                                                        .   .   .      .      .     .

        洪春男      1. The Foundations: Logic and Proofs               March 1, 2011   1 / 41
. 教材
    課本 Discrete Mathematics and its
       Applications(sixth edition), Kenneth H.
       Rosen
  參考書籍 離散數學 (Discrete Mathematics and its
       Applications 中譯本) sixth edition, 謝良
       瑜陳志賢譯




                                                       .   .   .      .      .     .

       洪春男      1. The Foundations: Logic and Proofs               March 1, 2011   2 / 41
. 自我介紹




     姓名 洪春男
     email spring@mail.dyu.edu.tw
     電話 04-8511888 轉 2410
    辦公室 工學院 H311
  Homepage http://www.dyu.edu.tw/ spring




                                                        .   .   .      .      .     .

     洪春男         1. The Foundations: Logic and Proofs               March 1, 2011   3 / 41
. 評分標準




   期中考 20%
   期末考 30%
  平常分數 50%(點名與隨堂測驗、作業、平常考
       大約各佔 1/3)




                                                 .   .   .      .      .     .

    洪春男   1. The Foundations: Logic and Proofs               March 1, 2011   4 / 41
. Contents
     1. The Foundations: Logic and Proofs(1.1-1.7)
      .
     2 Basic Structures: Sets, Functions, Sequences, and

        Sums(2.1-2.4)
     3. The Fundamentals: Algorithms, the Integers, and
        Matrices(3.1-3.5, 3.8)
     4. Induction and Recursion(4.1-4.3)
      .
     5 Counting(5.1-5.3)

     6. Discrete Probability(6.1)
      .
     7 Advanced Counting Techniques(7.1, 7.5)

      .
     8 Relations(8.1, 8.3, 8.5)

     9. Graphs(9.1-9.5)
      .
     10 Trees(10.1)

      . Boolean Algebra
     11

      .
     12 Modeling Computation
                                                                 .   .   .      .      .     .

          洪春男             1. The Foundations: Logic and Proofs               March 1, 2011   5 / 41
. 1. The Foundations: Logic and Proofs



       Logic is the basis of all mathematical reasoning,
       and of all automated reasoning. 邏輯是所有數
       學推理與自動推理的基礎。
       To understand mathematics, we must
       understand what makes up a correct
       mathematical argument, that is, a proof. 要了
       解數學,必須了解建構正確的數學論證,也
       就是證明。


                                                           .   .   .      .      .     .

        洪春男         1. The Foundations: Logic and Proofs               March 1, 2011   6 / 41
. 1.1 Propositional Logic 命題邏輯
         A proposition is a declarative sentence(that is,
         a sentence that declares a fact) that is either
         true or false, but not both. 命題是一個述句
         (宣告事實的句子),它可能是真、也可能是
         假,但不能旣真又假。
    .
    Example 1
    .
      1. Washington, D.C., is the capital of the United
         States of America. 華盛頓特區是美國首都。
      2. Toronto is the capital of Canada. 多倫多是加
         拿大首都。
      3. 1 + 1 = 2.
      4. 2 + 2 = 3.
    . 洪春男                                          .    .

                        1. The Foundations: Logic and Proofs
                                                             .    .    .

                                                             March 1, 2011
                                                                             .

                                                                             7 / 41
. 1.1 Propositional Logic 命題邏輯


    .
    Example 2
    .
    下列是錯誤的 propositions
      1. What time is it? 現在幾點?
      2. Read this carefully. 小心閱讀。
      3. x + 1 = 2.
       .
    . x + y = z.
      4




                                                          .   .   .      .      .     .

       洪春男         1. The Foundations: Logic and Proofs               March 1, 2011   8 / 41
. 1.1 Propositional Logic 命題邏輯
       propositional variables 命題變數, p, q, r, s, · · ·
       truth value: T(真)、F(假)
       The area of logic that deals with propositions is
       called the propositional calculus or
       propositional logic. 專門處理命題的邏輯稱
       為命題演算或命題邏輯,亞里斯多德
       (Aristotle) 最早開始使用。
       New propositions, called compound
       propositions, are formed from existing
       propositions using logical operators. 由已存在
       的命題加上邏輯運算子形成新的命題,稱為
       複合命題。                                               .   .   .      .      .     .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   9 / 41
. 1.1 Propositional Logic 命題邏輯

    .
    Definition 1
    .
    Let p be a proposition. The negation of p,
    denoted by ¬p(also denoted by p), is the statement
    “It is not the case that p.”
    The proposition ¬p is read “not p”. The truth value
    of the negation of p, ¬p, is the opposite of the
    truth value of p.
    令 p 為一命題, p 的否定句為「p 不成立」                       ,以
    ¬p 表示 (有時也用 p 表示)。 ¬p 讀作「非 p」                    ,
    其真假值與 p 的真假值剛好相反。
    .

                                                            .   .   .       .      .    .

       洪春男           1. The Foundations: Logic and Proofs               March 1, 2011   10 / 41
. 1.1 Propositional Logic 命題邏輯

    .
    Example 3
    .
    Find the negation of the proposition
    “Today is Friday.”
    and express this in simple English.
    找出「今天是星期五」的否定命題,且用簡單的
    英文表示。
    “It is not the case that today is Friday.”
    “Today is not Friday.”
    “It is not Friday today.”
    「今天是星期五不成立」或「今天不是星期五」
    .

                                                         .   .   .       .      .    .

       洪春男        1. The Foundations: Logic and Proofs               March 1, 2011   11 / 41
. 1.1 Propositional Logic 命題邏輯
   .
   Example 4
   .
   Find the negation of the proposition
   “At least 10 inches of rain fell today in Miami.”
   and express this in simple English.
   找出「邁阿密今天至少下 10 英吋的雨」的否定
   命題,且用簡單的英文表示。
   “It is not the case that at least 10 inches of rain fell
   today in Miami.”
   “Less than 10 inches of rain fell today in Miami.”
   「邁阿密今天至少下 10 英吋的雨不成立」或
   「邁阿密今天下不到 10 英吋的雨」
   .                                      。
                                                             .   .   .       .      .    .

        洪春男           1. The Foundations: Logic and Proofs               March 1, 2011   12 / 41
. 1.1 Propositional Logic 命題邏輯


    .
    Definition 2
    .
    Let p and q be propositions. The conjunction of p
    and q, denoted by p ∧ q, is the proposition “p and
    q.”. The conjunction p ∧ q is true when both p and
    q are true and is false otherwise.
    令 p 與 q 都是命題, p 與 q 同時發生為「p 和
    q」  ,記成 p ∧ q,當 p 與 q 都是真時 p ∧ q 為真,
    否則為假。
    .


                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   13 / 41
. 1.1 Propositional Logic 命題邏輯


    .
    Example 5
    .
    Find the conjunction of the propositions p and q
    where p is the proposition “Today is Friday” and q
    is the proposition “It is raining today”.
    令命題 p 為「今天是星期五」                   ,命題 q 為「今天
    下雨」    ,請找出 p 與 q 的 conjunction。
    “Today is Friday and it is raining today.”
    「今天是星期五且下雨」
    .


                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   14 / 41
. 1.1 Propositional Logic 命題邏輯

    .
    Definition 3
    .
    Let p and q be propositions. The disjunction of p
    and q, denoted by p ∨ q, is the proposition “p or q.”.
    The disjunction p ∨ q is false when both p and q are
    false and is true otherwise.
    令 p 與 q 都是命題, p 與 q 的分裂為「p 或
    q」 ,記成 p ∨ q,當 p 與 q 都是假時 p ∨ q 為假,
    否則為真。
    .
    or 有 inclusive 與 exclusive 的分別, ∨ 是
    inclusive。
                                                            .   .   .       .      .    .

        洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   15 / 41
. 1.1 Propositional Logic 命題邏輯


    .
    Example 6
    .
    What is the disjunction of the propositions p and q
    where p and q are the same propositions as in
    Example 5.
    令命題 p 為「今天是星期五」                  ,命題 q 為「今天
    下雨」   ,請問 p 與 q 的 disjunction。
    “Today is Friday or it is raining today.”
    「今天是星期五或今天下雨」
    .


                                                            .   .   .       .      .    .

       洪春男           1. The Foundations: Logic and Proofs               March 1, 2011   16 / 41
. 1.1 Propositional Logic 命題邏輯


    .
    Definition 4
    .
    Let p and q be propositions. The exclusive or of p
    and q, denoted by p ⊕ q, is the proposition that is
    true when exactly one of p and q is true and is false
    otherwise.
    令 p 與 q 都是命題, p 與 q 的互斥或,記成
    p ⊕ q,當 p 與 q 恰為一真一假時 p ⊕ q 為真,否
    則為假。
    .


                                                            .   .   .       .      .    .

        洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   17 / 41
. 1.1 Propositional Logic 命題邏輯




    The   truth table 真值表
     p    q ¬p p ∧ q p ∨ q p ⊕ q
     T    T F        T  T    F
     T    F F        F  T    T
     F    T T        F  T    T
     F    F T        F   F   F




                                                          .   .   .       .      .    .

          洪春男      1. The Foundations: Logic and Proofs               March 1, 2011   18 / 41
. 1.1 Propositional Logic 命題邏輯
     .
     Definition 5
     .
     Let p and q be propositions. The conditional
     statement p → q is the proposition “if p, then q.”
     The conditional statement p → q is false when p is
     true and q is false, and true otherwise. In the
     conditional statement p → q, p is called the
     hypothesis(or antecedent or premise) and q is
     called the conclusion(or consequence).
     令 p 與 q 都是命題,條件句 p → q 代表「若 p
     則 q」的命題。當 p 真 q 假時,條件句 p → q 為
     假,否則為真。其中 p 稱為假設 (或前提)、而 q
     稱為結論。
     .
                                                            .   .   .       .      .    .

        洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   19 / 41
. 1.1 Propositional Logic 命題邏輯
      A conditional statement is also called an
      implication. 條件句有時也稱為隱涵。
      下列都是「若 p 則 q」的寫法: p, then          「if
      q」 「p implies q」 「if p, q」, 「p only if q」,
         、                、
      「p is sufficient for q」, 「a sufficient condition
      for q is p」, 「q if p」, 「q whenever p」, 「q
      when p」 「q is necessary for p」 「a necessary
                、                        、
      condition for p is q」 「q follows from p」 「q
                           、                      、
      unless ¬p」
      “If I am elected, then I will lower taxes.” 若我當
      選就減稅。
      “If you get 100% on the final, then you will get
      an A.” 期末考 100 分就得 A。                               .   .   .       .      .    .

       洪春男         1. The Foundations: Logic and Proofs               March 1, 2011   20 / 41
. 1.1 Propositional Logic 命題邏輯
     .
     Example 7
     .
     Let p be the statement “Maria learns discrete
     mathematics” and q the statement “Maria will find
     a good job.” Express the statement p → q as a
     statement in English.
     令 p 是「瑪麗亞學離散數學」 q 為「瑪麗亞將       ,
     找到好工作」         ,請用英文表達 p → q。
     “If Maria learns discrete mathematics, then she will
     find a good job.”,「若瑪麗亞學離散數學,她將
     找到好工作」         ,“Maria will find a good job when
     she learns discrete mathematics.”,“Maria will find
     a good job unless she does not learn discrete
     mathemathics.”
     .                                                       .   .   .       .      .    .

        洪春男           1. The Foundations: Logic and Proofs               March 1, 2011   21 / 41
. 1.1 Propositional Logic 命題邏輯

       “If it is sunny today, then we will go to the
       beach.” 若今天出太陽,我們將去海邊玩。
       “If today is Friday, then 2 + 3 = 5.” 若今天是
       星期五,則 2 + 3 = 5。
       “If today is Friday, then 2 + 3 = 5.” 若今天是
       星期五,則 2 + 3 = 6。
       前題與結果未必需要有因果關係。
    .
    Example 8
    .
    if 2 + 2 = 4 then x := x + 1.
    若在這個 statement 之前 x = 0 的話,執行之後 x
    的值是多少?
    .
                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   22 / 41
. 1.1 Propositional Logic 命題邏輯


       The proposition q → p is called the converse
       (相反) of p → q.
       The contrapositive (對換) of p → q is the
       proposition ¬q → ¬p.
       The proposition ¬p → ¬q is called the inverse
       (相反) of p → q.
       When two compound propositions always have
       the same truth value we call them equivalent.


                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   23 / 41
. 1.1 Propositional Logic 命題邏輯
    .
    Example 9
    .
    What are the contrapositive, the converse, and the
    inverse of the conditional statement
    “The home team wins whenever it is raining.”? 每
    當下雨時地主隊獲勝。
    contrapositive “If the home team doesn’t win, then
    it is not raining.” 若地主隊沒贏就沒有下雨。
    converse “If the home team wins, then it is raining.”
    若地主隊贏就下雨
    inverse “If it is not raining, then the home team
    doesn’t win.” 若沒下雨地主隊就沒贏。
    .
                                                            .   .   .       .      .    .

        洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   24 / 41
. 1.1 Propositional Logic 命題邏輯
    .
    Definition 6
    .
    Let p and q be propositions. The biconditional
    statement p ↔ q is the proposition “p if and only
    if q.” The biconditional statement p ↔ q is true
    when p and q have the same truth values, and is
    false otherwise. Biconditional statements are also
    called bi-implications.
    令 p 與 q 都是命題,雙條件句 p ↔ q 代表「p 若
    且唯若 q」的命題。當 p 與 q 有相同真假值時,
    雙條件句 p ↔ q 為真,否則為假。雙條件句又稱
    為雙蘊涵。
    .
                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   25 / 41
. 1.1 Propositional Logic 命題邏輯

       當 p → q 與 q → p 都是 true 時 p ↔ q 才為
       true。
       「p is necessary and sufficient for q」 「if p
                                          、
       then q, and conversely」 「p iff q」都是 p ↔ q
                              、
       的意思。iff 是 if and only if 的縮寫。
    .
    Example 10
    .
    Let p be the statement “You can take the flight”
    and let q be the statement “You buy a ticket.”
    Then p ↔ q is the statement
    “You can take the flight if and only if you buy a
    ticket.”
    .
                                                            .   .   .       .      .    .

       洪春男           1. The Foundations: Logic and Proofs               March 1, 2011   26 / 41
. 1.1 Propositional Logic 命題邏輯




    The   truth table 真值表
     p    q p → q q → p ¬q → ¬p ¬p → ¬q p ↔ q
     T    T     T      T   T       T      T
     T    F     F      T   F       T      F
     F    T     T      F   T       F      F
     F    F     T      T   T       T      T




                                                         .   .   .       .      .    .

          洪春男     1. The Foundations: Logic and Proofs               March 1, 2011   27 / 41
. 1.1 Propositional Logic 命題邏輯

    .
    Example 11
    .
    Construct the truth table of the compound
    proposition
    (p ∨ ¬q) → (p ∧ q).
    .
    p   q ¬q p ∨ ¬q p ∧ q (p ∨ ¬q) → (p ∧ 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

                                                           .   .   .       .      .    .

        洪春男         1. The Foundations: Logic and Proofs               March 1, 2011   28 / 41
. 1.1 Propositional Logic 命題邏輯


    Precedence of Logical Operators
    邏輯運算子的優先順序
    Operator Precedence
       ¬         1
       ∧         2
       ∨         3
      →          4
      ↔          5


                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   29 / 41
. 1.1 Propositional Logic 命題邏輯
     .
     Example 12
     .
     How can this English sentence be translated into a
     logical expression?
     “You can access the Internet from campus only if
     you are a computer science major or you are not a
     freshman.”
     只有當你主修電腦或不是新鮮人,才能在校園中
     使用網路
     a 代表 “You can access the Internet from campus.”
     c 代表 “You are a computer science major.”
     f 代表 “You are a freshman.”
     前面的句字可翻譯為 a → (c ∨ ¬f)
     .
                                                            .   .   .       .      .    .

        洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   30 / 41
. 1.1 Propositional Logic 命題邏輯
    .
    Example 13
    .
    How can this English sentence be translated into a
    logical expression?
    “You cannot ride the roller coaster if you are under
    4 feet tall unless you are older than 16 years old.”
    若你不到 4 英呎高就不能坐雲霄飛車,除非你超
    過 16 歲。
    q 代表 “You can ride the roller coaster.”
    r 代表 “You are under 4 feet tall.”
    s 代表 “You are older than 16 years old.”
    前面的句字可翻譯為 (r ∧ ¬s) → ¬q
    .
                                                            .   .   .       .      .    .

       洪春男           1. The Foundations: Logic and Proofs               March 1, 2011   31 / 41
. 1.1 Propositional Logic 命題邏輯

    .
    Example 14
    .
    Express the specification “The automated reply
    cannot be sent when the file system is full” using
    logical connectives. 使用邏輯連詞表達下列規
    定:  「當檔案系統滿了,自動回覆功能不能被送
    出」  。
    p 代表 “The automated reply can be sent.”
    q 代表 “The file system is full.”
    前面的句字可翻譯為 q → ¬p
    .

                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   32 / 41
. 1.1 Propositional Logic 命題邏輯

    .
    Example 15
    .
    Determine whether these system specifications are consistent:
    “The diagnostic message is stored in the buffer or it is
    retransmitted.”
    “The diagnostic message is not stored in the buffer.”
    “If the diagnostic message is stored in the buffer, then it is
    retransmitted.”
    p 代表 “The diagnostic message is stored in the buffer.”
    q 代表 “The diagnostic message is retransmitted.”
    前面三個句字為 p ∨ q, ¬p, p → q,當 p 為 F 而 q 為 T
    時,三個句子都成立,因此 consistent。
    .


                                                               .   .   .       .      .    .

        洪春男             1. The Foundations: Logic and Proofs               March 1, 2011   33 / 41
. 1.1 Propositional Logic 命題邏輯

    .
    Example 16
    .
    Do the system specifications in Example 15 remain
    consistent if the specification “The diagnostic
    message is not retransmitted” is added?
    p 代表 “The diagnostic message is stored in the
    buffer.”
    q 代表 “The diagnostic message is retransmitted.”
    四個句字為 p ∨ q, ¬p, p → q, ¬q,顯然無法使四
    個句子都為 true,因此不 consistent。
    .


                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   34 / 41
. 1.1 Propositional Logic 命題邏輯 - boolean searches


    可在搜尋引擎中輸入下列關鍵字,看看結果如何
    .
    Example 17
    .
    New and Mexico and University「New Mexico
    University」
    (New and Mexico or Arizona) and University
    (Mexico and Universities) not New 「Mexico
    Universities -New」
    大葉 -高島屋
    大葉資訊 -資管 -會計
    .

                                                          .   .   .       .      .    .

       洪春男         1. The Foundations: Logic and Proofs               March 1, 2011   35 / 41
. 1.1 Propositional Logic 命題邏輯 - Logic Puzzles


    .
    Example 18
    .
    An island that has two kinds of inhabitants(居民),
    knights(騎士),who always tell the truth, and their
    opposites, knaves(無賴), who always lie. You
    encounter 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”?
    .



                                                            .   .   .       .      .    .

       洪春男           1. The Foundations: Logic and Proofs               March 1, 2011   36 / 41
. 1.1 Propositional Logic 命題邏輯 - Logic Puzzles


    答案:Both A and B are knaves.
    .
    Example 19
    .
    兩個兄妹在後院玩,兩人的前額都沾了泥巴,父
    親說: 「你們兩人中至少一人前額有泥巴。        」父親
    問: 「你知道你自己的前額有沒有沾泥巴呢?」
    父親問兩次,請問兩個小朋友會如何回答?假設
    小朋友可看到另一人的前額、看不到自己的前
    額,且都說實話,兩人只能回答 Yes / No。
    .


                                                          .   .   .       .      .    .

       洪春男         1. The Foundations: Logic and Proofs               March 1, 2011   37 / 41
1.1 Propositional Logic 命題邏輯 - Logic and Bit
. Operations

    答案:第一次都回答 NO,第二次都是 Yes。
        A bit is a symbol with two possible values,
        namely, 0(zero) and 1(one). 可代表 true(1) 與
        false(0)。
        A variable is called a Boolean variable if its
        value is either true or false.
    .
    Definition 7
    .
    A bit string is a sequence of zero or more bits. The
    length of this string is the number of bits in the
    string.
    .
                                                            .   .   .       .      .    .

       洪春男           1. The Foundations: Logic and Proofs               March 1, 2011   38 / 41
1.1 Propositional Logic 命題邏輯 - Logic and Bit
. Operations


    .
    Example 20
    .
    101010011 is a bit string of length nine.
    .
    We define the bitwise OR, bitwise AND, and
    bitwise XOR of two strings of the same length to
    be the strings that have as their bits the OR, AND,
    and XOR of the corresponding bits in the two
    strings, respectively.


                                                            .   .   .       .      .    .

        洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   39 / 41
1.1 Propositional Logic 命題邏輯 - Logic and Bit
. Operations

    .
    Example 21
    .
    Find the bitwise OR, bitwise AND, and bitwise XOR
    of the bit strings 0110110110 and 1100011101.
                     0110110110
                     1100011101
       bitwise OR 1110111111
      bitwise AND 0100010100
    . bitwise XOR 1010101011

                                                           .   .   .       .      .    .

       洪春男          1. The Foundations: Logic and Proofs               March 1, 2011   40 / 41
謝謝大家的聆聽!


                                             .   .   .       .      .    .

洪春男   1. The Foundations: Logic and Proofs               March 1, 2011   41 / 41

More Related Content

What's hot

Predicate Logic
Predicate LogicPredicate Logic
Predicate Logicgiki67
 
Ai lecture 07(unit03)
Ai lecture  07(unit03)Ai lecture  07(unit03)
Ai lecture 07(unit03)vikas dhakane
 
Unit4: Knowledge Representation
Unit4: Knowledge RepresentationUnit4: Knowledge Representation
Unit4: Knowledge RepresentationTekendra Nath Yogi
 
Ai lecture 09(unit03)
Ai lecture  09(unit03)Ai lecture  09(unit03)
Ai lecture 09(unit03)vikas dhakane
 
MACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEMACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEDrBindhuM
 
Truth as a logical connective?
Truth as a logical connective?Truth as a logical connective?
Truth as a logical connective?Shunsuke Yatabe
 
FUZZY LOGIC IN NARROW SENSE WITH HEDGES
FUZZY LOGIC IN NARROW SENSE WITH HEDGESFUZZY LOGIC IN NARROW SENSE WITH HEDGES
FUZZY LOGIC IN NARROW SENSE WITH HEDGESijcsit
 
AI_ 3 & 4 Knowledge Representation issues
AI_ 3 & 4 Knowledge Representation issuesAI_ 3 & 4 Knowledge Representation issues
AI_ 3 & 4 Knowledge Representation issuesKhushali Kathiriya
 
Contexts 4 quantification (CommonSense2013)
Contexts 4 quantification (CommonSense2013)Contexts 4 quantification (CommonSense2013)
Contexts 4 quantification (CommonSense2013)Valeria de Paiva
 
What is knowledge representation and reasoning ?
What is knowledge representation and reasoning ?What is knowledge representation and reasoning ?
What is knowledge representation and reasoning ?Anant Soft Computing
 
AI_ 8 Weak Slot and Filler Structure
AI_ 8 Weak Slot and Filler  StructureAI_ 8 Weak Slot and Filler  Structure
AI_ 8 Weak Slot and Filler StructureKhushali Kathiriya
 
Constructive Description Logics 2006
Constructive Description Logics 2006Constructive Description Logics 2006
Constructive Description Logics 2006Valeria de Paiva
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicPalGov
 
Artificial intelligence and knowledge representation
Artificial intelligence and knowledge representationArtificial intelligence and knowledge representation
Artificial intelligence and knowledge representationSajan Sahu
 
Logical Inference in RTE
Logical Inference in RTELogical Inference in RTE
Logical Inference in RTEKilian Evang
 

What's hot (20)

Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
 
Ai lecture 07(unit03)
Ai lecture  07(unit03)Ai lecture  07(unit03)
Ai lecture 07(unit03)
 
Reasoning in AI
Reasoning in AIReasoning in AI
Reasoning in AI
 
Unit4: Knowledge Representation
Unit4: Knowledge RepresentationUnit4: Knowledge Representation
Unit4: Knowledge Representation
 
Ai lecture 09(unit03)
Ai lecture  09(unit03)Ai lecture  09(unit03)
Ai lecture 09(unit03)
 
MACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULEMACHINE LEARNING-LEARNING RULE
MACHINE LEARNING-LEARNING RULE
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Truth as a logical connective?
Truth as a logical connective?Truth as a logical connective?
Truth as a logical connective?
 
FUZZY LOGIC IN NARROW SENSE WITH HEDGES
FUZZY LOGIC IN NARROW SENSE WITH HEDGESFUZZY LOGIC IN NARROW SENSE WITH HEDGES
FUZZY LOGIC IN NARROW SENSE WITH HEDGES
 
AI_ 3 & 4 Knowledge Representation issues
AI_ 3 & 4 Knowledge Representation issuesAI_ 3 & 4 Knowledge Representation issues
AI_ 3 & 4 Knowledge Representation issues
 
Contexts 4 quantification (CommonSense2013)
Contexts 4 quantification (CommonSense2013)Contexts 4 quantification (CommonSense2013)
Contexts 4 quantification (CommonSense2013)
 
AI_6 Uncertainty
AI_6 Uncertainty AI_6 Uncertainty
AI_6 Uncertainty
 
Paola Zizzi
Paola ZizziPaola Zizzi
Paola Zizzi
 
Knowledge representation
Knowledge representationKnowledge representation
Knowledge representation
 
What is knowledge representation and reasoning ?
What is knowledge representation and reasoning ?What is knowledge representation and reasoning ?
What is knowledge representation and reasoning ?
 
AI_ 8 Weak Slot and Filler Structure
AI_ 8 Weak Slot and Filler  StructureAI_ 8 Weak Slot and Filler  Structure
AI_ 8 Weak Slot and Filler Structure
 
Constructive Description Logics 2006
Constructive Description Logics 2006Constructive Description Logics 2006
Constructive Description Logics 2006
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Artificial intelligence and knowledge representation
Artificial intelligence and knowledge representationArtificial intelligence and knowledge representation
Artificial intelligence and knowledge representation
 
Logical Inference in RTE
Logical Inference in RTELogical Inference in RTE
Logical Inference in RTE
 

Similar to Section1-1

ESSLLI2016 DTS Lecture Day 5-2: Proof-theoretic Turn
ESSLLI2016 DTS Lecture Day 5-2: Proof-theoretic TurnESSLLI2016 DTS Lecture Day 5-2: Proof-theoretic Turn
ESSLLI2016 DTS Lecture Day 5-2: Proof-theoretic TurnDaisuke BEKKI
 
Chapter 1: The Foundations: Logic and Proofs
Chapter 1: The Foundations: Logic and ProofsChapter 1: The Foundations: Logic and Proofs
Chapter 1: The Foundations: Logic and ProofsProfSHananeel
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfARMANVERMA7
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)SHUBHAM KUMAR GUPTA
 
First Order Logic
First Order LogicFirst Order Logic
First Order LogicMianMubeen3
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Sabu Francis
 
Lecture 1-3-Logics-In-computer-science.pptx
Lecture 1-3-Logics-In-computer-science.pptxLecture 1-3-Logics-In-computer-science.pptx
Lecture 1-3-Logics-In-computer-science.pptxPriyalMayurManvar
 
Knowledege Representation.pptx
Knowledege Representation.pptxKnowledege Representation.pptx
Knowledege Representation.pptxArslanAliArslanAli
 
Chapter5 slideshare
Chapter5 slideshareChapter5 slideshare
Chapter5 slidesharemanirajan12
 
Logic & critical thinking
Logic & critical thinking Logic & critical thinking
Logic & critical thinking AMIR HASSAN
 
S2 1
S2 1S2 1
S2 1IIUM
 
Discrete Mathematics
Discrete MathematicsDiscrete Mathematics
Discrete MathematicsJihudumie.Com
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agentsMegha Sharma
 
Lean Logic for Lean Times: Varieties of Natural Logic
Lean Logic for Lean Times: Varieties of Natural LogicLean Logic for Lean Times: Varieties of Natural Logic
Lean Logic for Lean Times: Varieties of Natural LogicValeria de Paiva
 
Propositional logic
Propositional logicPropositional logic
Propositional logicchauhankapil
 

Similar to Section1-1 (20)

ESSLLI2016 DTS Lecture Day 5-2: Proof-theoretic Turn
ESSLLI2016 DTS Lecture Day 5-2: Proof-theoretic TurnESSLLI2016 DTS Lecture Day 5-2: Proof-theoretic Turn
ESSLLI2016 DTS Lecture Day 5-2: Proof-theoretic Turn
 
Chapter 1: The Foundations: Logic and Proofs
Chapter 1: The Foundations: Logic and ProofsChapter 1: The Foundations: Logic and Proofs
Chapter 1: The Foundations: Logic and Proofs
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdf
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
First Order Logic
First Order LogicFirst Order Logic
First Order Logic
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1Introduction to logic and prolog - Part 1
Introduction to logic and prolog - Part 1
 
Lecture 1-3-Logics-In-computer-science.pptx
Lecture 1-3-Logics-In-computer-science.pptxLecture 1-3-Logics-In-computer-science.pptx
Lecture 1-3-Logics-In-computer-science.pptx
 
Pnp
PnpPnp
Pnp
 
Knowledege Representation.pptx
Knowledege Representation.pptxKnowledege Representation.pptx
Knowledege Representation.pptx
 
Chapter5 slideshare
Chapter5 slideshareChapter5 slideshare
Chapter5 slideshare
 
Logic & critical thinking
Logic & critical thinking Logic & critical thinking
Logic & critical thinking
 
S2 1
S2 1S2 1
S2 1
 
Discrete Mathematics
Discrete MathematicsDiscrete Mathematics
Discrete Mathematics
 
Logic.pdf
Logic.pdfLogic.pdf
Logic.pdf
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
 
Lean Logic for Lean Times: Varieties of Natural Logic
Lean Logic for Lean Times: Varieties of Natural LogicLean Logic for Lean Times: Varieties of Natural Logic
Lean Logic for Lean Times: Varieties of Natural Logic
 
01bkb04p.ppt
01bkb04p.ppt01bkb04p.ppt
01bkb04p.ppt
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
4.pdf
4.pdf4.pdf
4.pdf
 

Recently uploaded

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

Section1-1

  • 1. . Preface 目標 這門課應該教導同學如何用邏輯與數學 來思考 (how to think logically and mathematically)。 內容 包括五個部份:mathematical reasoning(數學推理)、combinatorial analysis(組合分析)、discrete structure(離散結構)、algorithmic thinking(演算法的思考)、applications and modeling(應用與模型) . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 1 / 41
  • 2. . 教材 課本 Discrete Mathematics and its Applications(sixth edition), Kenneth H. Rosen 參考書籍 離散數學 (Discrete Mathematics and its Applications 中譯本) sixth edition, 謝良 瑜陳志賢譯 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 2 / 41
  • 3. . 自我介紹 姓名 洪春男 email spring@mail.dyu.edu.tw 電話 04-8511888 轉 2410 辦公室 工學院 H311 Homepage http://www.dyu.edu.tw/ spring . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 3 / 41
  • 4. . 評分標準 期中考 20% 期末考 30% 平常分數 50%(點名與隨堂測驗、作業、平常考 大約各佔 1/3) . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 4 / 41
  • 5. . Contents 1. The Foundations: Logic and Proofs(1.1-1.7) . 2 Basic Structures: Sets, Functions, Sequences, and Sums(2.1-2.4) 3. The Fundamentals: Algorithms, the Integers, and Matrices(3.1-3.5, 3.8) 4. Induction and Recursion(4.1-4.3) . 5 Counting(5.1-5.3) 6. Discrete Probability(6.1) . 7 Advanced Counting Techniques(7.1, 7.5) . 8 Relations(8.1, 8.3, 8.5) 9. Graphs(9.1-9.5) . 10 Trees(10.1) . Boolean Algebra 11 . 12 Modeling Computation . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 5 / 41
  • 6. . 1. The Foundations: Logic and Proofs Logic is the basis of all mathematical reasoning, and of all automated reasoning. 邏輯是所有數 學推理與自動推理的基礎。 To understand mathematics, we must understand what makes up a correct mathematical argument, that is, a proof. 要了 解數學,必須了解建構正確的數學論證,也 就是證明。 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 6 / 41
  • 7. . 1.1 Propositional Logic 命題邏輯 A proposition is a declarative sentence(that is, a sentence that declares a fact) that is either true or false, but not both. 命題是一個述句 (宣告事實的句子),它可能是真、也可能是 假,但不能旣真又假。 . Example 1 . 1. Washington, D.C., is the capital of the United States of America. 華盛頓特區是美國首都。 2. Toronto is the capital of Canada. 多倫多是加 拿大首都。 3. 1 + 1 = 2. 4. 2 + 2 = 3. . 洪春男 . . 1. The Foundations: Logic and Proofs . . . March 1, 2011 . 7 / 41
  • 8. . 1.1 Propositional Logic 命題邏輯 . Example 2 . 下列是錯誤的 propositions 1. What time is it? 現在幾點? 2. Read this carefully. 小心閱讀。 3. x + 1 = 2. . . x + y = z. 4 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 8 / 41
  • 9. . 1.1 Propositional Logic 命題邏輯 propositional variables 命題變數, p, q, r, s, · · · truth value: T(真)、F(假) The area of logic that deals with propositions is called the propositional calculus or propositional logic. 專門處理命題的邏輯稱 為命題演算或命題邏輯,亞里斯多德 (Aristotle) 最早開始使用。 New propositions, called compound propositions, are formed from existing propositions using logical operators. 由已存在 的命題加上邏輯運算子形成新的命題,稱為 複合命題。 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 9 / 41
  • 10. . 1.1 Propositional Logic 命題邏輯 . Definition 1 . Let p be a proposition. The negation of p, denoted by ¬p(also denoted by p), is the statement “It is not the case that p.” The proposition ¬p is read “not p”. The truth value of the negation of p, ¬p, is the opposite of the truth value of p. 令 p 為一命題, p 的否定句為「p 不成立」 ,以 ¬p 表示 (有時也用 p 表示)。 ¬p 讀作「非 p」 , 其真假值與 p 的真假值剛好相反。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 10 / 41
  • 11. . 1.1 Propositional Logic 命題邏輯 . Example 3 . Find the negation of the proposition “Today is Friday.” and express this in simple English. 找出「今天是星期五」的否定命題,且用簡單的 英文表示。 “It is not the case that today is Friday.” “Today is not Friday.” “It is not Friday today.” 「今天是星期五不成立」或「今天不是星期五」 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 11 / 41
  • 12. . 1.1 Propositional Logic 命題邏輯 . Example 4 . Find the negation of the proposition “At least 10 inches of rain fell today in Miami.” and express this in simple English. 找出「邁阿密今天至少下 10 英吋的雨」的否定 命題,且用簡單的英文表示。 “It is not the case that at least 10 inches of rain fell today in Miami.” “Less than 10 inches of rain fell today in Miami.” 「邁阿密今天至少下 10 英吋的雨不成立」或 「邁阿密今天下不到 10 英吋的雨」 . 。 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 12 / 41
  • 13. . 1.1 Propositional Logic 命題邏輯 . Definition 2 . Let p and q be propositions. The conjunction of p and q, denoted by p ∧ q, is the proposition “p and q.”. The conjunction p ∧ q is true when both p and q are true and is false otherwise. 令 p 與 q 都是命題, p 與 q 同時發生為「p 和 q」 ,記成 p ∧ q,當 p 與 q 都是真時 p ∧ q 為真, 否則為假。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 13 / 41
  • 14. . 1.1 Propositional Logic 命題邏輯 . Example 5 . Find the conjunction of the propositions p and q where p is the proposition “Today is Friday” and q is the proposition “It is raining today”. 令命題 p 為「今天是星期五」 ,命題 q 為「今天 下雨」 ,請找出 p 與 q 的 conjunction。 “Today is Friday and it is raining today.” 「今天是星期五且下雨」 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 14 / 41
  • 15. . 1.1 Propositional Logic 命題邏輯 . Definition 3 . Let p and q be propositions. The disjunction of p and q, denoted by p ∨ q, is the proposition “p or q.”. The disjunction p ∨ q is false when both p and q are false and is true otherwise. 令 p 與 q 都是命題, p 與 q 的分裂為「p 或 q」 ,記成 p ∨ q,當 p 與 q 都是假時 p ∨ q 為假, 否則為真。 . or 有 inclusive 與 exclusive 的分別, ∨ 是 inclusive。 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 15 / 41
  • 16. . 1.1 Propositional Logic 命題邏輯 . Example 6 . What is the disjunction of the propositions p and q where p and q are the same propositions as in Example 5. 令命題 p 為「今天是星期五」 ,命題 q 為「今天 下雨」 ,請問 p 與 q 的 disjunction。 “Today is Friday or it is raining today.” 「今天是星期五或今天下雨」 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 16 / 41
  • 17. . 1.1 Propositional Logic 命題邏輯 . Definition 4 . Let p and q be propositions. The exclusive or of p and q, denoted by p ⊕ q, is the proposition that is true when exactly one of p and q is true and is false otherwise. 令 p 與 q 都是命題, p 與 q 的互斥或,記成 p ⊕ q,當 p 與 q 恰為一真一假時 p ⊕ q 為真,否 則為假。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 17 / 41
  • 18. . 1.1 Propositional Logic 命題邏輯 The truth table 真值表 p q ¬p p ∧ q p ∨ q p ⊕ q T T F T T F T F F F T T F T T F T T F F T F F F . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 18 / 41
  • 19. . 1.1 Propositional Logic 命題邏輯 . Definition 5 . Let p and q be propositions. The conditional statement p → q is the proposition “if p, then q.” The conditional statement p → q is false when p is true and q is false, and true otherwise. In the conditional statement p → q, p is called the hypothesis(or antecedent or premise) and q is called the conclusion(or consequence). 令 p 與 q 都是命題,條件句 p → q 代表「若 p 則 q」的命題。當 p 真 q 假時,條件句 p → q 為 假,否則為真。其中 p 稱為假設 (或前提)、而 q 稱為結論。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 19 / 41
  • 20. . 1.1 Propositional Logic 命題邏輯 A conditional statement is also called an implication. 條件句有時也稱為隱涵。 下列都是「若 p 則 q」的寫法: p, then 「if q」 「p implies q」 「if p, q」, 「p only if q」, 、 、 「p is sufficient for q」, 「a sufficient condition for q is p」, 「q if p」, 「q whenever p」, 「q when p」 「q is necessary for p」 「a necessary 、 、 condition for p is q」 「q follows from p」 「q 、 、 unless ¬p」 “If I am elected, then I will lower taxes.” 若我當 選就減稅。 “If you get 100% on the final, then you will get an A.” 期末考 100 分就得 A。 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 20 / 41
  • 21. . 1.1 Propositional Logic 命題邏輯 . Example 7 . Let p be the statement “Maria learns discrete mathematics” and q the statement “Maria will find a good job.” Express the statement p → q as a statement in English. 令 p 是「瑪麗亞學離散數學」 q 為「瑪麗亞將 , 找到好工作」 ,請用英文表達 p → q。 “If Maria learns discrete mathematics, then she will find a good job.”,「若瑪麗亞學離散數學,她將 找到好工作」 ,“Maria will find a good job when she learns discrete mathematics.”,“Maria will find a good job unless she does not learn discrete mathemathics.” . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 21 / 41
  • 22. . 1.1 Propositional Logic 命題邏輯 “If it is sunny today, then we will go to the beach.” 若今天出太陽,我們將去海邊玩。 “If today is Friday, then 2 + 3 = 5.” 若今天是 星期五,則 2 + 3 = 5。 “If today is Friday, then 2 + 3 = 5.” 若今天是 星期五,則 2 + 3 = 6。 前題與結果未必需要有因果關係。 . Example 8 . if 2 + 2 = 4 then x := x + 1. 若在這個 statement 之前 x = 0 的話,執行之後 x 的值是多少? . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 22 / 41
  • 23. . 1.1 Propositional Logic 命題邏輯 The proposition q → p is called the converse (相反) of p → q. The contrapositive (對換) of p → q is the proposition ¬q → ¬p. The proposition ¬p → ¬q is called the inverse (相反) of p → q. When two compound propositions always have the same truth value we call them equivalent. . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 23 / 41
  • 24. . 1.1 Propositional Logic 命題邏輯 . Example 9 . What are the contrapositive, the converse, and the inverse of the conditional statement “The home team wins whenever it is raining.”? 每 當下雨時地主隊獲勝。 contrapositive “If the home team doesn’t win, then it is not raining.” 若地主隊沒贏就沒有下雨。 converse “If the home team wins, then it is raining.” 若地主隊贏就下雨 inverse “If it is not raining, then the home team doesn’t win.” 若沒下雨地主隊就沒贏。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 24 / 41
  • 25. . 1.1 Propositional Logic 命題邏輯 . Definition 6 . Let p and q be propositions. The biconditional statement p ↔ q is the proposition “p if and only if q.” The biconditional statement p ↔ q is true when p and q have the same truth values, and is false otherwise. Biconditional statements are also called bi-implications. 令 p 與 q 都是命題,雙條件句 p ↔ q 代表「p 若 且唯若 q」的命題。當 p 與 q 有相同真假值時, 雙條件句 p ↔ q 為真,否則為假。雙條件句又稱 為雙蘊涵。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 25 / 41
  • 26. . 1.1 Propositional Logic 命題邏輯 當 p → q 與 q → p 都是 true 時 p ↔ q 才為 true。 「p is necessary and sufficient for q」 「if p 、 then q, and conversely」 「p iff q」都是 p ↔ q 、 的意思。iff 是 if and only if 的縮寫。 . Example 10 . Let p be the statement “You can take the flight” and let q be the statement “You buy a ticket.” Then p ↔ q is the statement “You can take the flight if and only if you buy a ticket.” . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 26 / 41
  • 27. . 1.1 Propositional Logic 命題邏輯 The truth table 真值表 p q p → q q → p ¬q → ¬p ¬p → ¬q p ↔ q T T T T T T T T F F T F T F F T T F T F F F F T T T T T . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 27 / 41
  • 28. . 1.1 Propositional Logic 命題邏輯 . Example 11 . Construct the truth table of the compound proposition (p ∨ ¬q) → (p ∧ q). . p q ¬q p ∨ ¬q p ∧ q (p ∨ ¬q) → (p ∧ 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 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 28 / 41
  • 29. . 1.1 Propositional Logic 命題邏輯 Precedence of Logical Operators 邏輯運算子的優先順序 Operator Precedence ¬ 1 ∧ 2 ∨ 3 → 4 ↔ 5 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 29 / 41
  • 30. . 1.1 Propositional Logic 命題邏輯 . Example 12 . How can this English sentence be translated into a logical expression? “You can access the Internet from campus only if you are a computer science major or you are not a freshman.” 只有當你主修電腦或不是新鮮人,才能在校園中 使用網路 a 代表 “You can access the Internet from campus.” c 代表 “You are a computer science major.” f 代表 “You are a freshman.” 前面的句字可翻譯為 a → (c ∨ ¬f) . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 30 / 41
  • 31. . 1.1 Propositional Logic 命題邏輯 . Example 13 . How can this English sentence be translated into a logical expression? “You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old.” 若你不到 4 英呎高就不能坐雲霄飛車,除非你超 過 16 歲。 q 代表 “You can ride the roller coaster.” r 代表 “You are under 4 feet tall.” s 代表 “You are older than 16 years old.” 前面的句字可翻譯為 (r ∧ ¬s) → ¬q . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 31 / 41
  • 32. . 1.1 Propositional Logic 命題邏輯 . Example 14 . Express the specification “The automated reply cannot be sent when the file system is full” using logical connectives. 使用邏輯連詞表達下列規 定: 「當檔案系統滿了,自動回覆功能不能被送 出」 。 p 代表 “The automated reply can be sent.” q 代表 “The file system is full.” 前面的句字可翻譯為 q → ¬p . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 32 / 41
  • 33. . 1.1 Propositional Logic 命題邏輯 . Example 15 . Determine whether these system specifications are consistent: “The diagnostic message is stored in the buffer or it is retransmitted.” “The diagnostic message is not stored in the buffer.” “If the diagnostic message is stored in the buffer, then it is retransmitted.” p 代表 “The diagnostic message is stored in the buffer.” q 代表 “The diagnostic message is retransmitted.” 前面三個句字為 p ∨ q, ¬p, p → q,當 p 為 F 而 q 為 T 時,三個句子都成立,因此 consistent。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 33 / 41
  • 34. . 1.1 Propositional Logic 命題邏輯 . Example 16 . Do the system specifications in Example 15 remain consistent if the specification “The diagnostic message is not retransmitted” is added? p 代表 “The diagnostic message is stored in the buffer.” q 代表 “The diagnostic message is retransmitted.” 四個句字為 p ∨ q, ¬p, p → q, ¬q,顯然無法使四 個句子都為 true,因此不 consistent。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 34 / 41
  • 35. . 1.1 Propositional Logic 命題邏輯 - boolean searches 可在搜尋引擎中輸入下列關鍵字,看看結果如何 . Example 17 . New and Mexico and University「New Mexico University」 (New and Mexico or Arizona) and University (Mexico and Universities) not New 「Mexico Universities -New」 大葉 -高島屋 大葉資訊 -資管 -會計 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 35 / 41
  • 36. . 1.1 Propositional Logic 命題邏輯 - Logic Puzzles . Example 18 . An island that has two kinds of inhabitants(居民), knights(騎士),who always tell the truth, and their opposites, knaves(無賴), who always lie. You encounter 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”? . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 36 / 41
  • 37. . 1.1 Propositional Logic 命題邏輯 - Logic Puzzles 答案:Both A and B are knaves. . Example 19 . 兩個兄妹在後院玩,兩人的前額都沾了泥巴,父 親說: 「你們兩人中至少一人前額有泥巴。 」父親 問: 「你知道你自己的前額有沒有沾泥巴呢?」 父親問兩次,請問兩個小朋友會如何回答?假設 小朋友可看到另一人的前額、看不到自己的前 額,且都說實話,兩人只能回答 Yes / No。 . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 37 / 41
  • 38. 1.1 Propositional Logic 命題邏輯 - Logic and Bit . Operations 答案:第一次都回答 NO,第二次都是 Yes。 A bit is a symbol with two possible values, namely, 0(zero) and 1(one). 可代表 true(1) 與 false(0)。 A variable is called a Boolean variable if its value is either true or false. . Definition 7 . A bit string is a sequence of zero or more bits. The length of this string is the number of bits in the string. . . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 38 / 41
  • 39. 1.1 Propositional Logic 命題邏輯 - Logic and Bit . Operations . Example 20 . 101010011 is a bit string of length nine. . We define the bitwise OR, bitwise AND, and bitwise XOR of two strings of the same length to be the strings that have as their bits the OR, AND, and XOR of the corresponding bits in the two strings, respectively. . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 39 / 41
  • 40. 1.1 Propositional Logic 命題邏輯 - Logic and Bit . Operations . Example 21 . Find the bitwise OR, bitwise AND, and bitwise XOR of the bit strings 0110110110 and 1100011101. 0110110110 1100011101 bitwise OR 1110111111 bitwise AND 0100010100 . bitwise XOR 1010101011 . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 40 / 41
  • 41. 謝謝大家的聆聽! . . . . . . 洪春男 1. The Foundations: Logic and Proofs March 1, 2011 41 / 41