{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

1.4 - 50 SI 52 53 54 55 56 57 58 l The Foundations Logic...

Info icon This preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 50 SI. 52. 53. 54. 55. 56. 57. 58. l The Foundations: Logic and Proofs Show that VxPlx) v ‘9’): 9m and when) v thh are not logically equivalent. Show that E|.rP{x) A El.rQ(x) and ittPtx) A Q(x}) are not logically equivalent. As mentioned in the text. the notation Ellx P(.r) denotes “There exists a unique .r such that Plx] is true.” If the domain consists of all integers, what are the truth values of these statements? s) also > 1} b) anti? 2 l] c) El!x(x + 3 m 2):) d) 3!x{x = x +1) What are the truth values of these statements? a) El!.rP{.r'J —; Ele(.r) b) VxPLr) —r Elletx} c) 3!.Y—IP(X} —> —»V.tP[x) Write out E|!x Pfx ]. where the domain consists of the inte- gers l. 2. and 3. in terms of negations. conjunctions, and disjunctions. Given the Prolog facts in Example 28. what would Prolog return given these queries? 3) ?irtstructor l Chart . math273l b) ?instructortpatel,cs301l c) ?enrolledlx,cs301} d} ?enrolled(kiko.Yl e) ?teacheslgrossman,¥l Given the Prolog facts in Example 28. what would Prolog return when given these queries? 3) ?enrolledlkevin.ee2221 b) ?enrolledtkiko.math273l c} ?instructor lgrossmart . K} d} ?instructorlx,cs301) e) ?teachestx,kevinl Suppose that Prolog facts are used to define the predicates mother(M, Y) and farherl F . X ), which represent that M is the mother of Y and F is the father of X . respectively. Give a Prolog rule to define the predicate sibling{X. Y), which represents that X and l’ are siblings (that is, have the same mother and the same father). Suppose that Prolog facts are used to define the pred- icates mother(M_. Y) and fbthertF. X "J, which repre- sent that M is the mother of Y and F is the father of X , respectively. Give a Prolog rule to define the predicate gmndfarheflX , Y}, which represents that X is the grand- father of Y. [Hints You can write a disjunction in Prolog 1.4 Nested Quantifiers E Introduction i —,'i U either by using a semicolon to separate predicates or by putting these predicates on separate lines.] Exercises 59—62 are based on questions found in the book Symbolic Logic by Lewis Carroll. 59. 60. 61 62. Let PU}, le ), and Rtx) be the statements “.t is a profes- sor," “.r is ignorant," and “x is vain.” respectively. Express each of these statements using quantifiers: logical con— nectives; and PM}. le}. and Rlx). where the domain consists of all people. a) No professors are ignorant. b) All ignorant people are vain. c) No professors are vain. d) Does (cl follow from (a) and (bl? Let PU), Q{.r), and R(x} be the statements “.r is a clear explanation.“ “x is satisfactory.” and “.r is an excuse." respectively. Suppose that the domain for .r consists of all English text. Express each ofthese statements using quan— tifiers. logical connectives, and PU), th). and Rtxl. a) All clear explanations are satisfactory. b) Some excuses are unsatisfactory. e) Some excuses are not clear explanations. it‘d) Does (cl follow from (a) and {b}? . Let Plx), th}, Rtx}, and S(.r} be the statements “x is a baby," “.r is logical,“ "x is able to manage a crocodile." and “x is despised." respectively. Suppose that the domain consists of all people. Express each of these statements using quantifiers; logical connectives; and Pix], QM), RU}. and 50:). a) Babiesareillogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. ti) Babies cannot manage crocodiles. fie) Does (d) follow from (a). lb], and {c}? lfnot. is there a correct conclusion? Let P(.r). Q{.t). Rlxl, and 3(x} be the statements “.1' is a duck," “x is one of my poultry,” “x is an officer,” and “x is willing to waltz,” respectively. Express each of these statements using quantifiers; logical connectives; and Phi). Q(.r), Rtx}, and S(.r}. a) No ducks are willing to waltz. b) No officers ever decline to waltz. c) All my poultry are ducks. (1) My poultry are not officers. are) Does (d) follow from (a). (b), and [c]? If not. is there a correct conclusion? In Section 1.3 we defined the existential and universal quantifiers and showed how they can be used to represent mathematical statements. We also explained how they can be used to translate l-Fl’ EXAMPLE 1 Extra Examines " EXAMPLE 2 1.4 Nested Quantifiers 51 English sentences into logical expressions. In this section we will study nested quantifiers. Two quantifiers are nested if one is within the scope of the other, such as Vx3y(x +y = 0). Note that everything within the scope of a quantifier can be thought of as a propositional function. For example, VxEIy{x +y = 0) is the same thing as VxQ(x)_. where Q(x_) is Hyflx. y), where P(x. y) is x +y = O. Nested quantifiers commonly occur in mathematics and computer science. Although nested quantifiers can sometimes be difficult to understand, the rules we have already studied in Section 1.3 can help us use them. To understand these statements involving many quantifiers, we need to unravel what the quantifiers and predicates that appear mean. This is illustrated in Examples 1 and 2. Assume that the domain for the variables x and y consists of all real numbers. The statement VxVy(x + y = y + x) says that x + y = y + x for all real numbers x and y. This is the commutative law for addition of real numbers. Likewise, the statement Vxflflx + y = 0) says that for every real number .1: there is a real number y such that .r + y = 0. This states that every real number has an additive inverse. Similarly, the statement VxVsz{x + ("v + 2) = (x + y) + z) is the associative law for addition of real numbers. { Translate into English the statement VxVy((x s 0) A (y a. 0) —> (xy < 0)}. where the domain for both variables consists of all real numbers. Solution: This statement says that for every real number .1: and for every real number y, if x > O and y < 0. then xy < 0. That is, this statement says that for real numbers it and y, if .r is positive and y is negative, then xy is negative. This can be stated more succinctly as “The product of a positive real number and a negative real number is always a negative real number.” 4 THINKING OF QUANTIFICATION AS LOOPS In working with quantifications of more than one variable, it is sometimes helpful to think in terms of nested loops. (Of course, if there are infinitely many elements in the domain of some variable, we cannot actually loop through all values. Nevertheless, this way of thinking is helpful in understanding nested quantifiers.) For example, to see whether VxVyP(x. y) is true. we loop through the values for x, and for each x we loop through the values for ,v. If we find that Ptx, y) is true for all values for x and y, we have determined that V_rV_vP(.r. y) is true. If we ever hit a value x for which we hit a value y for which P(x. y) is false, we have shown that VxVyP(x. y) is false. Similarly, to determine whether VxEIyP(x, y) is true, we loop through the values for x. For each x we loop through the values for __v until we find a y for which P(x. y) is true. If for 52 l t The Foundations: Logic and Proofs EXAMPLE 3 [Film Ettamntes " EXAMPLE 4 1—53 every I we hit such a y, then VxEIyP(x, y) is true; if for some .r we never hit such a y, then Wily P (x. y} is false. To see whether 3xVyP(_x, y) is true, we loop through the values for 1: until we find an x for which P{'.\'. y) is always true when we loop through all values for y. Once we find such an x, we know that Eley P (x. y) is true. If we never hit such an x, then we know that itVyPLr. y) is false. Finally, to see whether SxElyPLr. y) is true. we loop through the values for x, where for each .r we loop through the values for y until we hit an x for which we hit a y for which P(x, y) is true. The statement 3x3yP(x, y) is false only if we never hit an x for which we hit a y such that P{.r_. y} is true. The Order of Quantifiers Many mathematical statements involve multiple quantifications of propositional functions in» volving more than one variable. [t is important to note that the order of the quantifiers is important. unless all the quantifiers are universal quantifiers or all are existential quantifiers. These remarks are illustrated by Examples 3—5. Let P(:c. y) be the statement “at + y = y + .1: What are the truth values of the quantifications VxVyPix. y) and V‘vi P{x. y) where the domain for all variables consists of all real numbers? Sohttfon: The quantification VxV_t:P(.r. y) denotes the proposition “For all real numbers x, for all real numbers y. x + y = y + x.” Because P(.r, y) is true for all real numbers 3: and y (it is the commutative law for addition, which is an axiom for the real numbers—see Appendix 1), the proposition VxVItrPlx. y) is true. Note that the statement V’ny P(.r. Iv) says “For all real numbers y, for all real numbers x. x + y = y + x.” This has the same meaning as the statement as “For all real numbers x. for all realnumbersyu +y = y + x.”Thatis,VxVyP(x. y} and VyV.rP(x, y) have the same meaning, and both are true. This illustrates the principle that the order of nested universal quantifiers in a statement without other quantifiers can be changed without changing the meaning of the quantified statement. 4 Let Q(_r, y) denote “x + y = 0.“ What are the truth values of the quantifications 5|ny Q(.r. y) and V.r3yQ{x. y}, where the domain for all variables consists of all real numbers? Solution: The quantification Elny th. __t-'] denotes the proposition “There is a real number y such that for every real number x, Q(x. y).” No matter what value ofy is chosen, there is only one value ofx for which .1: + y = 0. Because there is no real number y such that x + y = 0 for all real numbers 1', the statement 1vi Q(x. y) is false. )‘ —53 EXAMPLE 5 1.4 Nested Quantifiers 53 TABLE 1 Quantifieations of Two Variables. VxVyPLt. y) P(x. y} is true for every pairx. y. There is a pair x. y for which P(x. y) is false. There is an .t such that P(x. y} is false for every _v. For every x there is a y for which PLr. y} is false. Ptx. y) is false for every pair I. ,v. VJ-'V.t P (x . y) For every .r there is a ,v for VxElyPtx. y} which P(.r. y) is true. EleyP(x. y) There is an x for which Ptx. y] is true for every y. HxElyP{x. y) EIyEIx P(x. y) The quantification There is a pair x. y for which P(x. Iv) is true. Vx El y Q {.1' , y) denotes the proposition “For every real number x there is a real number y such that Q(x. y)“ Given a real number x, there is a real number y such that x + y = 0; namely, y = —x. Hence, the statement VxElyth. y) is true. { Example 4 illustrates that the order in which quantifiers appear makes a difference. The state- ments 5|ny P (x. y) and Vx By P (x. y) are not logically equivalent. The statement 3’ny P (I. y) is true if and only if there is a y that makes P(x. y) true for every 3:. So, for this statement to be true, there must be a particular value of y for which P (x, y) is true regardless of the choice of x. On the other hand, VinyPUc. y) is true ifand only iffor every value ofx there is a value ofy for which P(x. y) is true. So, for this statement to be true, no matter which x you choose, there must be a value of y (possibly depending on the x you choose) for which P(x. y) is true. In other words, in the second case, y can depend on x, whereas in the first case, y is a constant independent of it. From these observations, it follows that if ELvi P(x. y) is true, then VxEIyP(x. y) must also be true. However, if VxEIyP(x, y) is true, it is not necessary for EnyPtx, y) to be true. (See Supplementary Exercises 24 and 25 at the end of this chapter.) Table 1 summarizes the meanings of the different possible quantifications involving two variables. Quantifications of more than two variables are also common, as Example 5 illustrates. Let Q(x. y. 2) be the statement “x + y = 2.” What are the truth values of the statements VxVyEIzQ(x.y, z) and ElexVyQ(_x._v.z), where the domain of all variables consists of all real numbers? Solution .' Suppose that x and y are assigned values. Then, there exists a real number 2 such that x + y = 2. Consequently, the quantification VxVyEIzQ{x,y.z). 54 l I The Foundations: Logic and Proofs EXAMPLE 6 mm _\ minutes *' EXAMPLE 7 which is the statement “For all real numbers it and for all real numbers y there is a real number 2 such that x + y = z,” is true. The order of the quantification here is important, because the quantification ElexVyQ(x, y, 2), which is the statement “There is a real number 2 such that for all real numbers .1: and for all real numbers y it is true that x + y = z,” is false, because there is no value of 2 that satisfies the equation x + y = z for all values of x and y. 4 Translating Mathematical Statements into Statements Involving Nested Quantifiers Mathematical statements expressed in English can be translated into logical expressions as Examples 6~8 show. Translate the statement “The sum of two positive integers is always positive" into a logical expression. Sciatica: To tranSIate this statement into a logical expression, we first rewrite it so that the implied quantifiers and a domain are shown: “For every two integers, if these integers are both positive, then the sum of these integers is positive.“ Next, we introduce the variables x and '1' to obtain “For all positive integers x and y, x + y is positive." Consequently, we can express this statement as VxVy((x > 0) A (y r; 0) —> {x + y > 0)). where the domain for both variables consists of all integers. Note that we could also translate this using the positive integers as the domain. Then the statement “The sum of two positive integers is always positive” becomes “For every two positive integers, the sum of these integers is positive. We can express this as VxVy(x + y > 0), where the domain for both variables consists of all positive integers. { Translate the statement “Every real number except zero has a multiplicative inverse.” (A mul— tiplicative inverse of a real number x is a real number y such that xy = 1.) Solution: We first rewrite this as “For every real number x except zero, x has a multiplicative inverse.” We can rewrite this as “For every real number x, if x 75 0, then there exists a real number y such that xy = 1.” This can be rewritten as Vxflx 5e 0) —+ Elytxy = 1)). <l One example that you may be familiar with is the concept of limit, which is important in calculus. EXAMPLE 8 EXAMPLE 9 EXAMPLE 10 1.4 Nested Quantifiers 55 (Requires caicuius) Express the definition of a limit using quantifiers. Solution: Recall that the definition of the statement lim f(x) = L Nat? is: For every real number 6 > 0 there exists a real number 6 > 0 such that |f{.t) — L| c 6 whenever 0 < Ix — at < 8. This definition ofa limit can be phrased in terms of quantifiers by VEEIdew < Ix ~ al < 5 —+ [f(.r) — L| 4 E). where the damain for the variables 8 and 6 consists of all positive real numbers and for it consists of all real numbers. This definition can also be expressed as V€>036>0V.r(0 < Ix—al <5—+ |f{x)—L| <6) when the domain for the variables 6 and 6 consists of all real numbers, rather than just the positive real numbers. [Here restricted quantifiers have been used. Recall that Vx; {i P(x) means that for all x with x> 0, Put) is true] { Translating from Nested Quantifiers into English Expressions with nested quantifiers expressing statements in English can be quite complicated. The first step in translating such an expression is to write out what the quantifiers and predicates in the expression mean. The next step is to express this meaning in a simpler sentence. This process is illustrated in Examples 9 and [0. Translate the statement Vx(C{x) V El_v{_C(y) A F(x. y))) into English, where C (x) is “x has a computer," F (x. y) is “x and y are friends,“ and the domain for both x and y consists of all students in your school. Solution: The statement says that for every student x in your school, it has a computer or there is a student y such that y has a computer and x and y are friends. In other words, every student in your school has a computer or has a friend who has a computer. { Translate the statement BxVsz({F(x.y) A For. 2) A (y as 2}} —> fiFU‘ZD into English, where F ((3.27) means a and b are friends and the domain for x, y, and 2 consists of all students in your school. Solution: We first examine the expression (Rx. y) A F(x, 2} A 0/ ¢ 2]) —> fiFLy. z). This expression says that if students it and y are friends, and students it and z are friends, and further- more, if y and z are not the same student, then y and z are not friends. It follows that the original statement. which is triply quantified, says that there is a student at such that for all students y and all students 2 other than y, if x and y are friends and x and z are friends, then y and z are not friends. In other words, there is a student none of whose friends are also friends with each other. 4 56 | The Foundations: Logic and Proofs EXAMPLE 11 EXAMPLE 12 EXAMPLE 13 Translating English Sentences into Logical Expressions In Section 1.3 we showed how quantifiers can be used to translate sentences into logical expres- sions. However. we avoided sentences whose translation into logical expressions required the use of nested quantifiers. We now address the translation of such sentences. Express the statement “If a person is female and is a parent, then this person is someone’s mother” as a logical expression involving predicates, quantifiers with a domain consisting of all people, and logical connectives. Solution: The statement “If a person is female and is a parent, then this person is someone’s mother” can he expressed as “For every person .r. if person .r is female and person .1: is a parent. then there exists a person Av such that person 1' is the mother of person y." We introduce the propositional functions F (x) to represent "3: is female,” P (x) to represent “.1: is a parent,” and Mtr. y) to represent “x is the mother of); The original statement can be represented as V.\‘((F(x) A P[x)_} —» ElyM(x.y)). Using the null quantification rule in part (b) of Exercise 4? in SectiOn 1.3, we can move Ely to the left so that it appears just after Vx, because y does not appear in F (x) A P(x). We obtain the logically equivalent expression V.rEly({F(x) A P{.r)) —> M(x. '12)). ‘ Express the statement “Everyone has exactly one best friend" as a logical expression involving predicates, quantifiers with a domain consisting of all people, and logical connectives. Solution: The statement “Everyone has exactly one best friend” can be expressed as “For every person .r, person .1' has exactly one best friend.” Introducing the universal quantifier. we see that this statement is the same as “W: (person it has exactly one best fi'iend).” where the domain consists of all people. To say that x has exactly one best friend means that there is a person y who is the best friend of x, and furthermore, that for every person 2, if person 2 is not person in then 2 is not the best friend of x. When we introduce the predicate B(.r, y) to be the statement “y is the best friend of x," the statement that x has exactly one best friend can be represented as 3y(B(X« .v) A Vzttz as y) -> —-B(x. 2D)- Consequently, our original statement can be expressed as VxEI,v(B(x- r) A Vzttz s9 y) 4+ nBU. 2D)- [Note that we can write this statement as VxHIyB (x. y), where El! is the “uniqueness quantifier" defined on page 31] 4 Use quantifiers to express the statement “There is a woman who has taken a flight on every airline in the world." RSSGSSITIEIII EXAMPLE 14 Extra Examples EXAMPLE 15 EXAMPLE 16 I .4 Nested Quantifiers 57 Solution: Let P(w, f) be “w has taken f" and Q(f. o) be “f is a flight on a.” We can express the statement as EleoElf(P(w. f) A QU; 0)). where the domains of discourse for w. f, and o consist of all the women in the world, all airplane flights, and all airlines, respectively. The statement could also be expressed as 3ththR(w. f. a). where R(w. f. a) is “w has...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern