Discrete Mathematics

Size: px
Start display at page:

Download "Discrete Mathematics"

Transcription

1 Discrete Mathematics Revision Notes Jim Woodcock University of York MSc in Software Engineering Autmun Term 2006

2 2

3 Contents 1 Propositional Calculus Propositions Conjunction Disjunction Negation Implication Equivalence Propositions and Truth Tables Tautologies and Contradictions Arguments Problems Predicate Calculus Substitution Validity and Satisfiability Properties of Quantifiers Multiple Quantifiers Problems Set Theory Sets Notation Finite and Infinite Sets Equality of Sets Empty Set Subsets Proper Subset Sets of Sets Power Set Disjoint Sets Venn s Diagrams Union Intersection Difference Properties of Set Operations Generalised Operations Axiomatic Set Theory Axiomatics i

4 Cantor s and Russell s Paradoxes The Zermelo-Fraenkel Axioms for Set Theory Problems Relations Ordered Pairs Cartesian Products Relations Inverse Relations Identity Relation Properties of Relations Equivalence Relations Source, Target, Domain, and Range Orderings Composition Relational Restriction Relational Closure Problems Functions Total and Partial Functions Special Functions Relational Operations on Functions Relations and Functions Cardinality The Pigeonhole Principle Functional Composition Functional Overriding Problems A Solutions to Chapter 1: Propositional Calculus 77 B Solutions to Chapter 2: Predicate Calculus 93 C Solutions to Chapter 3: Set Theory 98 D Solutions to Chapter 4: Relations 111 E Solutions to Chapter 5: Functions 121 ii

5 Chapter 1 Propositional Calculus 1.1 Propositions A proposition is some statement such as 1. 4 is a prime number = is an even integer, but 3 is not. 4. My most recently written program always halts, if it s allowed to run for long enough. As we shall see, a fundamental property of a proposition is that it is either true or false, but not both. In the example, the first proposition is false, and the second and third are true. The last may well be rather difficult to determine, and its truth depends on important results in the theory of computation. However difficult it may be to determine, the last proposition is definitely either true or false, but not both. This truthfulness or falsity of a proposition is called its truth value. Compound propositions are composed of subpropositions and various connectives. A fundamental property of a compound proposition is that its truth value is completely determined by the truth values of its subpropositions and their connectives. A propositional variable denotes an arbitrary proposition with an unspecified truth value. We will use the letters p, q, r, with or without subscripts, for these variables. Sometimes we use other, upper-case letters to denote specific propositions, such as H for the proposition My most recently written program always halts, if it s allowed to run for long enough. Propositions may be connected in various ways. The following table describes one unary and four binary connectives, arranged in descending order of operator precedence: negation not conjunction and disjunction or implication implies equivalence if and only if is equivalent to The table gives the connective s symbol, its name, and how it is pronounced. 1 notion of precedence, we can see that the proposition Using the p q r q p r 1 Note: p and q or p conjoined with q ; not p and-ed with q. 1

6 2 is equivalent to the parenthesised version ((( p) q) r) (q (p r)) Example 1 Using these connectives, we can build up compound propositions: Jaffa cakes are biscuits; π < 4 π < 5; π < 4 π < 5; Jim is thirty-something Jim is under forty; Jim is thirty-something Jim is under forty In the following sections, we consider each of the connectives. 1.2 Conjunction Any two propositions may be connected together using the word and to form a compound proposition called the conjunction of the original propositions; for example, Roses are red and violets are blue. The conjunction is written symbolically as p q and is read p and q. It is true exactly when both p and q are true, and false otherwise. 1.3 Disjunction Any two propositions may be connected together using the word or to form a compound proposition called the disjunction of the original propositions; for example, The bridge is safe, or Jim is a poor engineer. The disjunction is written symbolically as p q and is read p or q. It is true exactly either when p is true, or when q is true, and false otherwise. In this way, it is inclusive or. Example 2 A lawyer might well use the term and/or to denote inclusive or. What if we wanted to describe exclusive or? For example, For example, a bar-room lawyer might take the sentence You may have a beer or you may have a whisky to mean You may have a beer or you may have a whisky, but not both. How should we formalise this? Using B to symbolise you may have a beer, and W to symbolise you may have a whisky, we obtain B or W, but not both. We should expand this compound to the more explicit one B or W, but not both B and W. Now we are ready to formalise this. The sentence must be broken up into its logical constituent parts. The major break occurs at but, which in this context signals a conjunction: ( B or W ) (not both B and W ). The first conjunct is the easiest to deal with, as it is a straightforward disjunction: ( B W ) (not both B and W ). In the second conjunct, the major connective is the negation: ( B W ) (both B and W ).

7 3 The phrase both B and W is simply a stylistic way of saying B and W. Thus, You may have a beer or you may have a whisky, but not both is formalised as (B W ) (B W ). 1.4 Negation Given any proposition p, another proposition called the negation of p may be formed by is using the unary connective not ; for example, It is not the case that roses are red and violets are blue. The negation is written symbolically as p and is read not p. It is true exactly when p is false. Thus, our example may be rendered a little more formal as (roses are red violets are blue). 1.5 Implication Of all the propositional connectives, implication seems the oddest when it is encountered for the first time, and yet it is perhaps the most important connective from the point of view of deductive techniques. In modelling, it is used to formalise sentences of the form If p, then q ; for example, If I eat Jaffa cakes, then I shall get fat is formalised as I eat Jaffa cakes I get fat. However, it does have the property that anything follows from a contradiction, and at first sight that is slightly surprising. Thus, the sentence If Napoleon is German, then I m a Dutchman, when translated into Napoleon is German I m a Dutchman, becomes a proposition that expresses a fact, even though Napoleon isn t German and I m not Dutch. I have found it best to think of it as an ordering between the truth values: p q should be read as p implies q, or p is stronger than q. This relation on the two truth values is very simple: false is stronger than true, and true is weaker than false. Furthermore, each truth value is as strong as itself. This gives us the observation about implication that p q is true, except in the case that p is true but q is false. It is in this case that we are asking the question Is true stronger than false? ; the answer is, by definition, no. 2 In the proposition p q, the proposition p is called the antecedent, and the proposition q is called the consequent. Example 3 For example, the sentence If the wind is not too strong and the thunderstorm has finished, then we can sail the boat may be rendered into symbols as (with obvious abbreviations): W T S And the sentence If you are right, then I apologise, but I think that you are wrong may be rendered as (R A) W 2 It is easy to remember which truth value is stronger, if you consider them as two program specifications. A program specification may be regarded, in the simplest case, as a predicate that must be satisfied (made true) by any program that is claimed to implement it. If you are asked to implement a program that satisfies the specification true, then, because it is unconstrained, it can produce any output at all, and still be satisfactory. On the other hand, if you are asked to implement a program that satisfies the specification false, then no program you can devise will be satisfactory. Thus, true is a very weak specification, and false a very strong one.

8 4 And finally, the sentence You will find him, if you look under the desk may be rendered as D F The last example shows the importance of identifying the antecedent and the consequent correctly. This can be harder than you might imagine at first sight. Consider the sentence You may enter only if you have a ticket. This is clearly an implication, but which way round is it? Thinking about the meaning of the sentence, we can see that your having a ticket is necessary in order for you to enter; however, it may not be sufficient. 3 After all, we might want to let your sort in, even if you do have a ticket. Therefore, If you enter, then (at least) you have a ticket is closer in meaning to our original sentence. Thus, we formalise p only if q as p q and p if q as q p The converse of p q is the proposition q p, and the contrapositive of p q is the proposition q p. 1.6 Equivalence The final propositional connective that we shall consider is equivalence. The proposition p q should be read as p is equivalent to q, or p if and only if q (the latter is often abbreviated to p iff q ). 4 The equivalence p q is true if and only if p and q have the same truth value. Example 4 For example, the sentence A pass in Foundations is equivalent to a pass in Management is formalised as F M And the sentence If and only if the time is right, will the revolution succeed is formalised as T R The fact that equivalence is used to formalise a sentence of the form p if and only if q gives a clue as to the relation should between equivalence and implication. Indeed, the equivalence connective is sometimes called the biconditional, as is explained in the following example. The sentence You will pass the Diploma if and only if you pass the assessment means 3 People sometimes read implications in this way. Thus, p q may be read as p is a sufficient condition for q, or equivalently as q is a necessary condition for p. 4 Some people also read the equivalence p q as p is a necessary and sufficient condition for q.

