You are on page 1of 33

Discrete Mathematical Structures UNIT 1 Mathematical logic

Logic is a science of arranging knowledge in a systematical order. It mainly concern with reasoning whether they may be legal arguments or mathematical proofs or conclusion in a scientific theory based upon the set of hypotheses. It provides general rules called rules of inference that must be independent of any particular argument or discipline involved. (But any collections of rules or theory need a language in which these rules or theory can be stated). Since the natural languages are not satisfactory to serve this purpose. It is necessary to develop the formal language called the object language. The first half of this unit concerned with the development and analysis of the object language without considering its use in the theory of inference. This study has important applications in the design of computer and several other two state-devices. The remaining part deals with the study of inference theory and predicate calculus. We use symbols to define the languages without ambiguity, since it is very much amenable for lucid expression. That is why this kind of logic is also called symbolic logic. Pure mathematics is such a language: it is a symbolic formal logical language. Our study of object language needs one natural (human) language. Then our natural choice is English. It may be treated as a meta language. We expect some difficulty in using English as a meta language (object language) using another language (English) which is not so precise. 1.1 Statements: In this section we formally invoke some of the basic building blocks needed to develop a full pledged object language. They are called the primary statements or atomic statements. First we assume that our object language consist of declarative sentence which cannot be further divided into basic units. These declarative sentences should have only two logical values TRUE or FALSE (by symbols 1or 0). The truth value has nothing to do with our feelings regarding the primary statements. It is enough to assume that the statements can be assigned with logical values T or F. We are concerned in our study with the effect of assigning any particular truth value to declarative sentence rather than actual truth values of these sentences. Because of this aspect, a kind of logic called a two-valued or two-way logic is used. Remark: Only declarative sentences are admitted as primary statement is our object language. These kinds of sentences such as exclamatory, interrogative etc. are not allowed.

Declarative sentences used in the object language are of two types: Primary or primitive sentences (denoted by letter A, B, Cor A1, A2B1, B2) Connected primitive sentences (denoted by letter A, B, Ctogether with connectives).

As a sample, let us consider the following sentences. 1. 2. 3. 4. 5. 6. Go to school India is democratic country. 101 + 1 = 110 Mumbai is the capital of India. Man will reach Mars by 2010. This statement is false. The statements (2) and (4) have truth values true or false respectively. Statement (1) is not a statement it is a command. Statement (6) is a peculiar one since it is a self-contradictory statement (semantic paradox). Statement (4) may be true or false according to the context whether the number system in effect is binary or decimal. Statement (5) could be determined only in the year 2010 or earlier if a man reaches Mars before 2010. 1.2 Name of an object: It is always convenient to use the name of an object itself when making a statement about the object. This concept may well be illustrated by considering the statement. (6) This college is best. The expression This College is used as a name of the object. The actual object namely a particular college is not used in the statement. It would be inconvenient to put the actual college in place of the expression this college. Because of this hurdle, it is commonly accepted that a statement about an object should contain never the object itself but only its name. Now we are able to define name as an object about which statement is to be made. Thus we should not use the name itself in the statement but same name of the name. The usual way to do such representation is to enclose the name in quotation mark( ) and to treat it as a name for the name. For illustration we consider the following statements. (7) Haritha is clever. (8) Haritha contains two vowels. Statement (7) said something about a person whose name is Haritha. But statement (8) is not about a person but about a name. Here the object Haritha is used as a name of a name. Throughout this presentation (course content) we shall be making statements not only about object but also about other statements or expressions. Next we consider an expression as a name. (9) Haritha is clever contains three words. Here statement (9) is primitive statement about the statement (7). The whole statement (7) is considered as a single unit (name) in statement (9).

Another way of naming a statement is to display a statement separated from the main text . For example, (10) Haritha is clever contains Haritha

in a line

But this kind of representation is less effective than marking inside quotations. So we prefer the previous method of naming throughout the material. Further we have sometimes numbered these statements by inserting a number to the left of this statement. This number can be used within the text to indicate (name) the statement. A judicious combination of all the above methods of naming techniques is used throughout this course to describe the language structure. Now we are in a convenient position to write the statement. (11) Haritha is clever is true. (12) (7) is true. The above representation is confirmed with accepted principle of substitution of pronouns for nouns in English grammar or multiple name substitution. Unfortunately, in most of the Mathematical writings (books or articles) the difference is not given explicity, the reader has to distinguish the name and object according to the context. This kind of catastrophic events occurs while implementing procedures or subroutines in programming languages. The distinction between the name of the variable and its value is frequently required in these kinds of implementations. The arguments (actual parameters) in the programming statement, which invokes the procedure, are associated with the (formal) parameters of the procedure either by name or by value. If the association is made by value, only the value of the argument is passed to its corresponding parameter. This implies that we cannot change the value of the argument from within the function since it is not known where this argument is stored in the computer memory. On the other hand, a call-by name makes the name or address of the argument available to the procedure .In this case change of values are allowed within the procedure by an instruction (statement). Certain languages like FORTRAN and PL/I are facing these kinds of name-values conflict analogous to our name-object representation in the object language. The course taker may realize them when they implement them in problem solving session. Turning to our main focus area of symbolic logic, we use capital letters A, B, C,P, Q(with the exception of T and F) as well as subscripted capital letters A1, A2B1,B2,to represent primitive statements . With in notation, we write (13) P: It is raining today.

