+ All Categories
Home > Documents > Review: Potential stumbling blocks…people.cs.pitt.edu/~litman/courses/cs441/lecture6.pdf · 2010....

Review: Potential stumbling blocks…people.cs.pitt.edu/~litman/courses/cs441/lecture6.pdf · 2010....

Date post: 12-Feb-2021
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
15
Review: Potential stumbling blocks… Whether the negation sign is on the inside or the outside of a quantified statement makes a big difference! Example: Let T(x) “x is tall”. Consider the following: ¬ x T(x) “It is not the case that all people are tall.” x ¬T(x) “For all people x, it is not the case that x is tall.” Note: ¬ x T(x) = x ¬T(x) x ¬T(x) Recall: When we push negation into a quantifier, DeMorgan’s law says that we need to switch the quantifier! Review: Potential stumbling blocks… Let: C(x) “x is enrolled in CS441” S(x) “x is smart.” Question: The following two statements look the same, what’s the difference? x [C(x) S(x)] x [C(x) S(x)] Subtle note: The second statement is true if there exists even one smart person on Earth, because FT. There exists a student x such that if x is in CS441, then x is smart. There is a smart student in CS441.
Transcript
  • Review: Potential stumbling blocks…

    Whether the negation sign is on the inside or the outside of

    a quantified statement makes a big difference!

    Example: Let T(x) ≡ “x is tall”. Consider the following:

    � ¬ ∀ x T(x)

    � “It is not the case that all people are tall.”

    � ∀ x ¬T(x)

    � “For all people x, it is not the case that x is tall.”

    Note: ¬ ∀ x T(x) = ∃ x ¬T(x) ≠ ∀ x ¬T(x)

    Recall: When we push negation into a quantifier, DeMorgan’s law says that we need to switch the quantifier!

    Review: Potential stumbling blocks…

    Let: C(x) ≡ “x is enrolled in CS441”

    S(x) ≡ “x is smart.”

    Question: The following two statements look the same, what’s the difference?

    � ∃ x [C(x) ∧∧∧∧ S(x)]

    � ∃ x [C(x) → S(x)]

    Subtle note: The second statement is true if there exists even one smart person on Earth, because F→T.

    There exists a student x such that if x is in CS441, then x is

    smart.

    There is a smart student in CS441.

  • Review: Translation

    � Suppose:

    � Variables x,y denote people

    � L(x,y) denotes "x loves y"

    � Translate:

    � Everybody loves Raymond

    � Everybody loves somebody.

    � There is somebody whom everybody loves.

    � There is somebody who Raymond doesn't love.

    � There is somebody whom no one loves.

    � Everybody loves himself.

    Review: Evaluate

    � Domain of discourse = positive integers.

    � Let Q(x,y) denote x*x = 2*y

    � Let T(x,y) denote x^2 = x*y

    � Q(4,8)

    � ∃x Q(x,50)

    � ∀x Q(x,x)

    � ∃x ∃y Q(x,y)

    � ∃x ∀y Q(x,y)

    � ∀x ∃y Q(x,y)

    � ∀x ∀y Q(x,y)

  • Today’s topic

    � Rules of inference

    What have we learned? Where are we going?

    Propositional logic (representation)

    Predicate logic (refined

    representation) Quantifiers (generalization)

    Inference and proof (deriving new knowledge!)

  • Writing valid proofs is a subtle art

    Step 1: Discover and

    formalize the property

    that you wish to prove Step 2: Formalize the ground truths

    (axioms) that you will use to prove

    this property

    Step 3: Show that the property in

    question follows from the truth of

    your axioms

    This is called

    “research”

    Subtle, but not terribly difficult

    Oh, the errors you will make ☺☺☺☺

    What is science without jargon?

    A conjecture is a statement that is thought to be true.

    A proof is a valid argument that establishes the truth

    of a given statement (i.e., a conjecture)

    After a proof has been found for a given conjecture, it

    becomes a theorem

    A sequence of statements ending with a conclusion

    The truth of the conclusion

    follows from the truth of the preceding statements

  • A tale of two proof techniques

    In a formal proof, each step of

    the proof clearly follows from

    the postulates and axioms

    assumed in the conjecture.

    In an informal proof, one step in

    the proof may consist of

    multiple derivations, portions of

    the proof may be skipped or

    assumed correct, and axioms

    may not be explicitly stated.

    Statements that are assumed to be true

    Consider the following argument:

    “If you have an account, you can access the network”

    “You have an account”

    Therefore,

    “You can access the network”Premises

    Conclusion

    This argument seems valid, but how can we

    demonstrate this formally??

    How can we formalize an argument?

  • Let’s analyze the form of our argument

    “If you have an account, then you can access the network”

    “You have an account”

    Therefore,

    “You can access the network”

    p → q

    p

    ∴ q

    This is called a

    “rule of inference”

    p q

    Rules of inference allow us to make valid arguments

    � Many times, we can determine whether an

    argument is valid by using a truth table, but this is

    often a cumbersome approach

    � Instead, we can apply a sequence of rules of

    inference to draw valid conclusions from a set of

    premises

    p → q

    p

    ∴ q

  • Let’s analyze the form of our argument

    “If you have an account, you can access the network”

    “You have an account”

    Therefore,

    “You can access the network”p → q

    p

    ∴ qThis form is equivalent to the statement

    ((p → q) ∧∧∧∧ p) → q

    Since ((p → q) ∧∧∧∧ p) → q is a tautology, we

    know that our argument is valid!

    Rules of inference are logically valid ways to draw

    conclusions when constructing a formal proof

    The previous rule is called modus ponens

    � Rule of inference:

    � Informally: Given an implication p → q, if we know that p

    is true, then q is also true

    But why can we trust modus ponens?

    � Tautology: ((p → q) ∧∧∧∧ p) → q

    � Truth table:

    p → q

    p

    ∴ q

    p q p→q

    T T T

    T F F

    F T T

    F F T

    Any time that p→q

    and p are both true, q is also true!

  • There are lots of other rules of inference that

    we can use!

    Addition

    � Tautology: p → (p V q)

    � Rule of inference:

    � Example: “It is raining now, therefore it is raining now or

    it is snowing now.”

    Simplification

    � Tautology: p ∧∧∧∧ q → p

    � Rule of inference:

    � Example: “It is cold outside and it is snowing. Therefore, it

    is cold outside.”

    p

    ∴ p V q

    p ∧ q

    ∧ p

    There are lots of other rules of inference that

    we can use!Modus tollens

    � Tautology: [¬q ∧∧∧∧ (p → q)] → ¬p

    � Rule of inference:

    � Example: “If I am hungry, then I will eat. I am not eating.

    Therefore, I am not hungry.”

    Hypothetical syllogism

    � Tautology: [(p → q) ∧∧∧∧ (q → r)] → (p → r)

    � Rule of inference:

    � Example: “If I eat a big meal, then I feel full. If I feel full,

    then I am happy. Therefore, if I eat a big meal, then I am

    happy.”

    p → q

    ¬q

    ∧ ¬p

    (p → q)

    (q → r)

    ∧ (p → r)

  • There are lots of other rules of inference that

    we can use!Disjunctive syllogism

    � Tautology: [¬p ∧∧∧∧ (p V q)] → q

    � Rule of inference:

    � Example: “Either the heat is broken, or I have a fever.

    The heat is not broken, therefore I have a fever.”

    Conjunction

    � Tautology: [(p) ∧∧∧∧ (q)] → (p ∧∧∧∧ q)

    � Rule of inference:

    � Example: “Jack is tall. Jack is skinny. Therefore, Jack is

    tall and skinny.”

    p ∧ q

    ¬p

    ∧ q

    p

    q

    \ (p ∧ q)

    There are lots of other rules of inference that

    we can use!Resolution

    � Tautology: [(p V q) ∧∧∧∧ (¬p V r)] → (q V r)

    � Rule of inference:

    � Example: “If it is not raining, I will ride my bike. If it is

    raining, I will lift weights. Therefore, I will either ride my

    bike or lift weights”

    Special cases:

    1. If r = q, we get

    2. If r = F, we get

    p ∧ q

    ¬p ∧ r

    ∧ q ∧ r

    p ∧ q

    ¬p ∧ q

    ∧ q

    p ∧ q

    ¬p

    ∧ q

  • We can use rules of inference to build valid arguments

    If it is raining, I will stay inside. If am inside,

    Stephanie will come over. If Stephanie comes over

    and it is a Saturday, then we will play Scrabble. Today

    is Saturday. It is raining.

    Let:

    � r ≡ It is raining

    � i ≡ I am inside

    � s ≡ Stephanie will come over

    � c ≡ we will play Scrabble

    � a ≡ it is Saturday

    Hypotheses:

    � r → i

    � i → s

    � s ∧ a → c

    � a

    � r

    We can use rules of inference to build valid arguments

    Let:

    � r ≡ It is raining

    � i ≡ I am inside

    � s ≡ Stephanie will come over

    � c ≡ we will play Scrabble

    � a ≡ it is Saturday

    Step:

    1. r → i hypothesis

    2. i → s hypothesis

    3. r → s hypothetical syllogism with 1 and 2

    4. r hypothesis

    5. s modus ponens with 3 and 4

    6. a hypothesis

    7. s ∧∧∧∧ a conjunction of 5 and 6

    8. s ∧∧∧∧ a → c hypothesis

    9. c modus ponens with 7 and 8

    Hypotheses:

    � r → i

    � i → s

    � s ∧∧∧∧ a → c

    � a

    � r

    I will playScrabble!

  • We also have rules of inference for statements

    with quantifiers

    Universal Instantiation

    � Intuition: If we know that P(x) is true for all x, then P(c) is

    true for a particular c

    � Rule of inference:

    Universal Generalization

    � Intuition: If we can show that P(c) is true for an arbitrary c,

    then we can conclude that P(x) is true for any x

    � Rule of inference:

    ∧x P(x)

    ∧ P(c)

    P(c)

    ∧ ∧xP(x)

    Note that “arbitrary” does not mean “randomly chosen.” It means that we cannot make any

    assumptions about c other than the fact that it comes

    from the appropriate domain.

    We also have rules of inference for statements

    with quantifiers

    Existential Instantiation

    � Intuition: If we know that ∃ P(x) is true, then we know that

    P(c) is true for some c

    � Rule of inference:

    Existential Generalization

    � Intuition: If we can show that P(c) is true for a particular c,

    then we can conclude that ∃ P(x) is true

    � Rule of inference:

    ∧x P(x)

    ∧ P(c)

    P(c)

    ∧ ∧xP(x)

    Again, we cannot make assumptions about c other

    than the fact that it exists and is from the appropriate domain.

  • Hungry dogs redux

    Given: All of my dogs like peanut butter

    Given: Kody is one

    of my dogs

    M(x) P(x)

    1. ∀ x [M(x) → P(x)] hypothesis

    2. M(Kody) hypothesis

    3. M(Kody) → P(Kody) universial instantiation from 1

    4. P(Kody) modus ponens from 2 and 3

    M(Kody)

    Reasoning about our class

    Show that the premises “A student in this class has not

    read the book” and “everyone in this class turned in

    HW1” imply the conclusion “Someone who turned in

    HW1 has not read the book.”

    Let:

    � C(x) ≡ x is in this class

    � B(x) ≡ x has read the book

    � T(x) ≡ x turned in HW1

    Premises:

    � ∃ x [C(x) ∧∧∧∧ ¬B(x)]

    � ∀ x [C(x) → T(x)]

  • Reasoning about our class

    Let:

    � C(x) ≡ x is in this class

    � B(x) ≡ x has read the book

    � T(x) ≡ x turned in HW1

    Steps:

    1. ∃ x [C(x) ∧∧∧∧ ¬B(x)]hypothesis

    2. C(a) ∧∧∧∧ ¬B(a) existential instantiation from 1

    3. C(a) simplification from 2

    4. ∀ x [C(x) → T(x)]hypothesis

    5. C(a) → T(a) universal instantiation from 4

    6. T(a) modus ponens from 5 and 3

    7. ¬B(a) simplification from 2

    8. T(a) ∧∧∧∧ ¬B(a) conjunction of 6 and 7

    9. ∃ x [T(x) ∧∧∧∧ ¬B(x)]existential generalization from 8

    Premises:

    � ∃ x [C(x) ∧∧∧∧ ¬B(x)]

    � ∀ x [C(x) → T(x)]

    Group work!

    Problem 1: Which rules of inference were used to

    make the following arguments?

    � Kangaroos live in Australia and are marsupials. Therefore,

    kangaroos are marsupials.

    � Linda is an excellent swimmer. If Linda is an excellent

    swimmer, then she can work as a lifeguard. Therefore,

    Linda can work as a lifeguard.

    Problem 2: Show that the premises “Everyone in this

    discrete math class has taken a course in computer

    science” and “Melissa is a student in this discrete

    math class” lead to the conclusion “Melissa has taken

    a course in computer science.”

  • We can’t always use formal proof techniques

    Result: Most mathematical proofs are actually constructed using informal proof techniques!

    Formal proofs are precise

    and “easy” for machines

    to construct…

    … but are often tedious for

    humans to construct,

    interpret, or verify.

    Another Example

    � 1. It is not sunny this afternoon and it is colder than

    yesterday.

    � 2. We will go swimming only if it is sunny.

    � 3. If we do not go swimming then we will take a

    canoe trip.

    � 4. If we take a canoe trip, then we will be home by

    sunset.

    � Prove: We will be home by sunset.

  • What are the characteristics of an informal proof?

    In an informal proof

    � The statements making up the proof are typically not

    written in any formal language (e.g., propositional logic)

    � Steps of the proof and derivations are often argued using

    English or mathematical formulas

    � Multiple derivations may occur in a single step

    � Axioms are often not all stated up front

    As a result, it is sometimes easy to make mistakes

    writing informal proofs.

    Final Thoughts

    � Until today, we had look at representing different

    types of logical statements

    � Rules of inference allow us to derive new results by

    reasoning about known truths

    � Next lecture: � Proof techniques


Recommended