9 5 p q p q t t t t f f f t t f f t p q p q t t t t f f f t f f f f p q p q t t t t f f f t f f f t p q p q t t t t f t f t t f f f p p t f f t Figure 1.1: Truth tables for the propositional connectives. You will pass the Diploma if you pass the assessment, and you will pass the Diploma only if you pass the assessment, which are formalised as (A D) (D A) It may also be formalised, using an equivalence, as A D 1.7 Propositions and Truth Tables By repetitive use of the logical connectives, we can construct more and more complicated compound propositions. As we said above, the truth value of these compound propositions depends on the truth values of their constituent parts, combined in various ways. That is, the truth value of a compound is a function of the truth values of its components. We can use the informal descriptions of the connectives to draw up a set of rules, in the form of tables, that we can use to evaluate the truth value of such a compound proposition. These tables are presented in Figure 1.1. Since we wish to be quite general about this, the truth tables do not use actual propositions which are in fact true or false, but rather they use propositional variables, such as p and q. In the truth table for conjunction, the two columns (headed p and q) describe all possible situations regarding two propositional variables: they are both true, or one of them is true and one is false, or they are both false. In order to make the table easier to read, the truth values have been abbreviated as t and f. There are 2 2 combinations; if there were three propositional variables, then there would be 2 3 combinations; and in general if there were k, then there would be 2 k combinations. The third column describes the truth value taken by the conjunction in each of these situations: the conjunction p q is true exactly when both p and q are true, and false otherwise. These basic truth tables may be used to compute the truth values of compound propositions. There should be as many propositional variables in the left-most columns as occur in the compound proposition, and some consistent policy should be adopted for the assignment of the truth values, such as counting down in binary notation. Example 5 The truth table, for example, of the proposition (p q) may be constructed as follows:

10 6 p q q p q (p q) t t f f t t f t t f f t f f t f f t f t The first two columns set out the various combinations of the values of the propositional variables, as before. There are further columns for progressively more complicated subpropositions, the truth values at each step being determined by the rules embodied in the truth tables. Finally, at the right-hand side of the table there is the truth value of the compound proposition, with one entry for each of the possible combinations of values for p and q. The third and fourth columns contain intermediate results, and do not form part of the finished truth table for (p q). Another way of constructing the truth table is as follows. First draw out a table with sufficient rows for every combination of values for p and q, and sufficient columns for p, q, and every propositional variable and connective in (p q): p q (p q) t t t f f t f f Truth values are now entered into the table in the following steps. First, the empty columns headed with the propositional variables are filled in: p q (p q) t t t t t f t f f t f t f f f f Now the table is completed by progressively filling in columns for connectives which are being applied to subpropositions whose entries are already filled in. At this point, there is only one such column, namely the inner-most negation: p q (p q) t t t f t t f t t f f t f f t f f f t f Next, the conjunction s column can be filled in: And finally, the outer-most negation: p q (p q) t t t f f t t f t t t f f t f f f t f f f f t f p q (p q) t t t t f f t t f f t t t f f t t f f f t f f t f f t f The truth table of the proposition consists of the original two columns for the propositional variables p and q, and the final column.

11 7 p q (p q) t t t t f f f t t f f t This is the same truth table as that for p q. Thus, we have proved the equivalence of two propositions. 1.8 Tautologies and Contradictions Propositions which evaluate to true in every combination of their propositional variables are known as tautologies: they are always true. If, on the other hand, they evaluate to false everywhere, then they are known as contradictions. Of course, the negation of a contradiction is a tautology, and vice versa. A proposition which is neither a tautology nor a contradiction is termed a contingency. Example 6 For example, it is a tautology that every proposition is either true or false. We can see this, by symbolising our sentence as p p, and then constructing the truth table: p p p t t t f t f f t t t It is a contradiction that a proposition can be both true and false. Again, we symbolise this and construct a truth table: p p p t t f f t f f f t t In order to determine whether a proposition is a tautology, it is necessary to check only those lines of the truth table for which the proposition could be false. Thus, consider the problem of determining whether p q p is a tautology. If an implication a b is false, then a must be true and b false. The truth table for p q p has only one line where the value of the antecedent is true. So, we need consider only this situation: p q p q p t t t t Two propositions p and q are said to be logically equivalent if the proposition p q is a tautology this amounts to the same as saying that both have the same truth table. If two propositions are logically equivalent, then one may be substituted for the other in any proposition in which they occur. Thus, since p is logically equivalent to p p, it follows that p q is logically equivalent to (p p) q. Figure 1.2 contains various useful identities. We have tried to give the logical identities meaningful names, so that they can be more easily referred to. Notice that conjunction and disjunction are said to be associative: that is, it doesn t matter where we put the parentheses in an expression such as p q r, since we have that (p q) r p (q r) Logical identities may be used to show the relationship between various propositions. Example 7 For example, suppose that we wish to simplify the following proposition: (p q) (p r) (q r)

12 8 1. p p p idempotence of 2. p p p idempotence of 3. p q q p commutativity of 4. p q q p commutativity of 5. (p q) r p (q r) associativity of 6. (p q) r p (q r) associativity of 7. (p q) p q De Morgan s Law (1) 8. (p q) p q De Morgan s Law (2) 9. p (q r) (p q) (p r) distributivity of over 10. p (q r) (p q) (p r) distributivity of over 11. p true true zero for 12. p true p unit for 13. p false p unit for 14. p false false zero for 15. p p true excluded middle 16. p p false contradiction 17. p p double negation 18. (p q) p q implication 19. (p q) (p q) (q p) equivalence 20. (p q r) (p (q r)) exportation 21. (p q) (p q) p absurdity 22. (p q) ( q p) contraposition Figure 1.2: Logical identities Proof (p q) (p r) (q r) by implication, twice ( p q) ( p r) (q r) by commutativity, associativity, and idempotence of p (q r) (q r) by implication ( p (q r)) (q r) by De Morgan s Law (1) ( p (q r)) (q r) by double negation (p (q r)) (q r) by commutativity of (q r) (p (q r)) by distributivity of over ((q r) p) ((q r) (q r)) by excluded middle

13 9 1. p p q addition 2. p q p simplification 3. p (p q) q modus ponens 4. (p q) q p modus tollens 5. p (p q) q disjunctive syllogism 6. (p q) (q r) (p r) hypothetical syllogism 7. (p q) (q r) (p r) transitivity of Figure 1.3: Logical implications ((q r) p) true by unit for (q r) p by commutativity p (q r) There are other useful tautologies that involve implications rather than equivalences, and figure 1.3 contains some of these. Example 8 5 A man who was captured by savages was promised his freedom if he could determine with a single yes or no question the colour of the tribe s idol. He knew the idol was either black or white. Unfortunately, the tribe contained two kinds of individuals: liars, who invariably gave the wrong answer to any question that they were asked; and truth tellers, who invariably gave the right answer. Fortunately, the victim was well-educated. He knew that he must ask a question which would be answered according to the following table: Colour of Idol White Black Liars Yes No Truth-tellers Yes No However, since a liar always gave the wrong answer, he realised that he must ask a question whose correct answers could be tabulated as follows: Colour of Idol White Black Liars No Yes Truth-tellers Yes No Whereupon he asked his nearest captor Is it true that either you tell the truth and the idol is white, or that you lie and the idol is black? This question enabled him to determine the colour correctly, since an answer of yes meant the idol was white, and no meant that it was black. Unfortunately, the savages thought that it was just a lucky guess, and they reneged on their promise. 1.9 Arguments Suppose that the proposition p and p q are both true. We can argue that, as a result of these suppositions, q must also be true. To see this, recall the truth table for implication: 5 This example is well-known; our version follows (Stanat & McAllister, 1977).

