資工系必修 共筆
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ###### tags: `離散數學` :::info [回共筆首頁](https://hackmd.io/zrsmsRtEQ-OrnGslDxT0NQ) [回科目首頁](https://hackmd.io/OwMjUy0fRq2kEuCRiMwtkQ) ::: # 1. The Foundations: Logic and Proofs ## Section 1.1: Propositional Logic ### Propositions - A proposition is a declarative sentence that is **either true or fales**.有明確的真假值,才會說這個狀況是Proposition。 - Propositional Logic - Compound Propositions - Negation ($\neg$): NOT - Conjunction ($\land$): AND - Disjunction ($\lor$): OR - Implication ($\implies$): If p, then q. - Biconditional ($\iff$): p if and only if q. 若且唯若,兩個都成立,或是兩個都不成立 #### Implication Example: "If you get 100% on the final, then you will get an A." 假如你得到100 => 你就會拿A => T 假如你得到100 => 你沒有拿到A => F (在說謊) 假如你沒有得到100 => ?(不重要) => T (不管結果如何,因為前提沒有成立,都還是對的) :::danger - if p, then q - if p, q - q unless (not)p - q if p - q whenever p - q follows from p - p implies q - p only if q - q when p - p is sufficient for q - q is necessary for p - a necessary condition for p is q - a sufficient condition for q is p ::: ### Connectives ### Truth Tables ## Section 1.2: Applications of Propositional Logic ### Consistent - Definition: A list of propositions is **consustent** if it is possible to assign truth value to proposition varibales so that each **proposition is true**. - 跟Satisfiable不同的地方是,Consistent是全部狀況都為True,Satisfiable是只有一個為真。 ### Logic Puzzle - 一個城裡也兩種人,knights騎士,knaves惡棍,騎士只講實話,惡棍只講謊話 - 有A跟B兩人 - A說:「B是騎士」 - B說:「我跟A相反的人」 - A跟B是哪種人? ## Section 1.3: Propositional Equivalences - tautology => 永遠為真 - contradiction => 永遠為假,矛盾的情況 - contingency => 不是tautology,也不是contradiction,代表有真有假 ### Logically Equivalent :::danger - **$\neg\,$p $\lor$ q** $\equiv$ **p $\implies$ q** - **p $\implies$ q** $\equiv$ **$\neg\,$p $\lor$ q** ::: - De Morgan's Laws - Consistent => **多個**Compound Propositions,有一種情況可以滿足所有的Propositions都為True,則為Consistent。 - Satisfiability => **一個**Compound Proposition,有一種情況可以滿足Proposition為True,則為Satisfiable,反之為Unsatisfiable。 ### 要會證明 ## Section 1.4: Predicates and Quantifiers ### Predicate Logic - Variables: x,y,z - Predicates: P(x), M(x) - Quantifiers: Domain is denoted by ***U*** ### Example of Propositional Functions - Let "x+y=z" be denoted by R(x,y,z) and U(for all three varibles) be the intergers. Find these truth values: - R(2,-1,5) **Solution: F** - R(3,4,7) **Solution: T** - R(x,3,z) **Solution: Not a Proposition** ### Quantifers - To express the meaning of English words includiong all and some: - "All men are Mortal." - "Some cats do not have fun." - The two most important quantifiers are: - **Universal Quantifier**, "For all," symbol: $\forall$ - **Existential Quantifier**, "There exists," symbol: $\exists$ ### Precedence of Quantifiers - The quantifiers $\forall$ and $\exists$ have higher precedence than all the logic operators. ### Translating from English to Logic - "every student in this class has taken a course in Java." - $\forall$x(S(x) $\implies$ J(x)) - 如果有人不是這們課的學生,不管有沒有修過Java課,都不會影響原句的意思,因為只要S(x)成立,就看J(x)成立或不成立,才會影響 - "Some student in this class has taken a course in Java." - $\exists$x(S(x) $\land$ J(x)) ### De Morgan's Laws for Quantifiers - ### $\neg$$\forall$xP(x) $\equiv$ $\exists$x$\neg$P(x) - ### $\neg$$\exists$xP(x) $\equiv$ $\forall$x$\neg$P(x) ## Section 1.5: Nested Quantifiers ### Nested Quantifiers - "Every real number has an inverse" - $\forall x\exists y(x+y = 0)$ - Domains of x and y are the real numbers. ### Quantifications of Two Variables ![](https://i.imgur.com/FUqA1GN.png) ### Questions on Translation from English ![](https://i.imgur.com/ahVF7lv.jpg) ## Section 1.6: Rule of Inference 推論的法則 從前提推出結果 ### Valid Arguments 1. Propoaitional Logic Inference Rules 2. Predicate Logic Inference rules for propositional logic plus additional inference rules to handle variables and quantifiers. :::warning - Propositional Logic 有明確的真假值的敘述 - Prodicate Logic 並沒有馬上看的出來的真假值,但是可以比較好去描述一個subjectc或variable,當帶入特定的值,就會轉變成Propositional。也要去規範Predicate的定義域(Domain) ::: ### Arguments in Propositional Logic - 所有的proposition,除了最後一個以外,都叫做**premises**,最後一個叫做**conclusion** - The arugument is **valid** if the premises imply the conclusion. ### Modus Ponens ![](https://i.imgur.com/GJzpdMW.png =70%x) ### Modus Tollens ![](https://i.imgur.com/XjprXbO.png =70%x) ### Hypothetical Syllogism ![](https://i.imgur.com/NdKJhp9.png =70%x) ### Disjunctive Syllogism ![](https://i.imgur.com/wxjc6RF.png =70%x) ### Addition ![](https://i.imgur.com/snQdVBg.png =70%x) ### Simplification ![](https://i.imgur.com/z862tF8.png =70%x) ### Conjunction ![](https://i.imgur.com/H7mtDIb.png =70%x) ### Resolution ![](https://i.imgur.com/B9Ixz7B.png =70%x) ### Universal Instantiation (UI) ![](https://i.imgur.com/3evMw5O.png =70%x) ### Universal Generalization (UG) ![](https://i.imgur.com/1c3AzUq.png =70%x) ### Exitential Instantiation (EI) ![](https://i.imgur.com/rLSCzsN.png =70%x) ### Exitential Generalization (EG) ![](https://i.imgur.com/sswSHWg.png =70%x) ### Universal Modus Ponens (UI + MP) ![](https://i.imgur.com/kSPX6Yk.png =70%x) ## Section 1.7: Intruduction to Proods ### Definitions - theorem 定理 => 說明某件事是對的 - axioms 公理 - lemma 引理 - corollary 推論 - conjecture 猜測 => 認為是對的,但還沒證明出來 ### Proving Conditional Statements: p->q - Trivial Proof - Vacuous Proof - Direct Proof - Proof by Contraposition = indirect proof - **p $\implies$ q** $\equiv$ **$\neg\,$p $\lor$ q** - Proof by Contradiction 矛盾證法 => 假設前提不成立 ## Section 1.8: Proof Methods and Strategy ### Without Loss of Generality(WLOG) 若兩種情況,令x為這種情況,y令為另外一種情況 且不失一般性(Without Loss of Generality) x, y的假設倒過來時,結果也會成立。 ### Nonconstructive Existence Proofs - assume no c exists which makes $P(c)$ true and derive a **contradiction** - 矛盾證法,假設不存在 ### Proof Strategies for proving: p->q - forward reasoning - backward reasoning ### Counterexamples (反例) 利用反例證明假設不成立

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully