=========================================================================== CSC 165H Preliminary lecture notes for Week 4 Winter 2003/4 =========================================================================== -------------- Vacuously true -------------- In general, if there are no Ps we consider P -> Q true (regardless of whether there are any Qs). Safe: we'll never have a P for it to make a claim about. Useful: we can reason about possible Ps without knowing whether they exist. One day we may stumble across one and then we can apply our reasoning. Also, if we have reasoned that P -> Q, and discover there are no Qs, then there we know there are no Ps. What does this mean for the claim: All employees making over 60K are male? This claim is considered true (although you may consider it misleading!). -------------------------- Existential quantification -------------------------- Another common form of statement, called "existential quantification": There is a certain kind of thing with a certain property. Examples: (1) There is an employee who makes less than 25K. (2) An employee makes more than 100K. Notice how "an" signals quantification differently from before. However, this is very ambiguous so the phrase "some employee" is greatly preferred: (2) Some employee makes more than 100K. Buffy proves (1) is true. (In terms of sets: the set of employees making less than 25K isn't empty.) (2) is false, but no single example disproves it. (In terms of sets: the set of employess making more than 25K is empty.) Like universal quantification, existential quantification can turn an open sentence into a statement. Existential quantification written symbolically as "-]" (a backwards "E" meaning "there Exists"). For example, we can write (1) as follows (from least to most preferred): -] employee, the employee makes less than 25K. -] employee e, e makes less than 25K. Let E = the set of employees. Let L(e) = e makes less than 25K. -] e in E, L(e). Everyday language: There is / exists a / an / some / at least one ... such that / for which ... [For] A / an / some / at least one ... Note: for us, "some" is always _inclusive_, i.e., "some object is a P" is true if every object is a P. When is -] x, p(x) false? When p(x) is false for all x in the domain. In other words, ~ -] x, p(x) is equivalent to \-/ x, ~ p(x). Saying (2) is false is equivalent to saying: Every employee does not make more than 100K. And when is \-/ x, p(x) false? When there exists a counterexample: ~ (\-/ x, p(x)) <=> -] x, ~ p(x). Can restrict domain further, for example: (3) Some female employee makes less than 25K. (4) There exists a male employee making less than 25K. For universal quantification, express the restriction with implication. For existential quantification, use "and". So in general: "Every P is also a Q" becomes \-/ x, P(x) -> Q(x) "Some P is also a Q" becomes -] x, P(x) and Q(x) For example, (3) becomes: -] employee e, e is female and e makes less than 25K. (3) is true because: Buffy is female and Buffy makes less than 25K. (4) is false, because each male employee doesn't make less than 25K: \-/ employees e, e male -> ~ e makes less than 25K. In general: ~ (-] x, p(x) and q(x)) <=> \-/ x, (p(x) -> ~ q(x)) ("there is no P that is a Q" is equivalent to "every P is not a Q"). ~ (\-/ x, p(x) -> q(x)) <=> -] x, (p(x) and ~ q(x)) ("not every P is a Q" is equivalent to "there is some P that is a Q"). -------------------- Repeated Quantifiers -------------------- Many useful properties apply to multiple elements. For example: Let E = employees, I = Integers. For e in E, k in I, (must be clear) let sl(e, k) = e makes salary less than k. For e in E, let f(e) = e is female. Now we can write (3) as: -] x in E, f(x) and sl(x, 25K). Useful when considering various sentences involving various salaries. Even better, use "less than" to make expressions more flexible: For e in E, k in I, let s(e, k) = e makes salary k. Now we can write (3) as any one of these equivalent forms: -] k in I, -] x in E, f(x) and s(x, k) and k < 25K; -] x in E, -] k in I, f(x) and s(x, k) and k < 25K; -] x in E, f(x) and ( -] k in I, s(x, k) and k < 25K ); -] x in E, f(x) and ( -] k in I, k < 25K and s(x, k) ); etc. --- And --- Use "and" to make a sentence that claims two sentences are both true. E.g., (5) The employee makes less than 75K and more than 25K. For Anya this is true, because Anya makes less than 75K AND Anya makes more than 25K. For Buffy this is false, because ~ (Buffy makes more than 75K). Viewing sentences as sets, "and" is the intersection. We write "and" symbolically as "/\". Everyday language often uses "and" to group things, not join sentences: I have a pen and a telephone: group things. -] x, x is a pen /\ -] x, x is a telephone (in the domain of things I have). I have something which is a pen and a telephone: join sentences. -] x, x is a pen /\ x is a telephone. The solutions are: x < 10 and x > 20. x > 10 and x < 20. Really means union for the 1st case and intersection for the 2nd. (Otherwise, you'd expect us to write {} and R, respectively.) We only use /\ for joining _sentences_, so it's unambiguous. -- Or -- Use "or" to make a sentence that claims at least one of two sentences is true. E.g., (6) The employee is female or (the employee) makes less than 45K. For Anya (6) is true, because Anya is female. For Buffy (6) is true, because Buffy is female. (Also true for Buffy because Buffy makes less than 45K.) For Xander (6) is false, because: (~ Xander is female) /\ (~ Xander makes less than 45K). Viewing sentences as sets, "or" is the union. Note: for us, "or" includes the case where more than one of the properties is true. This is called "inclusive or", as opposed to "exclusive or". English can be ambiguous, and has the term "and/or" to be precise. For us, "or" means "and/or", and is written symbolically as "\/". --------------- DeMorgan's Laws --------------- A sentence "s1 and s2" is false exactly when: s1 is false or s2 is false. Symbolically: ~ (s1 /\ s2) <=> (~ s1) \/ (~ s2). A sentence "s1 or s2" is false exactly when: s1 and s2 are both false. Symbolically: ~ (s1 \/ s2) <=> (~ s1) /\ (~ s2). ----------------- Mixed Quantifiers ----------------- A B D G W X Consider the table on the right showing who respects A * who (a * in row x and column y means x respects y): B * * * * * D * * * * * Let r(x, y) = x respects y. G * * * * W * * * Consider the open sentence: X * * * * (7) y is respected by someone: -] x in E, r(x, y). Is (7) true for y = A? Yes: look at the A column. y = B? Yes. ... y = X? Yes. So \-/ y in E, y is respected by someone: (8) \-/ y in E, -] x in E, r(x, y). In everyday language: Everyone has someone who respects them. Notice that x can depend on y, i.e., every column has a * in some row but the row can be different for different columns. Is there one row that works for every column? That's full of *s? What open sentence says a row x is full of *s: \-/ y in E, r(x, y). So we're asking: (9) -] x in E, \-/ y in E, r(x, y). In everyday language: Is there someone who respects everyone? This is false. The difference between (8) and (9) is the order of the quantifiers. Read quantifiers left to right. Existential quantifier involves a choice, which may vary depending on variables introduced by earlier quantifiers. The farther right an existential is, the more we can tailor our choice (though we are not obliged to).