14 10 p q p q t t t t f f f t t f f t If we strike out those rows which do not correspond to the situation that p and p q are both true, then we arrive at the rather smaller table: p q p q t t t There is only one situation, and in it q is true. We have proved the validity of an argument known as modus ponens. Compare this argument with the logical implication with same name in figure 1.3. Formally, an argument is an assertion that a given set of propositions P 1, P 2,..., P n, called the premisses, entails another proposition Q, called the conclusion. Such an argument is denoted using an assertion sign, known as the turnstile: P 1, P 2,..., P n Q This is formalised by saying that the argument P 1, P 2,..., P n Q is valid if Q is true whenever all the premisses P 1, P 2,..., P n are true. This was what we were doing in the example concerning modus ponens: we examined all those situations in which the antecedents were true, and then checked to see if the consequent was true also. An argument which isn t valid is called a fallacy. We end this chapter with three little proofs of the same theorem, all due to Binmore. Example 9 p q, q p The following argument is a fallacy: Again, the proof of this follows directly from the truth table for implication. 6 Example 10 We give three different proofs of the fact that, if x 2 3x + 2 < 0, then x > 0. Proof 1 Assume that x 2 3x + 2 < 0. Then, 3x > x since x 2 0. Hence x > 2 3 > 0 It follows that if x 2 3x + 2 < 0, then x > 0. Proof 2 The contrapositive statement is that if x 0, then x 2 3x We assume therefore that x 0. Then Hence x 1 0 and x 2 0 x 2 3x + 2 = (x 1)(x 2) 0 It follows that if x 0, then x 2 3x + 2 0, and hence that if x 2 3x + 2 < 0, then x > 0. 6 This fallacy has been called modus morons by Binmore.

15 11 Proof 3 Assume x 2 3x + 2 < 0 and x 0. Then x 2 < 3x 2 2 < 0 This is a contradiction, and hence if x 2 3x + 2 < 0, then x > 0. In example 9, the proofs are quite informal; they can be formalised, however. Consider the first proof, we can see that it is of the following form: x 2 3x + 2 < 0 by rearranging 3x > x since x 2 0, we have that x x > x x by the meaning of 3x > x (x > 2 x = 2) by distributivity of over (3x > x x > 2) (3x > x x = 2) by transitivity of > (3x > 2) (3x > x x = 2) using the equality in the second disjunct (3x > 2) (3x > 2) by idempotence of 3x > 2 dividing both sides by 3 x > 2 3 since 2 3 > 0, and > is transitive x > 0. This is still not a formal proof, but the structure of an underlying formal proof has been exposed.

16 Problems 1. Let p be it is cold and let q be it is raining. Give a simple verbal sentence which describes each of the following propositions: (i) p, (ii) p q, (iii) p q, (iv) q p, (v) p q, (vi) q. 2. Let p be she is tall and let q be she is beautiful. Write propositions that symbolise the following: (a) She is tall and beautiful. (b) She is tall but not beautiful. (c) It is false that she is short or beautiful. (d) She is neither tall nor beautiful. (e) It is not true that she is short or not beautiful. 3. (Hamilton) Translate into symbols the following compound statements: (a) We shall win the election, provided that Jones is elected leader of the party. (b) If Jones is not elected leader of the party, then either Smith or Robinson will leave the cabinet, and we shall lose the election. (c) If x is a rational number and y is an integer, then z is not real. (d) Either the murderer has left the country or somebody is harbouring him. (e) If the murderer has not left the country, then somebody is harbouring him. (f) The sum of two numbers is even if and only if either both numbers are even or both numbers are odd. (g) If y is an integer, then z is not real, provided that x is a rational number. 4. (Stanat) Let p be the proposition It is snowing. Let q be the proposition I will go to town. Let r be the proposition I have time. (a) Using propositional connectives, write a proposition which symbolises each of the following: i. If it is not snowing and I have time, then I will go to town. ii. I will go to town only if I have time. iii. It isn t snowing. iv. It is snowing, and I will not go to town. (b) Write a sentence in English corresponding to each of the following propositions:. i. q r p; ii. r q; iii. (q r) (r q); iv. (r q). 5. (Stanat) State the converse and contrapositive of each of the following:

17 13 (a) If it rains, I m not going. (b) I will stay only if you go. (c) If you get 4lbs, you can bake the cake. (d) I can t complete the task if I don t get more help. 6. (Grimaldi) Let p, q, r denote the following statements: p: Triangle ABC is isosceles; q: Triangle ABC is equilateral; r: Triangle ABC is equiangular. Translate each of the following into an English sentence. (a) q p; (b) p q; (c) q r; (d) p q; (e) r p. 7. (Grimaldi) (a) How many rows are needed for the truth table of the proposition p q r s t (b) If p 1, p 2,..., p n are propositional variables, and the compound statement p contains at least one occurrence of each propositional variable p i, how many rows are needed in order to construct the truth table for p? 8. Find truth tables for the following propositions: (a) p q (b) (p q) (c) (p q) 9. Rain on Tuesday is a necessary condition for rain on Sunday. If it rains on Tuesday, then it rains on Wednesday. But it rains on Wednesday only if it rains on Friday. Moreover, no rain on Monday means no rain on Friday. Finally, rain on Monday is a sufficient condition for rain on Saturday. Express each of these statements in the form p q. Given that it rains on Sunday, what can be said about Saturday s weather? 10. Verify that the proposition p (p q) is a tautology. 11. Verify that the proposition (p q) (p q) is a contradiction. 12. Which of the following propositions are tautologies? (a) p (q p); (b) q r ( r q);

18 14 (c) (p q) ((q r) (r p)); (d) (p (q r)) ((p q) r). 13. Show that the following pairs of propositions are logically equivalent. (a) p q, (b) (p q) r, q p; (p r) (q r); (c) p q r, r q p; (d) p q r, (p q) r. 14. Show that the proposition ( p q) (p q) is not a tautology. 15. Show that the following argument is valid: p q, q p. 16. Show that the following argument is valid: p q, q p. 17. Show that the following argument is a fallacy: p q p q. 18. Test the validity of the following argument: If I study, then I will not fail mathematics. If I do not play Lemmings, then I will study. But I failed mathematics. Therefore I played Lemmings. 19. What conclusion can be drawn from the truth of p p? 20. (Stanat) For each of the following expressions, use identities to find equivalent expressions which use only and and are as simple as possible. (a) p q r; (b) p ( q r p); (c) p (q r). 21. (Stanat) For each of the following expressions, use identities to find equivalent expressions which use only and and are as simple as possible. (a) p q r; (b) (p q r) p q; (c) p q ( r p). 22. (Stanat) Establish the following tautologies by simplifying the left-hand side to the form of the right-hand side: (a) (p q p) true; (b) ( (p q) p) false; (c) ((q p) ( p q) (q q)) p; (d) ((p p) ( p p)) false. 23. (a) The nand operator (also known to logicians as the Sheffer stroke), is defined by the following truth table:

19 15 p q p nand q t t f t f t f t t f f t Of course, nand is a contraction of not-and; p nand q is logically equivalent to (p q). Show that i. (p nand p) p; ii. ((p nand p) nand (q nand q)) p q; iii. ((p nand q) nand (p nand q)) p q. (b) Find equivalent expressions for the following, using no connectives other than nand: i. p q; ii. p q. (c) The nor operator (also known to logicians as the Pierce arrow), is defined by the following truth table: p q p nor q t t f t f f f t f f f t For each of the following, find equivalent expressions which use only the nor operator. i. p; ii. p q; iii. p q. 24. Give an explanation of the second and third proofs in example Write a program to construct truth tables of propositions.

20 Chapter 2 Predicate Calculus The language of propositions allows us to model a great variety of properties about specific objects; however, it doesn t allow us to state general properties, such as Every cloud has a silver lining. These general properties are known as universal properties, since they describe properties that must be satisfied by every individual in some universe of discourse. In our little example, we are considering the set of all clouds, and saying that every one of them has a silver lining. Example 11 The following are all examples of universal properties: 1. Every cloud has a silver lining. 2. All the bells in heaven shall ring. 3. Each student must hand in homework. 4. Nobody knows the trouble I seen. 5. Roses are red. 6. Jim doesn t know anybody who can sign his bail application. Sometimes we want to express the fact that at least one thing (without necessarily knowing which thing) has a particular property. This is known as an existential property. Example 12 The following are all examples of existential properties: 1. Something s got into the tank. 2. There is a tavern in the town. 3. I heard it from one of your friends. 4. A mad dog has bitten Robert. 5. Some people prefer logic. In order to symbolise universal and existential properties we shall need two new symbols: is the universal quantifier, and is read for all ; is the existential quantifier, and is read there exists. The quantifier symbols are used to build predicates; a predicate is like a proposition with various slots to be filled in by objects of various kinds. In this section we introduce the syntax of predicates, leaving their formal properties until a little later. Example 13 x : N x > 5 is an existentially quantified predicate. 16