In statement (13) we are including the information that P is a statement in symbolic logic which corresponds to the statement in English, It is raining today. 1.3 Connectives In this section we introduce rather complicated statements from simple statements using connecting words or expressions (operators!). These connecting elements are called sentential connectives. The conjunction used in English language are and, or, but etc. Here we introduce connectives by means of symbols and then develop methods to determine the truth values of statements that are formed by using them. Various properties of these statements and some relationship between them are also discussed. In order to give formal structure to our object language, we define the statement set together with the connective operators, as an algebra. This peculiar algebra satisfies some important properties. Using these properties we can do some calculations by using statements and objects. The algebra A defined here has important applications in the field of switching theory and logical designs of computers. These structural relations involved in the statement algebra can be used in inference theory. As mentioned earlier the simple statements in the object language are called atomic or primary statements. Also new statements can be formed from atomic statements using sentential connectives. The resulting statements are called molecular or compound statements. The usual connectives and, or and but used in English language are not precise and unambiguous. Since we need a precise language with exact connective, we will not symbolize the above conjunctions in our object language. However we use connectives, which have some resemblance to the connectives in English language. Like the notations for atoms (primitive sentence) as A, B, C A1, A2B1,B2,we denote arbitrary statements (compound or simple) by the some capital letter symbols. In the new perspective, a statement P either denote a particular statement or serve as a place holder for any statement whatsoever. This dual use of the same symbol to denote either a definite statement (constant) or an arbitrary statement (variable) does not cause any confusion as its use will clear from the context. The truth value of P is the truth value of actual statement which represents. When P is used as a statement variable it has no truth value and as such does not represent a statement in symbolic logic. It is convenient to call P in this case a statement formula. We often abbreviate the term statement formula. Then the truth value of P could be determined. However in the sections that follow we often abbreviate the term statement formula simply by statement. Now we feel free to see the meaning of the connectives so far introduced. Consider the statements:

P : It is a sunny day Q : It is freezing Let R be a statement variable with possible values P and Q. Here R has no truth values, where as P and Q has valid truth values, because they are statements. 1.3.1. Negations: The negation of a statement is generally formed by introducing the word not at a proper place in the statement or by prefixing the statement with the phrase it is not the case that. If P denotes a statement then P denotes the negation of statement P. If the truth value of P is T, then the truth value of P is F and vice versa. We can construct the truth table as fallows: Table 1.3.1 TRUTH TABLE for P P P T F F T

Let us consider a primary statement 1. P: India is a country. Then P denotes the statement 2. P : It is not the case that India is a country(some say that it is a continent!). Normally negation of statement P can be written as 3. P : India is not a country. Even though the two statements (2) and (3) are not identical. We have translated both of them by P, since they have the same meaning in English. A statement given in symbolic form (object language) may correspond to statements in English. This kind of polymorphism occurs in all natural language because one can express oneself in a variety of ways .To illustrate this we consider the following: If P: Haritha went to school yesterday, is a primitive statement then p is any one of the following statement 1. P : Haritha did not go to school yesterday. 2. P : Haritha was absent from school yesterday. 3. P : It is not the case that I went to school yesterday. Other symbols used to denote negations in the literature are ~, tilted bar (~) or NOT. That is P is written as ~P, We treat negation as connective even though it only modifies statement. In a real sense negation is a unary operator, which operator as a single statement and generates a new statement.

1.3.2 Conjunction: The conjunction of two statements P and Q is denoted as P Q, read as P and Q. This statement PQ has truth value T when both P and Q has same truth value T otherwise the truth value is F. The following truth table depicts the truth value. Consider the following example for more clarity: P : The climate is hot Q : Boys are playing cricket The conjunction of the above statements can be well represented as PQ : The climate is hot and boys are playing cricket.

P T T F F

Q T F T F

PQ T F F F

Normally in human language there is relation between statements to be joined by and, but in our object language that relation is not necessary. Look at the following conjunction: Today is Sunday and area of rectangle = l x b, the primary statements Today is Sunday and Area of Rectangle =l x b has no particular relation. Let us analyze little deep to understand the use of conjunction and in natural (human) language and our object (logic) language. Look at the two statements A: Ram and Rahim went up the hill. B: Ram and Rahim are friends. In statement (A) and is used as a conjunction. We are able to paraphrase the statement as, Ram went up the hill and Rahim went up the hill. This leads a natural translation to symbolic form. P : Ram went up the hill. Q : Rahim went up the hill, with the combination PQ = A Eventhough look like the statement (B) cannot be translated into the symbolic form, because and used in that statement is not in conjunction sense. For further clarity let us consider the following statements. 1. Roses are red and violets are blue 2. He received the letter and started to read. 3. Krishna and Arjuna are cousins. In statement (1) the conjunction and is used in the same sense as the symbol . In (2) the word and is used in the sense. In statement (3) the word and is not a conjunction (symbolic translation is invalid).

Remarks: The conjunction symbol is a binary operator in the sense that it operates on two different statement to produce a single statement. The conjunction in object language is symmetric. That is P Q Q P for all statements P and Q. Eventhough and used in English language in different senses, we took only the particular conjunction sense with symmetric for our symbolic logic language. 1.3.3 Disjunction The disjunction of two statement P and Q is the statement P Q, which is read as P or Q . P: Vivetha watches the game on television. Q: Vivetha goes to cinema. P Q : Vivetha watches the game on television or goes to cinema. In the above conjunction OR is used as a connective in exclusive sense (either one of the event will occur not both). The connective OR is used in two different sense (exclusive or and inclusive or ) which is different from the use of not and and with unique sense argument. The statements P Q has truth value F only when both P and Q have the truth value F otherwise its value is T (see table 1.3.3). For illustration, consider the following statements: 1. I shall go to the market or to the shop. 2. There is something wrong with the teacher or with the student. 3. Thirty or thirty five men were killed in the bomb blast. In statement (1), the connective OR is used in the exclusive sense : one or the other possibility of the occurrence is expected but not both. This is a exclusive OR case. In statement (2) the intended meaning is clearly the occurrence of one or the other or both. The connective OR is used in this case inclusive OR. In statement (3) the word OR is used to denote the approximations of number sense, so it is not connective, it cannot be interpreted as in symbol. From the definition of disjunction it is clear that is inclusive OR. The symbol comes from the Latin word vel which is the inclusive OR. Remark: The natural question arises here is how one can represent the exclusive OR, in our symbolic language. The answer is direct. It is not necessary to define the new symbol for this, because the existing connective symbols are enough to do this job (see section 1.3.14). In natural language use, there should exists a relation between the statements to be joined by the connective OR, but it is not necessary in symbolic language. The truth value of P Q depends upon the truth value of P and Q. The connective is also symmetric in the sense that P Q Q P for all statements P and Q here. means equivalence (defined later).

