CSCI 2824: Lecture 5 NotesToday's lecture:
QuantifiersWe have already seen two types of quantifiers in the previous lecture:
Truth and QuantifiersThe rule for determining the truth of a quantified statement is really simple.
Pseudo Code For Checking Exists-Formulae
/* Checking (Exists x IN S) P */ for each x IN set S, { result := CHECK P[x]; if ( result is TRUE) then return TRUE; } /* We have gone through all values in S and they all do not satisfy P */ return FALSE;
Pseudo Code For Checking Forall-Formulae
/* Checking (Forall x IN S) P */ for each x IN set S, { result := CHECK P[x]; if ( result is FALSE) then return FALSE; } /* We have gone through all values in S and all satisfy P */ return TRUE; Formulas with Multiple QuantifiersFormulas with multiple quantifiers can be often tricky and the order of quantification matters . Let We ask whether the following formula is true: Let us run our checking algorithm. The outermost quantifier is a forall. Therefore, we plugin each value of
Has the inner formula Now let us try this formula: This is the same formula but with the quantifiers reversed. Does it mean the same as Once again, we run our checking algorithm. The outermost quantifier is an
Is there indeed a value of Negating FormulasLet us start by negating formulas without quantifiers. ExampleWhat is the negation of ( Answer: We start by writing Therefore, we get The answer is therefore Note the following table of negations for arithmetic predicates:
Negation with QuantifiersNow we consider negation with quantifier. Proposition 1 in Page 45 of the book is the key rule here.
Let us try some examples. ExampleNegate the formula: Let us do it step by step: Is the negation true for the set Yes, there is indeed Now let us try a formula with existential quantifier: ImplicationsImplications are a very important concept that needs to be understood thoroughly to move forward in this course. What is an implication? Simply answer is any if.. then.. statement.
We write implications as
Example:
Practice Problem 1 in page 54 talks about writing down statements as implications. Example: If a triangle has three sides then it has three equal angles. We recast it as: for all triangles Example: If an integer is its own square then it is either Recast it as: For all integers Logic of ImplicationsTruth Table for Implication: We noted earlier that
Note: An implication ExampleThe law says: If you are drinking alcoholic beverages, then you must be over 21 years of age. Let us analyze the various scenarios:
In other words, the implication is true no matter what if ExampleConsider the statement: For every integer The statement is of the form
As you try a lot of choices, you see that it is NEVER the case where |