21 17 The phrase x > 5 is not a proposition, because we cannot tell whether it is true or false without knowing what x is. In fact, x is one of those slots we mentioned above. We can turn it into a proposition by giving a value for x, say 0. The proposition 0 > 5 is clearly false. This technique of letting names stand for values is a powerful one, since it allows us to state our more interesting properties. In the example, we stated that there is an x, which is a natural number, such that x > 5. We call this an existentially quantified predicate, and we call the expression there is an a quantifier. In mathematics, the symbol is used to denote the expression there is an ; in Z, the natural numbers are denoted by the symbol N. As we shall see later, we could have formalised the sentence There is a number greater than five as y : N y > 5 The difference is that we have used a different name for the local variable. The existentially quantified predicate in Example 13 is true: there really is such an x. An example is the number 6: it is a natural number, and it is greater than 5. Example 14 Predicates (that is, propositions with free variables in them) occur commonly in programming languages. For example, a statement of the form if x > 3 then y := z includes the predicate x > 3. When the statement is executed, the truth value of the assertion x > 3 is determined using the current value of the variable x; the assertion is assigned either the value 1 (representing true) or 0 (representing false). However, the coding of truth values as integers is sometimes exploited in strange ways in programming languages. For example, in PL/1, A = X > 3 is a legitimate assignment statement; execution of this statement causes the numeric variable A to be assigned the value of 1 if X > 3 is true and 0 if X 3. Such a language is not strongly typed. I find this example surprising because it permits the programmer to interfere with the internal representation of Boolean values, thus violating many software engineering principles, including information hiding. Example 15 The sentences in Example 11 may be formalised as follows. 1. Let Cloud be the set of all clouds, and let SilverLining(x) mean that x has a silver lining. c : Cloud SilverLining(c) 2. Let HolyBell be the set of all bells in heaven, and let Ring(x) mean that x shall ring. b : HolyBell Ring(b) 3. Let Student stand for the set of all students, and Submit(x) mean that x must hand in homework. s : Student Submit(s) 4. Let Person be the set of all people, and let K(x) mean that x knows the trouble I seen. p : Person K(p) 5. Let Rose be the set of all roses, and Red(x) mean that x is red. r : Rose Red(r)

22 18 6. Let Person be the set of all people, and let x Knows y mean that x knows y, and x CanVouchFor y mean that x can sign y s bail application. p : Person Jim Knows p (p CanVouchFor Jim) This may also be written as Example 16 p : Person Jim Knows p (p CanVouchFor Jim) The sentences in Example 12 may be formalised as follows. 1. Let Thing stand for the set of all things, and InTank(x) mean that x is in the tank. x : Thing InTank(x) 2. Let Tavern stand for the set of all taverns, and InTown(x)) mean that x is in the town. t : Tavern InTown(t) 3. Let Friends stand for the set of all your friends, and x Told y mean that x has told y. f : Friends f Told me 4. Let MadDog stand for the set of all mad dogs, and x Bit y mean that x has bitten y. fido : MadDog fido Bit Robert 5. Let Person stand for the set of all people, and PL(x) mean that x prefers logic. p : Person PL(p) Existential quantification may be thought of as a generalised form of disjunction: x : N x > 5 (0 > 5) (1 > 5) (2 > 5) (3 > 5)... The predicate must be true for some natural number. Another way of quantifying a predicate is to say that it is true for every value. Thus, for every x which is a natural number, x > 5. The notation is used to denote the universal quantifier: x : N x > 5 Again, this is the same as y : N y > 5 This universally quantified predicate is false, since not every natural number x is greater than 5. Consider the value 3 : it is a natural number, and it is less than 5. The universal quantifier may be thought of as a generalised conjunction: x : N x > 5 (0 > 5) (1 > 5) (2 > 5) (3 > 5)...