It may be necessary to paraphrase given statement in English before they can be translated into symbolic form and vice versa. As in the case of disjunction connective is also a binary operator, which generates a single statement from two different statements. The truth table for connective can be depicted as follows: Table 1.3.3 Truth table for disjunction P T T F F Q T F T F PQ T T T F

1.3.4 Statement Formulae: So far we studies connectives , and and their properties, and tried to distinguish between two types of statements namely atomic or primary statements and molecular or composite or compound statements. For example if P and Q are, any two statements, then sense of the compound statements formed by using P and Q are P, P Q, P Q, (P Q) P, Q and P ( Q). Here P and Q are compounds of the statement formulas. The constructions of statement formulas are a process in which parenthesis play vital roles as in elementary arithmetic or algebra or in computer programming language. The expression in the innermost parenthesis is simplified first. (i) (P Q) means the negation of P Q. (ii) (P Q) (Q P) means the disjunction of (P Q) and (Q P) Truth Table: Our basic concern is to determine the truth value of a statement formula for each possible combination of truth values of the compound statement. A table which shows truth values for all combination OF truth values of the component statement formula is called truth table. Suppose a statement formula has only two components say P and Q, then there are 22 possible combinations of truth values that must be considered. Thus each of the row has 22 rows. In general if there are n distinct components in a statement formula, then one has to be consider 2n possible combination of truth values in order to obtain the truth table for the formula. There are two methods to construct truth tables as shown in the following examples. Example 1: Construct the truth table for the statement formula P ( Q). Method 1 Table 1.3.4 (A) P Q Q P ( Q) T T F T T F T T F T F F F F T T

Method 2 P T T F F

Table 1.3.4 Q P T T F T T F F F

(B) T T F T F T F T Q T F T F

Step 1 3 2 1 The truth values of statements (atoms) are given in the column 1 and 2 of both tables 1.3.4 (a & b). In method 1, and the truth values of Q are extended in the third column and the truth value of P Q are extended in the fourth column. In method 2, a column is drawn for each statement as well as for the connectives to appear. The truth values are entered step by step. The sequence followed in arriving the final step is given at the bottom of the table. (table 1.3.5 ). Example: 2 Construct the truth table for P P.

Solution: The truth tables for PP can be constructed by the above mentioned methods and one depicted in the tables: 1-3-5. P P P P T F F F T F P T F 1 P T F 3 F F 2 F T 1 P T F

Example: 3 Construct the truth table for (P Q) P Solution: We can follow any one of the methods to construct the table as follows: Table 1-3-6 (method 1) P T T F F Q T F T F PQ T T T F P F F T T (PQ) P T T T T

Method 2 P Q T T F F T F T F Step

P T T F F 1

T T T F 2

Q T F T F 1

T T T T 3

F F T T 2

P T T F F 1

We observe that truth values of (P Q) P is independent of the truth values of P and Q. the formula is a specifically constructed are, we can see later its implications. Example 4: Construct the truth table for ( P ( Q R )) ((Q R) (P R)) Solution: Let S = ( P ( Q R )) ((Q R) (P R)) P T T T T F F F F Q T T F F T T F F R T F T F T F T F P F F F F T T T T Q F F T T F F T T (QR) (PR) T T F F F T F F T F F F F F F F QR F F T F F F T F P (QR ) ( QR ) (PR) F T F F F T F F F T F F T F F F S T F T F T F T F

Example 5: Construct the truth table for ( P Q ) ( P Q ) ( P Q) ( P Q ) Solution: Let S = ( P Q ) ( P Q ) ( P Q) ( P Q ) R = ( P Q) ( P Q ) T= ( P Q ) ( P Q ) Then S = T R P T T F F Q T F T F P F F T T Q F T F T PQ T F F F PQ F F T F PQ F T F F PQ F F F T T T F T F R F T F T S T T T T

Remark: If the truth values of the component are known these the truth value of resulting statement can be readily determined from the truth table.

Exercise :1-3-4 1. Consider the statements P : Muthu is intelligent. Q : Muthu is happy. Transulate the following statement in symbolic form. (a)Muthu is intelligent but unhappy. (b)Muthu is not intelligent or happy. Muthu is neither intelligent nor happy. (d)Muthu is intelligent or he is both not intelligent and happy. (e)Muthu is not intelligent but happy. 2. Construct truth tables for the following formula: (a) PQ (b) (P Q) (c) P (P Q) (d) P (Q P) (e) ( P ( Q R)) (P R) (f) ( P Q) ( P Q) ( P Q) ( P Q) 3. For what truth values will the following statements be true? If is not the case that roses are red or white and if is false that flowers are beautiful or roses are black. 4. Construct truth tables for the statement formulas. (a) P P (b) (P Q) P 5. Given the truth values of P and Q as T and than if R and S as F,find the truth values of the following. (a) P (Q R) (b)(P (Q R)) ((P Q) (R S)) (c) ( (P Q) R) ((( P Q) R) S) 1.3.5. Conditional and Biconditional connectives: Two statements P and Q can be joined together symbolically as PQ, with regard to the relationship between them. This type of connecting relation is read as If P, then Q and is called conditional statement PQ has truth value F, whenever P has value T; Q also has value T. Otherwise its value is F. The following table depicts the truth values: TRUTH TABLE FOR CONDITIONAL STATEMENTS: P Q PQ T T T T F T F T T F F F