23 19 It must be true for every natural number. In Z, the quantifiers share a similar syntax: 1 where x : s p q is the quantifier; x is the bound variable; s is the range of x; p is the (optional) constraint; and q is the predicate. The two syntactic equivalences explain the constraint: x : s p q is a shorthand for x : s p q x : s p q is a shorthand for x : s p q The existentially quantified predicate x : s p q is pronounced there exists an x in s satisfying p, such that q. The universally quantified predicate x : s p q is pronounced for all x in s satisfying p, q holds. Each quantifier introduces a bound variable, which is analogous to a local variable in a block-structured programming language. In the quantified predicate x : s p q, the bound variable has a scope that is exactly the constraint p and predicate q: x : s p q }{{} scope of x The quantifiers bind very loosely, so x : s p q is implicitly parenthesised as x : s (p q), and not as ( x : s p) q. Predicates such as x > 3 contain a variable which is yet to be bound by a quantifier: namely, x. Such yet-to-be-bound variables are called free variables. Example 17 The following predicates are formed by universal quantification: 1. x : N x < x + 1. Every natural number x is less than x x : N x = 3. Every natural number x is equal to 3. 1 Do not take this example too literally: there is no quantifier called. Rather, there are three logical quantifiers: (for all ), (there exists ), and 1 (there is an unique ), and stands here for one of the them.

24 20 The first predicate is true, but the second isn t. Example 18 If A is an integer array with 50 entries, A 1, A 2,..., A 50, then we can assert that all entries are nonzero as follows: i : N 1 i 50 A i 0 The entries are sorted in nondecreasing order if the following assertion holds: i : N 1 i < 50 A i A i+1 Example 19 For every number x and every number y, x + y is greater than or equal to x: x : N y : N x + y x Example 20 The variable x is existentially quantified in the following predicates: 1. x : N x < x + 1. There is a number x which is less than x x : N x = 3. There is a number x which is equal to x : N x = x + 1. There is a number x which is equal to x + 1. In general, the truth-table technique that we used in the last chapter for giving meaning to connectives and reasoning about them is useless for the quantifiers, since the sets that bound variables may range over are simply too large. 2.1 Substitution Suppose that p is a predicate containing the free variable x. The quantified predicate x : S p asserts that p is true for every assignment of a value to x. Each theorem that follows from x : S p is obtained by substituting a term t for x in p. The notion of substitution is precise, and depends on all the details of the language of logic and sets. We write p[t/x] to denote predicate p with term t substituted for x. It may be read as p with t for x. Substitution is also defined on terms themselves: u[t/x] is the term that results from substituting t for x in u. A bound variable must sometimes be renamed prior to substitution. For example, the following is a theorem about numbers: x : Z y : Z x y This is true for all numbers, so why not specialise it? Let s take advantage of its being true of the specific number y. This allows us to conclude that y : Z y y Thus, we have concluded that there is a number that is different from itself: nonsense! What has gone wrong? The problem is the capture of a free variable: the free variable y comes into the scope of y : Z..., and becomes a bound variable. For this reason, the substitution t for x in p is restricted to substituting t for free occurrences of x in p.

25 Validity and Satisfiability Any predicate has n arguments; if it has no arguments, then it is a proposition. If p is an n-place predicate, and values c 1, c 2,..., c n are assigned to each of the individual variables, the result is a proposition. If p is true for every choice of arguments, then p is said to be valid. If the predicate is true is some, but not necessarily all, choices of arguments, then p is said to be satisfiable, and the values c 1, c 2,..., c n which make p true are said to satisfy p. Valid, satisfiable, and unsatisfiable predicates are the analogues of tautologies, contingencies, and contradictions in the language of propositions. Example The following predicate on x is valid: y : N y > x For any natural number x, there exists a larger one. 2. This predicate is satisfiable but not valid: y : N y < x For some natural numbers x there exist smaller ones, but not for the number An example of an unsatisfiable predicate is y : N y < x y > x For no natural number can we find a second one which is both larger and smaller than it. 2.3 Properties of Quantifiers Consider the predicate x : S p q Is it equivalent to the predicate ( x : S p) ( x : S q) Does one imply the other? Are they at all related? In this section, we give some fundamental identities that answer questions such as these. First, what can be learned from a quantified predicate? If the assertion p(x) is true for every possible value of x in s, then x : s p(x) is true; otherwise, x : s p(x) is false. It also follows that if x : s p(x) is true, then we can choose any term t in s, and p(t) will be true: x : s p(x), t s p(t) If the assertion p(x) is true for at least one element of s, then x : s p(x) is true; otherwise, it is false. It also follows that, for any term t in s, if p(t) is true, then so is x : s p(x): t s, p(t) x : s p(x)

26 22 The negation of the predicate x : N x > 3 is simply x : N x > 3. Can this be simplified at all? Regarding the universally quantified predicate as a generalised conjunction is instructive: x : N x > 3 universal quantification as conjunction (0 > 3 1 > 3 2 > 3 3 > 3...) by De Morgan s Law (0 > 3) (1 > 3) (2 > 3) (3 > 3)... existential quantification as disjunction x : N (x > 3) Thus, we have a generalised form of De Morgan s Laws for the generalisation of the conjunction and disjunction operators: ( x : S p) ( x : S p) ( x : S p) ( x : S p) Example 22 Suppose that Person is the set of all people, and that if you don t love someone, then you hate them. Now, is it true that there is no one who loves everybody? It is difficult to say whether such a warm-hearted individual really doesn t exist, but we can draw some conclusions from supposing it to be true. First, we can formalise it as x : Person y : Person x loves y. Calculating, we obtain the following derivation: x : Person y : Person x loves y by De Morgan x : Person y : Person x loves y by De Morgan x : Person y : Person (x loves y) by definition x : Person y : Person x hates y. So, our sentence means the same as everybody hates someone. A depressing reflection on human nature. Example 23 For every pair of integers x and y, there exists a z such that x + z = y. This can be formalised as x : Z y : Z z : Z x + z = y or more simply as x : Z; y : Z z : Z x + z = y or even more simply as x, y : Z z : Z x + z = y This predicate is true of the integers, but not of the natural numbers. To prove this we need to show that the following predicate is true: x, y : N z : N x + z = y

27 23 We can simplify this by pushing the negation into the predicate: x, y : N z : N x + z = y by De Morgan x, y : N z : N x + z = y by De Morgan x, y : N z : N (x + z = y) by definition x, y : N z : N x + z y Notice how the application of De Morgan s Law to the multiple quantifier worked. The predicate is now in a form where we can more easily prove that it is true. If we select 1 for x and 0 for y, we have z : N 1 + z 0 which is obviously true, since 0 is not the successor of any natural number. When we negate a quantified predicate, what happens to the range of the bound variable? Consider the following: x : N x 2 + x 2 > 0 since x : S p is the same as x : X x S p x : Z x N x 2 + x 2 > 0 by De Morgan x : Z (x N x 2 + x 2 > 0) by propositional calculus x : Z ( (x N) x 2 + x 2 > 0) by De Morgan x : Z (x N) x 2 + x 2 > 0 by double negation x : Z x N x 2 + x 2 > 0 since x : S p is the same as x : X x S p x : N x 2 + x 2 > 0 Thus, when we negate a quantified predicate, the range of the quantification remains unchanged. To prove a predicate of the type x : S p can be quite demanding. One has to give an argument which demonstrates the truth of p whatever the value of x. It is certainly not enough to give some examples of values of x for which it can be seen that p is true. To disprove a predicate of the type x : S p is much easier. This is the same as proving x : S p, and to do this one need find only a single y for which p is false. We say that such a y provides a counterexample to the statement that x : S p.

28 24 Example 24 Show that the statement x : Z x > 0 x 2 3 x is false. A single counterexample will suffice, and an appropriate value is 3. We have that 2 ( 3 2 )2 3 ( 3 2 ) + 2 = 1 4 < 0 If a predicate occurs in a disjunction or conjunction within the scope of a quantifier, and none of its variables are bound by the quantifier, then it can be removed from the scope of the quantifier. Let N stand for a predicate in which the variable x does not occur free. We have the following equivalences. ( x : S p N ) (( x : S p) N ) ( x : S p N ) (( x : S p) N ) ( x : S p N ) (( x : S p) N ) ( x : S p N ) (( x : S p) N ) Now suppose that the variable bound by a quantifier occurs in both predicates of a disjunction or conjunction. There are laws for the quantifiers that are analogous to the associativity laws for disjunction and conjunction, and form the distributivity laws for the quantifiers. ( x : S p q) (( x : S p) ( x : S q)) ( x : S p q) (( x : S p) ( x : S q)) Example 25 The universal quantifier does not distribute over disjunction: ( x : S p q) (( x : S p) ( x : S q)) The left-hand side states that, whichever value of x we choose, either p is true or q is true for that value. The right-hand side states that either p is true for every value of x, or q is true for every value of x. An example should suffice to convince. It is certainly true that every number is either even or odd. It is not true that either every number is even, or every number is odd. Similarly, existential quantification does not distribute through conjunction. It is certainly true that there is a number that is even, and that there is a number that is odd. However, it is not true that there is a number that is both even and odd. Although universal quantification does not distribute through disjunction to yield an equivalent predicate, it does yield a stronger one: ( x : S p) ( x : S q) ( x : S p q) Similarly, although existential quantification does not distribute through conjunction to yield an equivalent predicate, it does yield a weaker one: ( x : S p q) ( x : S p) ( x : S q)

29 25 1. ( x : S p(x)) p(c) 2. p(c) ( x : S p(x)) 3. ( x : S p) ( x : S p) 4. ( x : S p) ( x : S p) 5. ( x : S p) ( x : S p) 6. ( x : S p N ) ( x : S p) N 7. ( x : S p N ) ( x : S p) N 8. ( x : S p) ( x : S q) ( x : S p q) 9. ( x : S p) ( x : S q) ( x : S p q) 10. ( x : S p N ) ( x : S p) N 11. ( x : S p N ) ( x : S p) N 12. ( x : S p q) ( x : S p) ( x : S q) 13. ( x : S p) ( x : S q) ( x : S p q) Figure 2.1: Logical relationships between quantifiers 2.4 Multiple Quantifiers If universal and existential quantifiers are mixed, then their order is significant. Example 26 The sequence x : S y : T... can be paraphrased informally as No matter what value x in S is chosen, a value y in T can be found such that In this quantifier sequence, since y is chosen after x, the value of y may depend on the value of x. For example, no matter what number we choose, there is always a larger number: x : N y : N y > x In contrast, the sequence y : T x : S... asserts that A value y in T can be chosen so that no matter what value x in S is chosen, In this case, since y is bound first, the value of y must be specified independently of the value of x. For example, there is a number which is greater than every other number: y : N x : N y > x Notice that these two predicates are the same, except that the order of the quantifiers has been reversed. Of course, the first of the predicates is true, and the second is false. This is a good illustration that the order is important. Since it doesn t matter which order we choose for a sequence which contains all universal or all existential quantifiers, there is a simplified notation. Instead of writing we write x : S y : T p x : S; y : T p There is a similar simplified notation for the existential quantifier.

30 Problems 1. (Copi, Suppes, Woodcock) Symbolise the following: (a) Snakes are reptiles. (b) Snakes are not all poisonous. (c) Children are present. (d) Executives all have secretaries. (e) Only executives have secretaries. (f) Only community charge payers may vote in local elections. (g) Employees may use only the goods lift. (h) Only employees may use the goods lift. (i) All that glisters is not gold. [Gray] (j) All estate agents are not the same. (k) Not all estate agents are the same. (l) None but the brave deserve the fair. (m) Not every visitor stayed for dinner. (n) Not any visitor stayed for dinner. (o) Nothing in the house escaped the children. (p) Some students are both intelligent and hardworking. (q) No coat is waterproof unless it has been specially treated. (r) Some medicines are dangerous only if taken in excessive amounts. (s) All fruits and vegetables are wholesome and nourishing. (t) Everything enjoyable is either immoral, illegal, or fattening. (u) A lecturer is a good teacher if, and only if, he is both well-informed and entertaining. (v) Only university lecturers and firemen are both vastly underpaid and indispensible. (w) Not every actor who is famous is talented. (x) It simply isn t true that every watch will keep good time if and only if it is wound regularly and not abused. (y) Not every person who talks a great deal has a great deal to say. (z) No car that is over ten years old will be mended if it is severely damaged. 2. Symbolise the following predicates about the nature of elephants. (a) Any elephant is attractive, if it is neat and well-groomed. (b) Some elephants are gentle and have been well trained. (c) Some elephants are gentle only if they have been well groomed by every student. (d) Some elephants called Jumbo are gentle if they have been well trained. (e) Any elephant is gentle that has been well trained.

Propositional Calculus. Problems. Propositional Calculus 3&4. 1&2 Propositional Calculus. Johnson will leave the cabinet, and we ll lose the election.

Propositional Calculus. Problems. Propositional Calculus 3&4. 1&2 Propositional Calculus. Johnson will leave the cabinet, and we ll lose the election. 1&2 Propositional Calculus Propositional Calculus Problems Jim Woodcock University of York October 2008 1. Let p be it s cold and let q be it s raining. Give a simple verbal sentence which describes each

More information

Logic and Propositional Calculus

Logic and Propositional Calculus CHAPTER 4 Logic and Propositional Calculus 4.1 INTRODUCTION Many algorithms and proofs use logical expressions such as: IF p THEN q or If p 1 AND p 2, THEN q 1 OR q 2 Therefore it is necessary to know

More information

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations Logic Propositions and logical operations Main concepts: propositions truth values propositional variables logical operations 1 Propositions and logical operations A proposition is the most basic element

More information

HANDOUT AND SET THEORY. Ariyadi Wijaya

HANDOUT AND SET THEORY. Ariyadi Wijaya HANDOUT LOGIC AND SET THEORY Ariyadi Wijaya Mathematics Education Department Faculty of Mathematics and Natural Science Yogyakarta State University 2009 1 Mathematics Education Department Faculty of Mathematics

More information

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning. 3: Logic Why logic? Logic about inference or argument Start from assumptions or axioms Make deductions according to rules of reasoning Logic 3-1 Why logic? (continued) If I don t buy a lottery ticket on

More information

Chapter 1 Elementary Logic

Chapter 1 Elementary Logic 2017-2018 Chapter 1 Elementary Logic The study of logic is the study of the principles and methods used in distinguishing valid arguments from those that are not valid. The aim of this chapter is to help

More information

Chapter 1: The Logic of Compound Statements. January 7, 2008

Chapter 1: The Logic of Compound Statements. January 7, 2008 Chapter 1: The Logic of Compound Statements January 7, 2008 Outline 1 1.1 Logical Form and Logical Equivalence 2 1.2 Conditional Statements 3 1.3 Valid and Invalid Arguments Central notion of deductive

More information

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic CS 103 Discrete Structures Chapter 1 Propositional Logic Chapter 1.1 Propositional Logic 1 1.1 Propositional Logic Definition: A proposition :is a declarative sentence (that is, a sentence that declares

More information

A Little Deductive Logic

A Little Deductive Logic A Little Deductive Logic In propositional or sentential deductive logic, we begin by specifying that we will use capital letters (like A, B, C, D, and so on) to stand in for sentences, and we assume that

More information

Logic Overview, I. and T T T T F F F T F F F F

Logic Overview, I. and T T T T F F F T F F F F Logic Overview, I DEFINITIONS A statement (proposition) is a declarative sentence that can be assigned a truth value T or F, but not both. Statements are denoted by letters p, q, r, s,... The 5 basic logical

More information

A Little Deductive Logic

A Little Deductive Logic A Little Deductive Logic In propositional or sentential deductive logic, we begin by specifying that we will use capital letters (like A, B, C, D, and so on) to stand in for sentences, and we assume that

More information

3 The Semantics of the Propositional Calculus

3 The Semantics of the Propositional Calculus 3 The Semantics of the Propositional Calculus 1. Interpretations Formulas of the propositional calculus express statement forms. In chapter two, we gave informal descriptions of the meanings of the logical

More information

1.1 Statements and Compound Statements

1.1 Statements and Compound Statements Chapter 1 Propositional Logic 1.1 Statements and Compound Statements A statement or proposition is an assertion which is either true or false, though you may not know which. That is, a statement is something

More information

Introducing Proof 1. hsn.uk.net. Contents

Introducing Proof 1. hsn.uk.net. Contents Contents 1 1 Introduction 1 What is proof? 1 Statements, Definitions and Euler Diagrams 1 Statements 1 Definitions Our first proof Euler diagrams 4 3 Logical Connectives 5 Negation 6 Conjunction 7 Disjunction

More information

Logic and Propositional Calculus

Logic and Propositional Calculus CHAPTER 4 Logic and Propositional Calculus 4.1 INTRODUCTION Many algorithms and proofs use logical expressions such as: IF p THEN q or If p 1 AND p 2, THEN q 1 OR q 2 Therefore it is necessary to know

More information

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1) CS100: DISCREE SRUCURES Lecture 5: Logic (Ch1) Lecture Overview 2 Statement Logical Connectives Conjunction Disjunction Propositions Conditional Bio-conditional Converse Inverse Contrapositive Laws of

More information

4 Derivations in the Propositional Calculus

4 Derivations in the Propositional Calculus 4 Derivations in the Propositional Calculus 1. Arguments Expressed in the Propositional Calculus We have seen that we can symbolize a wide variety of statement forms using formulas of the propositional

More information

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Why Learning Logic? Logic. Propositional Logic. Compound Propositions Logic Objectives Propositions and compound propositions Negation, conjunction, disjunction, and exclusive or Implication and biconditional Logic equivalence and satisfiability Application of propositional

More information

DISCRETE MATHEMATICS BA202

DISCRETE MATHEMATICS BA202 TOPIC 1 BASIC LOGIC This topic deals with propositional logic, logical connectives and truth tables and validity. Predicate logic, universal and existential quantification are discussed 1.1 PROPOSITION

More information

Topics in Logic and Proofs

Topics in Logic and Proofs Chapter 2 Topics in Logic and Proofs Some mathematical statements carry a logical value of being true or false, while some do not. For example, the statement 4 + 5 = 9 is true, whereas the statement 2

More information

Logic. Propositional Logic: Syntax

Logic. Propositional Logic: Syntax Logic Propositional Logic: Syntax Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about

More information

cis32-ai lecture # 18 mon-3-apr-2006

cis32-ai lecture # 18 mon-3-apr-2006 cis32-ai lecture # 18 mon-3-apr-2006 today s topics: propositional logic cis32-spring2006-sklar-lec18 1 Introduction Weak (search-based) problem-solving does not scale to real problems. To succeed, problem

More information

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference Logic? Propositional Logic (Rosen, Chapter 1.1 1.3) TOPICS Propositional Logic Truth Tables Implication Logical Proofs 10/1/12 CS160 Fall Semester 2012 2 What is logic? Logic is a truth-preserving system

More information

Supplementary Logic Notes CSE 321 Winter 2009

Supplementary Logic Notes CSE 321 Winter 2009 1 Propositional Logic Supplementary Logic Notes CSE 321 Winter 2009 1.1 More efficient truth table methods The method of using truth tables to prove facts about propositional formulas can be a very tedious

More information

Mathematical Reasoning. The Foundation of Algorithmics

Mathematical Reasoning. The Foundation of Algorithmics Mathematical Reasoning The Foundation of Algorithmics The Nature of Truth In mathematics, we deal with statements that are True or False This is known as The Law of the Excluded Middle Despite the fact

More information

Logic, Sets, and Proofs

Logic, Sets, and Proofs Logic, Sets, and Proofs David A. Cox and Catherine C. McGeoch Amherst College 1 Logic Logical Operators. A logical statement is a mathematical statement that can be assigned a value either true or false.

More information

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula: Logic: The Big Picture Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about time (and

More information

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics Unit I LOGIC AND PROOFS B. Thilaka Applied Mathematics UNIT I LOGIC AND PROOFS Propositional Logic Propositional equivalences Predicates and Quantifiers Nested Quantifiers Rules of inference Introduction

More information

Propositional Logic. Spring Propositional Logic Spring / 32

Propositional Logic. Spring Propositional Logic Spring / 32 Propositional Logic Spring 2016 Propositional Logic Spring 2016 1 / 32 Introduction Learning Outcomes for this Presentation Learning Outcomes... At the conclusion of this session, we will Define the elements

More information

Mat 243 Exam 1 Review

Mat 243 Exam 1 Review OBJECTIVES (Review problems: on next page) 1.1 Distinguish between propositions and non-propositions. Know the truth tables (i.e., the definitions) of the logical operators,,,, and Write truth tables for

More information

Propositional Logic: Syntax

Propositional Logic: Syntax Logic Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about time (and programs) epistemic

More information

Truth-Functional Logic

Truth-Functional Logic Truth-Functional Logic Syntax Every atomic sentence (A, B, C, ) is a sentence and are sentences With ϕ a sentence, the negation ϕ is a sentence With ϕ and ψ sentences, the conjunction ϕ ψ is a sentence

More information

Logic. Quantifiers. (real numbers understood). x [x is rotten in Denmark]. x<x+x 2 +1

Logic. Quantifiers. (real numbers understood). x [x is rotten in Denmark]. x<x+x 2 +1 Logic One reason for studying logic is that we need a better notation than ordinary English for expressing relationships among various assertions or hypothetical states of affairs. A solid grounding in

More information

15414/614 Optional Lecture 1: Propositional Logic

15414/614 Optional Lecture 1: Propositional Logic 15414/614 Optional Lecture 1: Propositional Logic Qinsi Wang Logic is the study of information encoded in the form of logical sentences. We use the language of Logic to state observations, to define concepts,

More information

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional Logical Operators Conjunction Disjunction Negation Exclusive Or Implication Biconditional 1 Statement meaning p q p implies q if p, then q if p, q when p, q whenever p, q q if p q when p q whenever p p

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics Statistics York University Sept 18, 2014 Outline 1 2 Tautologies Definition A tautology is a compound proposition

More information

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9 Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9 Typeset September 23, 2005 1 Statements or propositions Defn: A statement is an assertion

More information

III. Elementary Logic

III. Elementary Logic III. Elementary Logic The Language of Mathematics While we use our natural language to transmit our mathematical ideas, the language has some undesirable features which are not acceptable in mathematics.

More information

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B Discrete Math Review Discrete Math Review (Rosen, Chapter 1.1 1.7, 5.5) TOPICS Sets and Functions Propositional and Predicate Logic Logical Operators and Truth Tables Logical Equivalences and Inference

More information

Manual of Logical Style

Manual of Logical Style Manual of Logical Style Dr. Holmes January 9, 2015 Contents 1 Introduction 2 2 Conjunction 3 2.1 Proving a conjunction...................... 3 2.2 Using a conjunction........................ 3 3 Implication

More information

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010) http://math.sun.ac.za/amsc/sam Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics 2009-2010 Lecture notes in progress (27 March 2010) Contents 2009 Semester I: Elements 5 1. Cartesian product

More information

EECS 1028 M: Discrete Mathematics for Engineers

EECS 1028 M: Discrete Mathematics for Engineers EECS 1028 M: Discrete Mathematics for Engineers Suprakash Datta Office: LAS 3043 Course page: http://www.eecs.yorku.ca/course/1028 Also on Moodle S. Datta (York Univ.) EECS 1028 W 18 1 / 26 Why Study Logic?

More information

THE LOGIC OF COMPOUND STATEMENTS

THE LOGIC OF COMPOUND STATEMENTS CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS Copyright Cengage Learning. All rights reserved. SECTION 2.1 Logical Form and Logical Equivalence Copyright Cengage Learning. All rights reserved. Logical Form

More information

Introduction to Metalogic

Introduction to Metalogic Philosophy 135 Spring 2008 Tony Martin Introduction to Metalogic 1 The semantics of sentential logic. The language L of sentential logic. Symbols of L: Remarks: (i) sentence letters p 0, p 1, p 2,... (ii)

More information

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Packet #1: Logic & Proofs. Applied Discrete Mathematics Packet #1: Logic & Proofs Applied Discrete Mathematics Table of Contents Course Objectives Page 2 Propositional Calculus Information Pages 3-13 Course Objectives At the conclusion of this course, you should

More information

Logic. Propositional Logic: Syntax. Wffs

Logic. Propositional Logic: Syntax. Wffs Logic Propositional Logic: Syntax Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about

More information

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic Discrete Mathematical Structures Chapter 1 he oundation: Logic 1 Lecture Overview 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Quantifiers l l l l l Statement Logical Connectives Conjunction

More information

Knowledge Representation and Reasoning

Knowledge Representation and Reasoning Knowledge Representation and Reasoning Geraint A. Wiggins Professor of Computational Creativity Department of Computer Science Vrije Universiteit Brussel Objectives Knowledge Representation in Logic The

More information

CITS2211 Discrete Structures Proofs

CITS2211 Discrete Structures Proofs CITS2211 Discrete Structures Proofs Unit coordinator: Rachel Cardell-Oliver August 13, 2017 Highlights 1 Arguments vs Proofs. 2 Proof strategies 3 Famous proofs Reading Chapter 1: What is a proof? Mathematics

More information

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas. 1 Chapter 1 Propositional Logic Mathematical logic studies correct thinking, correct deductions of statements from other statements. Let us make it more precise. A fundamental property of a statement is

More information

MA103 STATEMENTS, PROOF, LOGIC

MA103 STATEMENTS, PROOF, LOGIC MA103 STATEMENTS, PROOF, LOGIC Abstract Mathematics is about making precise mathematical statements and establishing, by proof or disproof, whether these statements are true or false. We start by looking

More information

MAT2345 Discrete Math

MAT2345 Discrete Math Fall 2013 General Syllabus Schedule (note exam dates) Homework, Worksheets, Quizzes, and possibly Programs & Reports Academic Integrity Do Your Own Work Course Web Site: www.eiu.edu/~mathcs Course Overview

More information

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic Mathematics 114L Spring 2018 D.A. Martin Mathematical Logic 1 First-Order Languages. Symbols. All first-order languages we consider will have the following symbols: (i) variables v 1, v 2, v 3,... ; (ii)

More information

Axiomatic set theory. Chapter Why axiomatic set theory?

Axiomatic set theory. Chapter Why axiomatic set theory? Chapter 1 Axiomatic set theory 1.1 Why axiomatic set theory? Essentially all mathematical theories deal with sets in one way or another. In most cases, however, the use of set theory is limited to its

More information

Logic and Proofs. (A brief summary)

Logic and Proofs. (A brief summary) Logic and Proofs (A brief summary) Why Study Logic: To learn to prove claims/statements rigorously To be able to judge better the soundness and consistency of (others ) arguments To gain the foundations

More information

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1. Chapter 1 Chapter Summary Propositional Logic The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.3) Predicate Logic The Language of Quantifiers (1.4) Logical Equivalences (1.4)

More information

Section 1.1: Logical Form and Logical Equivalence

Section 1.1: Logical Form and Logical Equivalence Section 1.1: Logical Form and Logical Equivalence An argument is a sequence of statements aimed at demonstrating the truth of an assertion. The assertion at the end of an argument is called the conclusion,

More information

(Refer Slide Time: 02:20)

(Refer Slide Time: 02:20) Discrete Mathematical Structures Dr. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 5 Logical Inference In the last class we saw about

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 15 Propositional Calculus (PC)

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 15 Propositional Calculus (PC) Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 15 Propositional Calculus (PC) So, now if you look back, you can see that there are three

More information

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS 1.1 - Logical Form and Logical Equivalence Definition. A statement or proposition is a sentence that is either true or false, but not both. ex. 1 + 2 = 3 IS a statement

More information

Handout on Logic, Axiomatic Methods, and Proofs MATH Spring David C. Royster UNC Charlotte

Handout on Logic, Axiomatic Methods, and Proofs MATH Spring David C. Royster UNC Charlotte Handout on Logic, Axiomatic Methods, and Proofs MATH 3181 001 Spring 1999 David C. Royster UNC Charlotte January 18, 1999 Chapter 1 Logic and the Axiomatic Method 1.1 Introduction Mathematicians use a

More information

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional) Discrete Math Review Discrete Math Review (Rosen, Chapter 1.1 1.6) TOPICS Propositional Logic Logical Operators Truth Tables Implication Logical Equivalence Inference Rules What you should know about propositional