Example1:

P : I am hungry (True) Q : I will eat (True) PQ : If I am hungry, then I will eat.(True)

Example2:

P : The sun is shining today.(True) Q : 2+8 = 6 .(False) PQ : If the sun is shining today, then 2+8=6.(false) P : 2+5=8.(False) Q : 7+3=9.(False) PQ : If 2+5=8, then 7+3=9.(True) P : I do not get the money.(True) Q : I shall buy the car. (True) PQ : If I do not get the money, then I shall buy the car. .(True)

Example3:

Example 4:

Example5: Convert the following sentences into a logical expression. (i) You can access the Internet from campus only if you are a computer science major or you are not a freshman. A : You can access the Internet from campus. B : You are a computer science major. C : You are a freshman. C : You are not a freshman. a( b c) (ii) Write the following statement in symbolic form. If either Ram takes calculus or Krishna takes sociology, then Sita will take English. A : Ram takes calculus. B: Krishna takes sociology. C: Sita takes English. (a b)c Example: If you receive a grade 95 or above in the final examination, then you will receive an A in the examination (condition) Case1: Secure>95 received A told truth Case2: Sc>95 did not receive A lied Case3: Sc<95 did not receive A told truth (condition false) Case4: Sc<95 received A lied (condition false) T.T T T.F F F.F T F.T T Therefore P is true, Q is false, PQ is false. Note: 1. In this implication P is called the hypothesis (or antecedent or premise) and Q is called the conclusion (or consequence).

2.

It is not necessary that there by any kind of relation between P and Q in order to form PQ.

Biconditional statement: If P and Q are any two statements, then the statement P Q or PQ which is read as P if and only if Q is called Biconditional statement. The statement PQ has the truth value T when ever both T whenever both P and Q have identical truth-values; otherwise it has truth value F. The truth table for the Biconditional statement is as follows: P T T F F Q T F T F PQ T F F T

Examples: 1. Construct the truth table for the formula ( P Q) ( P Q) Solution: P Q P Q T T F F T F T F T F F F ( P Q) P F T T T F F T T Q F T F T PQ F T T T ( P Q) (P Q) T T T T

2. Construct the truth table for the formula ( P (Q R)) ((P Q) (P R)) Solution: P Q R Q R T T T T F F F F T T F F T T F F T F T F T F T F T F F F T F F F P(QR) PQ PR T T T T T F F F T T T T T T F F T T T T T F T F (PQ) (PR) =Y T T T T T F F F ( P(Q R)) =X F F F F F T T T X Y F F F F F F F F

1.4 Tautologies: A statement that is true for all possible values of its propositional variables is called a tautology or universally valid formula or a logical truth. For tautologies an entry in the final column of the truth table depends only on the truth values of the statements assigned to the variables rather than as the statements themselves. Truth value of a statement formula means the entries with final column of the truth table of the formula. Contradiction: A statement that is always false is called a contradiction or absurdity. Note: 1. The negation of a contradiction is a tautology. 2. A propositional function that is neither tautology nor a contradiction is called a contingency. Example 1: Show that P P is a tautology. Solution: p p P p T F F T T F

In the resulting column all the entries are F. Therefore PP is tautology. Example 2: Show that P P is a contradiction. Solution: P T F P F T P P F F

In the resulting column all the entries are F. Therefore P P is a contradiction .

Example3: Show that Q (P Q) ( P Q) is a tautology. Solution: P Q P Q P Q P Q Q (PQ) T T F F F T F T T F F F T T T F T F F T F T F F F F F F F T T T T T F

Q (P Q) ( P Q) T T T T T

Since the truth value in the last column is T, the given formula is a tautology. Example 4: Using the truth table verify that the proposition (P Q) (P Q) P T T F F Q T F T F PQ T F F F PQ T T T F (P Q) F F F T (P Q) (P Q) F F F F

All the entries in the last column are F therefore the given proposition is a contradiction. Exercise: 1) Show that the proposition (PQ)(QP) is a tautology. 2) Verify that the proposition P (PQ) is tautology. 1.5 Equivalence of formulas: A and B are two statement formulas P1, P2, , Pn denote all variables occurring in A and B. Consider an assignment of truth values to P1, P2, , Pn and the resulting truth values of A and B. If the truth value of A is equal to the truth value of B for everyone of the 2n possible sets of truth values assigned to P1, P2, , Pn then A and B are said to be equivalent. The equivalent of two formulas A and B is represented by writing A B: A is equivalent to B.

Equivalence is a symmetric relation . i.e A is equivalent to B is same as B is equivalent to A. Example 1: Show that P Q P Q and Q P Q P P T T F F Q T F T T PQ T F T T P F F T T P Q T F T T QP T T F T Q P T T F T