More information

1.1 Language and Logic

1.1 Language and Logic c Oksana Shatalov, Fall 2017 1 1.1 Language and Logic Mathematical Statements DEFINITION 1. A proposition is any declarative sentence (i.e. it has both a subject and a verb) that is either true or false,

More information

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics CSC 224/226 Notes Packet #2: Set Theory & Predicate Calculus Barnes Packet #2: Set Theory & Predicate Calculus Applied Discrete Mathematics Table of Contents Full Adder Information Page 1 Predicate Calculus

More information

Intro to Logic and Proofs

Intro to Logic and Proofs Intro to Logic and Proofs Propositions A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both. Examples: It is raining today. Washington

More information

Manual of Logical Style (fresh version 2018)

Manual of Logical Style (fresh version 2018) Manual of Logical Style (fresh version 2018) Randall Holmes 9/5/2018 1 Introduction This is a fresh version of a document I have been working on with my classes at various levels for years. The idea that

More information

Chapter 4, Logic using Propositional Calculus Handout

Chapter 4, Logic using Propositional Calculus Handout ECS 20 Chapter 4, Logic using Propositional Calculus Handout 0. Introduction to Discrete Mathematics. 0.1. Discrete = Individually separate and distinct as opposed to continuous and capable of infinitesimal

More information

Logic and Proof. Aiichiro Nakano

Logic and Proof. Aiichiro Nakano Logic and Proof Aiichiro Nakano Collaboratory for Advanced Computing & Simulations Department of Computer Science Department of Physics & Astronomy Department of Chemical Engineering & Materials Science

More information

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises WUCT11 Discrete Mathematics Logic Tutorial Exercises 1 Logic Predicate Logic 3 Proofs 4 Set Theory 5 Relations and Functions WUCT11 Logic Tutorial Exercises 1 Section 1: Logic Question1 For each of the

More information

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction. Statements Compounds and Truth Tables. Statements, Negations, Compounds, Conjunctions, Disjunctions, Truth Tables, Logical Equivalence, De Morgan s Law, Tautology, Contradictions, Proofs with Logical Equivalent

More information

Propositional Logic. Fall () Propositional Logic Fall / 30

Propositional Logic. Fall () Propositional Logic Fall / 30 Propositional Logic Fall 2013 () Propositional Logic Fall 2013 1 / 30 1 Introduction Learning Outcomes for this Presentation 2 Definitions Statements Logical connectives Interpretations, contexts,... Logically

More information

Predicates, Quantifiers and Nested Quantifiers

Predicates, Quantifiers and Nested Quantifiers Predicates, Quantifiers and Nested Quantifiers Predicates Recall the example of a non-proposition in our first presentation: 2x=1. Let us call this expression P(x). P(x) is not a proposition because x

More information

PROPOSITIONAL CALCULUS

PROPOSITIONAL CALCULUS PROPOSITIONAL CALCULUS A proposition is a complete declarative sentence that is either TRUE (truth value T or 1) or FALSE (truth value F or 0), but not both. These are not propositions! Connectives and

More information

Review of Predicate Logic

Review of Predicate Logic Review of Predicate Logic Martin Held FB Computerwissenschaften Universität Salzburg A-5020 Salzburg, Austria held@cosy.sbg.ac.at 19. Jänner 2016 COMPUTERWISSENSCHAFTEN Legal Fine Print and Disclaimer

More information

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1 EECS 70 Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1 Getting Started In order to be fluent in mathematical statements, you need to understand the basic framework of the language

More information

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures Formal Logic: Quantifiers, Predicates, and Validity CS 130 Discrete Structures Variables and Statements Variables: A variable is a symbol that stands for an individual in a collection or set. For example,

More information

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows. Chapter 1 Logic 1.1 Introduction and Definitions Definitions. A sentence (statement, proposition) is an utterance (that is, a string of characters) which is either true (T) or false (F). A predicate is

More information

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship. LOGIC In mathematical and everyday English language, we frequently use logic to express our thoughts verbally and in writing. We also use logic in numerous other areas such as computer coding, probability,

More information

1.1 Language and Logic

1.1 Language and Logic c Oksana Shatalov, Spring 2018 1 1.1 Language and Logic Mathematical Statements DEFINITION 1. A proposition is any declarative sentence (i.e. it has both a subject and a verb) that is either true or false,

More information

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications: Tools for reasoning: Logic Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications: 1 Why study propositional logic? A formal mathematical language for precise

More information

Section 2.1: Introduction to the Logic of Quantified Statements

Section 2.1: Introduction to the Logic of Quantified Statements Section 2.1: Introduction to the Logic of Quantified Statements In the previous chapter, we studied a branch of logic called propositional logic or propositional calculus. Loosely speaking, propositional

More information

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang Proposition logic and argument CISC2100, Spring 2017 X.Zhang 1 Where are my glasses? I know the following statements are true. 1. If I was reading the newspaper in the kitchen, then my glasses are on the

More information

Where are my glasses?

Where are my glasses? Proposition logic and argument CISC2100, Spring 2017 X.Zhang 1 Where are my glasses? I know the following statements are true. 1. If I was reading the newspaper in the kitchen, then my glasses are on the

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

Section 1.3. Let I be a set. When I is used in the following context,

Section 1.3. Let I be a set. When I is used in the following context, Section 1.3. Let I be a set. When I is used in the following context, {B i } i I, we call I the index set. The set {B i } i I is the family of sets of the form B i where i I. One could also use set builder

More information

Section 3.1: Direct Proof and Counterexample 1

Section 3.1: Direct Proof and Counterexample 1 Section 3.1: Direct Proof and Counterexample 1 In this chapter, we introduce the notion of proof in mathematics. A mathematical proof is valid logical argument in mathematics which shows that a given conclusion

More information

Section 1.2: Propositional Logic

Section 1.2: Propositional Logic Section 1.2: Propositional Logic January 17, 2017 Abstract Now we re going to use the tools of formal logic to reach logical conclusions ( prove theorems ) based on wffs formed by some given statements.

More information

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another. Math 0413 Appendix A.0 Logic Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another. This type of logic is called propositional.

More information

Basic Logic and Proof Techniques

Basic Logic and Proof Techniques Chapter 3 Basic Logic and Proof Techniques Now that we have introduced a number of mathematical objects to study and have a few proof techniques at our disposal, we pause to look a little more closely

More information

Propositional logic (revision) & semantic entailment. p. 1/34

Propositional logic (revision) & semantic entailment. p. 1/34 Propositional logic (revision) & semantic entailment p. 1/34 Reading The background reading for propositional logic is Chapter 1 of Huth/Ryan. (This will cover approximately the first three lectures.)

More information

Proof strategies, or, a manual of logical style

Proof strategies, or, a manual of logical style Proof strategies, or, a manual of logical style Dr Holmes September 27, 2017 This is yet another version of the manual of logical style I have been working on for many years This semester, instead of posting

More information

Logic and Mathematics:

Logic and Mathematics: Logic and Mathematics: Mathematicians in Schools Program Lashi Bandara Mathematical Sciences Institute, Australian National University April 21, 2011 Contents 1 Russell s Paradox 1 2 Propositional Logic

More information

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic? Logic: Truth Tables CS160 Rosen Chapter 1 Logic? 1 What is logic? Logic is a truth-preserving system of inference Truth-preserving: If the initial statements are true, the inferred statements will be true

More information

Topic 1: Propositional logic

Topic 1: Propositional logic Topic 1: Propositional logic Guy McCusker 1 1 University of Bath Logic! This lecture is about the simplest kind of mathematical logic: propositional calculus. We discuss propositions, which are statements

More information

To every formula scheme there corresponds a property of R. This relationship helps one to understand the logic being studied.

To every formula scheme there corresponds a property of R. This relationship helps one to understand the logic being studied. Modal Logic (2) There appeared to be a correspondence between the validity of Φ Φ and the property that the accessibility relation R is reflexive. The connection between them is that both relied on the

More information

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Ivan Avramidi New Mexico Institute of Mining and Technology Socorro, NM 87801 June 3, 2004 Author: Ivan Avramidi; File: absmath.tex; Date: June 11,

More information

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2. CHAPTER 2 Review 2.1 Definitions in Chapter 2 2.1 Set; Element; Member; Universal Set 2.2 Subset 2.3 Proper Subset 2.4 The Empty Set, 2.5 Set Equality 2.6 Cardinality; Infinite Set 2.7 Complement 2.8 Intersection

More information

Discrete Mathematical Structures: Theory and Applications

Discrete Mathematical Structures: Theory and Applications Chapter 1: Foundations: Sets, Logic, and Algorithms Discrete Mathematical Structures: Theory and Applications Learning Objectives Learn about sets Explore various operations on sets Become familiar with

More information

CM10196 Topic 2: Sets, Predicates, Boolean algebras

CM10196 Topic 2: Sets, Predicates, Boolean algebras CM10196 Topic 2: Sets, Predicates, oolean algebras Guy McCusker 1W2.1 Sets Most of the things mathematicians talk about are built out of sets. The idea of a set is a simple one: a set is just a collection

More information

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations Chapter 1, Part I: Propositional Logic With Question/Answer Animations Chapter Summary Propositional Logic The Language of Propositions Applications Logical Equivalences Predicate Logic The Language of

More information