Hence P Q P Q And Q P Q P. Duality Law: Two formulas A and A* are said to be duals of each other if either one can be obtained from the other by replacing by and by . The connectives and are each other. If the formula A contains the special variable T or F then A*, its dual is obtained by replacing T by F and F by T in addition to the above mentioned interchanges. Example 1: Write the dual of a) (P Q) R b) (P Q ) ( P (Q S )

Solution: a) The dual of (P Q) R is (P Q) R b) The dual of (P Q ) ( P (Q S ) is (P Q ) ( P (Q S ) Theorem 1: Let A and A * be dual formulas and let P1, P2,, Pn be all the atomic variables that occur in A and A*. That is to say, we may write A as A (P1, P2,, Pn) and A* as A* (P1, P2,, Pn) By De Morgans laws P Q (P Q) P Q (P Q) (1)

We can show A (P1, P2,, Pn) A*( P1, P2, Pn)

Thus the negation of a formula is equivalent to its dual in which every variable is replaced by its negation. As a consequence of this fact, we also have A (P1, P2, Pn) A* (P1, P2,, Pn) Example 2: Verify the equivalence (1) if A ( P, Q, R) is P (Q R). Solution: Now A*(P, Q, R) is P (Q R), and A* (P, Q, R) is (2)

P (Q R) P ( Q R). On the other hand , A (P, Q, R) is (P (Q R)) P ( Q R) Hence (3) (4).

(3) (4)

Theorem 2: Let P1, P2,, Pn be all the atomic variables appearing in the formulas A and B. Given that A B means A B is tautology, then the following are also tautologies. A (P1, P2,, Pn) B(P1, P2,, Pn) A (P1, P2, Pn) B (P1, P2, Pn) Using (2), we get A* (P1, P2,, Pn) B* (P1, P2,, Pn) Hence A* B*.

Example3: Show that (P Q) ( P ( P Q)) ( P Q) Solution: (P Q) ( P ( P Q)) (P Q) ( P ( P Q)) (P Q) ( P Q) (P Q) P Q (( P P) (Q P )) Q (Q P) Q Q P P Q From (5) it follow that (P Q) ( P ( P Q)) P Q Writing the duals, (P Q) ( P ( P Q)) P Q. 1.6 Well formed formulas: A well formed formula (wff ) can be generated by the following rules: 1. A Statement variable standing alone is a wff. 2. If A is a wff then A is also a wff. (5)

3. If A and B are wffs then (A B), (A B), (AB)and (AB) are all wffs. 4. A string of symbols containing the statement variables. Connectives and parentheses is a wff,if it can be obtained by finitely many applications of rules 1,2and 3. Exclusive OR Connective Let P and Q be any two formulas. Then the formula P V Q in which the connective V is called an exclusive OR is true. Whenever either P or Q but not both is true. Exclusive OR is also called exclusive disjunction.

The following equivalences are follow from its definition. 1. P V Q Q V P 2. (P V Q) V R P (Q V R) 3. P (Q V R) (PQ ) V (PR) 4. (P V Q ) (P Q) ( P Q) 5. (P V Q) (PQ) Table for exclusive OR : (P V Q ) P T T F F Q T F T F PVQ F T T T (symmetric) (associative) (distributive)

1.7 Functionally sets of connectives

So far we have defined the connectives , , ,and and also we introduce a new connective namely exclusively or V . But not all the connectives are defined so far are necessary to define the statement formula in the symbolic language. We can find certain proper subsets of these connectives which are sufficient to express any expression in an equivalent form. Such a subset is called a functionally complete set of connectives. That is connectives which can be expressed interm of other connectives. 1. P Q P Q

2. P Q P Q 3. P Q Q P 4. P Q (P Q) (Q P)
( P Q) ( Q P)

The above example suggest that in any formula we can replace the part containing the , , , ,and by an equivalent formula not containing them respectively. Consider exercise P (Q R) P (( Q R) ( R Q ))
P (( Q R) ( R Q ))

[ The De Morgans law P Q (P Q) P Q (P Q) ] If we implement all the steps suggested above first replace all the biconditional, then conditional and finally all the conjunctions or all the disjunctions. In any formula to obtain an equivalent formula. This formula contains either the negation and disjunction only or negation and conjunction only. Hence {, }and {, }are functionally set of connectives.
1.8 NAND and NOR Connectives

NAND is a combination of NOT and AND where NOT shows negation and AND for conjunction. NAND is denoted by the symbol . For any two formulas P and Q. PQ (PQ) : (NOT and AND) NOR is a combination of NOT and OR. NOR is denoted by . P Q (P Q)
REMARKS:

The sets {{ }} or {} are not functionally complete and also {,} is also functionally incomplete. and are duals of each other. P P (P P) P P P (P Q) (P Q) ( P Q) PQ (P P) (Q Q) ( P) ( Q) ( P Q) P Q

In a similar manner, the following equivalences express , , and interms of alone.


P P (P P) P P P (P Q) (P Q) ( P Q) P Q (P P) (Q Q) ( P) ( Q) P Q

Converse and Contrapositive. Q, the proposition Q P is called its converse, and the For the proposition P P is called its contrapositive. proposition Q

For example for the proposition "If it rains, then I get wet",
Converse: If I get wet, then it rains. Contrapositive: If I don't get wet, then it does not rain.

The converse of a proposition is not necessarily logically equivalent to it, that is they may or may not take the same truth value at the same time. On the other hand, the contrapositive of a proposition is always logically equivalent to the proposition. That is, they take the same truth value regardless of the values of their constituent variables. Therefore, "If it rains, then I get wet." and "If I don't get wet, then it does not rain." are logically equivalent. If one is true then the other is also true, and vice versa.
1.9 NORMAL FORMS

P1, P2 Pn are atoms or variables. A (P1, P2 Pn ) is a statement formula. There are 2 rows in the truth table.
n

The formula A may have the truth value T for all possible assignments of the truth values to the variables P1, P2 Pn . In this case A is said to be identically true or a tautology. If A has the truth value F for all possible assignments of the truth values to P1, P2 Pn then A is said to be identically false or a contradiction. If A has truth value T for at least one combination of the truth values assigned to Pi, i = 1,2.n, then A is said to be satisfiable.

1.9.1 Disjunctive Normal Forms:

A formula which is equivalent to a given formula and which consists of a sum of elementary products is called a disjunctive normal form (DNF) of the given formula. To obtain a disjunctive normal form of a given formula, first convert the biconditionals and conditionals into an equivalent form which contains , and only. After that if necessary

apply De Morgans law. Then by repeated application of distributive law we can get the disjunctive normal form of the given formula.
Example1: Obtain the disjunctive normal forms of P ( P Q)

Solution: P ( P Q) P ( P Q)
(P P) ( PQ)

[since P Q P Q] [by distributive law]

Each of P P, PQ is an elementary product and (P P ) (PQ) is an sum of elementary products.


Example2: Obtain the disjunctive normal form of ( P Q ) ( P R)

Solution: ( P Q ) ( P R)
( P Q ) ( P R) (P Q) ( P R)

[since PQ P Q]

Which is the required DNF.


Example3: Obtain the disjunctive normal form of ( P Q ) ( P R)

Solution: ( P Q ) ( P R)
(P Q ) ( P Q)

[since P Q P Q] [ P Q (P Q) ]

( P Q) ( P Q)

[by De Morgans law]

Which is the required DNF.


Exercise: Obtain the DNF for the following

(1) (P Q) P Q (2) P ((P Q) ( Q P)) (3) (P (Q R)) ((( P Q) R) P) (4) (Q ( P R)) ((P R) Q) (5) (P (Q R) ) (( PQ) R))

1.9.2 Conjunctive normal form:

A formula which is equivalent to a given formula and which consists of a product of elementary sums is called a conjunctive normal form (CNF) of the given formula. For a given formula, an equivalent formula consisting of conjunctions of the maxterms only is known as its principal conjunctive normal forms (P or S) : product of sums.

Example 1: Obtain the principal conjunctive normal form of S given by

( P R) (Q P) Solution: S ( P R) (Q P)
(P R) (( QP)(PQ)) (P R) ( Q P) ( P Q) ((P R) ( Q Q )) (( Q P) ( R R))

(( P Q) ( R R))
(P Q R ) (P Q R) (P Q R) (P Q R)

(P Q R ) ( P Q R) Exercise : Find the DNF and CNF for the formula (P (Q R)) (( P Q)R)
Theory of inference

The main function of logic is to provide rules of inference and principles of reasoning. The theory associated with such rules is called inference theory because it concerns the method of inferring conclusion from certain premises.
Definition:

When a conclusion is derived from a set of premises by using an accepted rules of reasoning, then such a process of duration is called a Deduction or a Formal proof. (if a conclusion is derived from two premises say one major and one minor premises, the process is called Syllogism).
Remark: 1, In mathematical literature, The proofs gives one generally informed in the sense that many steps in derivatives one either omitted or considered to be understood.

2, In mathematics, one in solely concerned with the conclusion which is obtained by following the rules and logic. This conclusion called Theorem, can be inferred from a set of premises called Axions of the theory. The truth values plays no part in inference theory.
Definition: (sound)

In any argument, a conclusion is admitted to be true provided that the premises ( assumptions, axions, hypothesis) are accepted as true and the reasoning in deriving the conclusions. From the premises follows certain accepted rules of logical inference. Such an argument is called Sound.
Remark:

In any argument we are always concerned with its soundness. But in logic the situation is slightly different.
Logic:

In logic we concentrate on the study by rules of inference by which conclusions are derived. From premises any conclusions which is arrived at by following, there rules is called Valid conclusion. The corresponding argument is called Valid argument.
Remarks:

1. The actual truth value of the premises do not play any role in the determination of the validity of the argument. 2. In logic we are concerned with the validity but not necessarily with the soundness of the argument. Example: Premises: 1, All dogs are cats. 2. Some of the girls are fools.
1.4.1.Validity: ( Truth table ) Definition:

Let A and B be two statement formulas we say that B logically follows from A or B is a valid conclusion (consequence) of the premise A Fill AB is a tautology, that is A => B.
Example 1: Determine whether the conclusion C follows logically from the premises H1 and H2. a. H1 : P Q b. H1 : P Q

H2 : P H2 : P

C:Q C:Q

c. H1 : P Q d. H1 : P e. H1 : P Q

H2 : (P Q ) H2 : P Q H2 : Q

C : P C : (P Q ) C:P

Solution: We first construct the appropriate truth table, as shown in Table 1.4.1. For (a) we observe that the first row is the only row in which both Table 1.4.1 P Q PQ P Q (P Q ) PQ

T T F F

T F T F

T F T T

F F T T

F T F T

F T T T

T F F T

The premises have the value T. The conclusion also has the value T in that row. Hence it is valid. In (b) observe the third and fourth rows. The conclusion Q is true only in the third row, but not in the fourth, and hence the conclusions are valid in (c) and (d) but not in (e). The conclusion P in (e) does not follow logically from the premises P Q and Q, mo matter which statements in English are translated as P and Q or what the truth value of the conclusion P may be. As a particular case, consider the argument H1 : If Canada is a country, then New York is a city, (P Q) H2 : New York is a city, (Q) Conclusion C : Canada is a country, (P) Note that both the premises and the conclusion does not follow logically from the premises. This example is chosen to emphasize the fact we are not so much concerned with the conclusions being true or false as we are with determining whether the conclusion follows from the premises, i.e., whether the argument is valid or invalid.
Inference Theory of the Predicate Calculus The formulas of the predicate calculus are assumed to contain statement variables, predicates and object variables. The object variables are assumed to belong to a set called the universe of discourse or the domain of the object variable. Such a universe may be finite or infinite.

In a predicate formula, when all the object variables are replaced by definite names of objects and the statement variables by statements, we obtain a statement which has a value T or F.

Let A and B be any two predicate formulas defined over a common universe, denoted by the symbol E. If, for every assignment of object names from the universe of discourage E of each the variables appearing in A and B, resulting statements have the same truth values, then the predicate formulas A and B are said to be equivalent to each other. This idea is symbolize by writing A B over E. A formula A is said to be valid in E is written as A in E, if, for every assignments of object names from E to the corresponding variables in A and for every assignments of statement to statement variables, the resulting statements have the truth value T.
Tautologies of the statement calculus are given by

P P P Q PQ ((x) R |x| )( ( x S (X) (|x| R |y|) (( x)S |y| ))

DeMorgan Laws are


((x) A (x)) ( ) A (x) ) ((A (x)) (x) A (x))

If the universal and existential quantifiers are called duals of each other, then the equivalent can be summarized by saying that the negation of a quantified formula in which the quantifier is replaced by its dual and the scope of the quantifier by its negation.
Theory of Inference for the Predicate Calculus

US: Universal Specification ES: Existential Specification UG: Universal Generalization EG: Existential Generalization A (x) denotes a formula with a free occurrence of x. A (y) denotes a formula obtained by the substitution of y for x in A(x). Rule US: From (x) A(x) one can conclude A(y) Rule EA: From ( x) A(x) one can conclude A(y) provided that y is not free in any given Premise. Rule EG: From A(x) one can conclude ( y) A(y) Rule UG: From A(x) one can conclude (y)A(y) provided that x is not free in any of the given premises and provided that x is not free in a prior step which resulted from the use of ES, then no variables introduced by that use of ES appear free in A(x).

THE PREDICATE CALCULUS

The logic based upon the analysis of predicates in any statement is called predicate logic. We use capital letters to symbolize predicates and small letters for individual objects. A predicate requiring m (m>0) names is called an m-place predicate. In order to justify our definition for m=0, we shall call a statement a 0-place predicate because no names are associated with a statement.
Compound statements

In general, an n-plane predicate requires n names of objects to be inserted in fixed positions in order to obtain a statement. The position of these names is important. If S is an n-place predicate letter, a1, a2 .....an are the names of objects S(a1, a2 .....an) is a statement.

The statement function, variables and quantifiers. H : predicate; is a mortal b : name Mr Balu e : India s : a shirt H(b), H(c), H(s) all denotes statements. These statements have a common form.

If H(x) is for x is mortal then H(b),H(c),H(s) and others having the same form can be obtained from H(x) by replacing x by an appropriate name. H(x) is NOT a STATEMENT but it results in a statement when x is replaced by the name of the object. The letter x used is a place holder and not value holder. A simple statement function of one variable is defined to be an expression consisting of a predicate symbol and an individual variable. It becomes a statement when the variable is replaced by the name of the object. The statement resulting from a replacement is called a substitution instance of the statement function and is a formula of statement calculus.

Compound statement function:


Let M(x):x is a man: H(x):x is a mortal. we can form compound statement function such as M(x) H(x), M(x)H(x), H(x), M(x) H(x). A statement function of two or more variable can also be found out as follows: A(x, y) : x is taller than y. here the position of variable x and y is the above statement A(x ,y) is important because A(y, x) means y is taller than x.

Universal Quantifier:

For all x, x is a universal quantifier x : M(x) H(x) That is if for all x, x is a man; then for every x, x is a mortal.

Remark: 1. Statement function do not have truth values. 2. In most cases there is an infinite number of statements that can be produced by such substitutions. Valid formulae and Equivalences:

Consider, (x) (M(x) H(x) and (y) (M(y) H(y) These two formulas are equivalent. A(x): x is taller than y. For any x & y, if x is taller than y, then y is not taller than x. (x) (y) A(x, y) A(x, y) The universal quantifiers is used to translate expressions such as for all , every and for any Other quantifiers are also used such as for some , there is at least one or there exist some.

Predicate Formulas:
C (x1, x2 ., xn ) will be called an atomic formula of the predicate calculus.
A well formed formula of predicate calculus is obtained by following certain rules of the formation. In a statement every occurrence of a variable must be bound and no variable should have a free occurrence.

Example:
Symbolize the expression: The entire world loves a lover Let P(x): x is a person L(x): x is a lover R(x): x loves y The required expression is (x)(P(x) (y) (P(y) L(y) R(x,y)))

1.8 Automatic theorem proving:


1. Variable: Capital letters A, B, CP, Q, R are used as statement variables. They are also used as statement formulas; however, in such cases the context will clearly indicate this usage. 2. Connectives: The connectives, , , , and appear in the formulas, with the order of precedence as given viz has the highest precedence followed by and so on.

A statement is A and A are WFF if A and B are WFF, then (A B), (A B), (A B), (AB) are also WFF. A string of symbols consisting of statement variables connectives, parenthesis is a WFF, with additional assumption of the precedence and associatively of the connectives needed in order to reduce the no. of parenthesis appearing in the formula.
3. String of formulas : The string of formula is defined as (a). Any formula is a string of formulas (b). if & are string of formulas, then , and , are strings of formulas (c). Only those strings which are obtained by steps (a)&(b) are string of formulas, with exception of empty string, which is also a string of formula . The order of formulas appearing in a string is not important. 4. Sequent:
s

If & are string of formulas, then is called a sequent in which denotes the antecedents and the consequent of the string. A sequent is true if either at least one of the formulas of the antecedents is false at least one of the formulas of the consequent is true. Thus A, B, C D, E, F is true if and only if A B C D E F is true. In the sense the symbol is a generalization of the connective to string of formulas. Similarly we shall use the symbol applied to string of formulas as a generalization of the symbol =>. Thus A =>B means A implies B are AB is a tautology while means is true Occasionally we have sequent which have empty strings of formulas as antecedents as consequent. The empty antecedent is interpreted as a logical constant, TRUE or T and the empty
s s s s s s

The empty consequent is interpreted as a logical constant, FALSE or F.


Axiom schema: If and are strings of formulas such that every formula in both and is a variable only, then the sequent is an axiom, iff and have atleast one variable in common. 5.

As an example, A, B, C P, B, R where A, B, C, P, and R are variables, is an axiom. Note that if is an axiom , then
6. Theorem: The following sequent are theorems of our system. (a). Every axiom is a theorem. (b). If a sequent is a theorem and a sequent results from through the use of one of the ten rules of the system (indicated subsequently), then is a theorem. (c). sequents obtained by (a) & (b) are the only theorems. Note that we have used and temporarily to denote sequents for the purpose of the above description. 6.Rules: The following rules are used to combine formulas within strings by introducing connectives.
s s

In the descriptions of these rules , , . are string of formulas while X and Y are formulas to which the connectives are applied.
Antecedents rules: 1. Rule: =>: if , =>, X, then , X , => Rule: =>: if X,Y, , =>, then , X Y, => Rule: =>: if X, , => and , , , then , X , => Rule: =>: if , =>, X, then , X , => Rule: =>: if , =>, X, then , X , => Rule: =>: if , =>, X, then , X , => Rule: =>: if , =>, X, then , X , => Rule: =>: if , =>, X, then , X , => Rule: =>: if , =>, X, then , X , => Rule: =>: if , =>, X, then , X , =>

This formulation is primise-free, so that in order to show that C follows from H1, H2, ,Hm , We establish that H1 (H2(H3...(Hm C))
s s

(1) is a theorem. (2)

We must show that H1 (H2 (H3 (HmC)))

Our procedure involves showing (1) to be a theorem . For this purpose , we first assume (2) and then show that this assumption is or is not justified. This task is accomplished by working backward from(2), using the rules and showing that (2) holds if some simpler sequent is a theorem. We continue working backward from (2) until we arrive at the simplest possible sequent, i.e., those which do not have not any connectives. If these sequent are axioms, then we have justified our assumption of (2). If at least one of the sequent is not the sequence is not an axiom, then the assumption of (2) is not justified and C does not follow H1,H2,.Hm. Hence the derivation of (2) is easily constructed. By simply working through the same steps, starting from the axioms obtained.

Definitions: Let P be a propositional function with domain of discourse D. The statement for every x, P(x) is said to be universally quantified statement. The symbol means for every Hence the statement for every x, P(x) may be written xP(x) The symbol is called universal quantifier. The statement for some x, P(x) is said to be an existentially quantified statement. The symbol means for some and is called an existential quantifier. De Morgan Laws for logic (AB)= A B (AB)= A B A Mathematical system consist of axioms, definitions and undefined terms A theorem is a proposition that has been proved to be true. A lemma is a theorem that is usually not two interesting in its own right but is useful in proving another theorem. A corollary is a theorem that follows quickly from another theorem. An argument that establishes quickly the truth of a theorem is called a proof. The process of drawing a conclusion from a sequence of propositions is called deductive reasoning.

MATHEMATICAL INDUCTION Definitions Principle if mathematical induction Suppose that for each positive integer n we havea statement S(n) that is either true or false. Suppose that S(1) is true;: the basic step If S(i) is true, for all i<n+1, then S(n+1) is true: the inductive step Then S(n) is true for every positive integer. 1.12 Mathematical Induction

The set N= {0,1,2,} of natural numbers including zero can be generated by starting with a null set and the notion of a successor set. A successor set of a set A is denoted by A + and defined to be the set A + = A{A}
PEANO AXIOMS The set of natural numbers can be obtained from the following axioms, known as Peano axioms. Properties: 1. 0 N (Where 0 = ) 2. If n N, then n + /N Where n + = n{n} 3. If a subset S N possesses the properties (a) 0 S (b) If n S then n + S; n + = n +1 then S = N Property 3 is known as the minimality property. It is also the basis of the principle of mathematical induction. The property 3 has an equivalent form 3' . 3' :If P(n) is any property (or predicate) defined over the set of natural numbers and (a)If P(0) is true (b)If P(m) P( m + ) for any mN then P(n) holds for all nN The principle of mathematical induction is used in proving a collection of statements, which can be put in one-to-one correspondence with the set of all natural numbers.

The following are some examples of the application of the principle of mathematical induction.
Example. Show that n< 2 n Let P(n): n< 2 n (a) For n=0, P(0): 0< 2 0 =1 so that P(0) is true.

(b) For some arbitrary choice of mN, assume that P(m) holds, that is, P(m): m< 2 m . By adding 1 to both sides, we get m+1< 2 m +1 < 2 m + 2 m = 2 m *2 = c which is exactly P(m+1). So P(m) P(m+1) So by the principle of mathematical induction, P(n) is true for all nN
Ex. Show that 2 n < n! for n 4 Let P(n): 2 n < n! P(4): 2 4 =16 < 4! = 24 So that P(4) holds. Assume that P(m) holds for any m > 4 and so 2 m < m! Now 2 m = 2* 2 m <2(m! )< (m+1)*(m!) = (m +1)! This means that P(m+1) holds. Hence P(n) holds for all n N and n 4 Ex. Show that n 3 + 2n is divisible by 3 Let P(n): n 3 + 2n is divisible by 3 Now P(0): 0 is divisible by 3, so that P(0) is true. Assume for any m, P(m) is true that is P(m): m 3 + 2m is divisible by 3 (m + 1) 3 + 2(m + 1) = m 3 + 3m 2 + 3m + 1 + 2m + 2

Now = m 3 + 3m 2 + 5m + 3
= m 3 + 2m + 3(m 2 + m + 1) Since m 3 + 2m is assumed to be divisible by3 and 3(m 2 + m + 1) is also divisible by 3(m + 1) 3 + 2(m + 1) is divisible by3, that is P(m+1) is true. Hence P(n) is true for all nN.

You might also like