You are on page 1of 18
Chapter 2 Logic Propositions and Logica! operations. Truth tables, Equivalence, Implications. Laws of Logie. Mathematical Induction and Quantifiers. Introduction : Lopic is central of the theme of Discrete structures. A discrete structure is defined by a Set of axioms Properties ofthe structure are then derived from the axioms as theorems. These theorems are proved using valid rules of reasoning, The science of logic provides rules by which one can determine whether any particular proof (argument) is valid or not. These rules should be formulated in a language which is precise and free from ambiguities. Ordinary language is illsuited for this purpose, as such languages are prone to be misinterpreted or misconstrued. Considet for example the statement, “He thes to study hard” and “He tries hard to study” A mere shifting of the words, changes the entire meamng. To avoid such mishaps. a formal language is developed using symbols and certain well defined rules for calculating with these symbols. This 1s Symbolic Logic or Propositional Calculus A Caleulus isa set of rules for calculating with symbols, In Differential calculus we do calculations on functions: In propositional calculus, we do calculations on propositions, witlr well-defined eee to determine the truth or falschood of compound propositions. ‘The formalism in symbolic logic is well suited to be programmed on fhe computer Computer programs are themselves formal proofs, so that their construction and venfication closely resemble logical manipulation Logie plays a major role in formal hardware and software, verification of proofs and in the theory of programming languages. s 2.1__ Propositions : ala Definition : A proposition or statement is a declarative sentence which is either truc or false, but not both, Examples : (i) There are seven days in a week (i) 2425 iii) ‘The carth is fla (iv) The equation x? + x + 1 = 0 has no real root. W) (vi) Four is even. (vii) 43221 (ili) 4e (13.5) It will rain tomorrow. Discrete Structures 22 Examples (1), (iv), (vi) and (vii) are true statements, whereas statements di), obviously false. In the case of example (v) although its truth value cannot be predicated att time, it can be definitely determined in the future (ic. tomorrow). Hence it is also a statement The following are however examples of sentences which are not propositions W xt3=5 (ii) Bring that book 1 Gi) When is your interview? (iv) What a beautiful painting | (Vv) This statement is false. Example (i) is not a statement, since its truth value depends on the value of x. If x = 2, the Sentence is truc , if x # 2, the sentence is false. It is infact a propositional function. Example (in), (i , (iv) ate not declarative sentences, one is a command, the other is a question While the third is an exclamation. Hence these are not statements Example (v), although a declarative sentence, cannot be assigned a truth value, it is neither trac nor false. Hence it is also not a proposition 2.1.2 Notation : The statements. which cannot be further split or broken down into simpler sentences, such statements are called primary, primitive or atomic statements We denote primary statements by the lower ease letters p,q, In Mathematics. we have the concept of real or comples variable. Similarly in logic, we have the concept of propositional variable or statement variable. We denote statement variables also by the same symbols p,q. f, °. This dual use of the same symbol to denote either a definate statement, called constant, or an arbitrary statement called a variable, should not cause any confusion, as its use will be clear from the context. Note that when 'p' is used as a statement variable, it has mo truth value and hence is not a statement. It should be replaced only by a statement and then its truth value can be determined. For example we may replace p by a true statement "2 + 3 = 5° or by a false statement "S43 = 5" R2/ Logical Operations : Itis possible to form new and rather complicated statements from the primary statements by using certain connecting words, with whose usage, we are already familiar in the English language. These statements are called Compound Statements. In our everyday use of the English language, we use the words “not”, "and", “or”, "but", “while” etc., to connect two or more statements. However, these connectives quite flexible in their usage, lead to inexact and ambiguous interpretations, Hence we shall borrow only some of these connectives, redefine and symbolize them. fo suit our purpose. Discrete Structures 23 __bogie 2.2.1. Negation : ‘The negation of a statement is formed either by introducing the word not ata proper place or by preflxing the statement with the phrase ft is not the case that" If "p* denotes a statement then negation of p is denoted by "=p" (or p). If the truth value of p is true. then the truth value of ~ p is false. If the truth value of p is false then the tnath value of ~p is true Consider the following examples (If pis the statement "Lam going for a walk", ~p is the statement "I am wot going for a walk” or "It is not the case that 1 am going for a walk” 2.2.2 Conjunction (And) : If p and q are statements the compound statement ‘and q' is called as the conjunetion of p and q, and is denoted by p44 Example 1: Let us consider the statements P > The sun is shining q ¢ The birds are singing Then p » qis the statement, The sun is shining and the birds are singing, Example 2 : Let Pisa prime number. q Ram is an intelligent boy Then p-- q 1s the statement. 2 is a prime number and Ram is an intelligent boy This statement és perfectly acceptable in logic, although it makes no sense in our everyday Janguage. 2s we cannot see the counection between the two statements, ‘The words "but" and *while” are weated as equivalent words to “and”. Consider the following examples Example 3: ‘Translate into symbolic form the statement. Rahul is poor but happy Solution : Let p > Rabul is poor q ¢ Rabul is happy. Then the given statement in the symbolic fom is p a q Example 4: Translate into symbolic form statement “We watch television while we have dinner’ Discrete Structures 24 Logic Solution : Let p : We watch television. q : Wehave dinner, Then the given statement in the symbolic form is p ~q. 2.2.3 Disjunction (or) : If p and q are statements, then the compound statement ‘p or q' is called as the disjunction of pand q., and is denoted by p aq. Example 1: There is an error in the program or the data is wrong. Let p * There is an error in the program. q+ The data is wrong, Then pvq : There is anerror in the program or the data is wrong. In the above example the connective "or" is used in the ‘inclusive’ sense, i¢. atleast one posibility exists or even both the possibilities exist Consider the next example Example 2: Either | will read a book or go to sleep Let p Iwill reada book q : Lwill goto sleep Then pvq - Iwill read.abook or go to sleep. In everyday language as this example demonstrates, the connective “or” is used im the ‘exclusive sense’, i¢. either one or the other activity can happen, but net both. In logic, the symbol 'v' is used in the inclusive sense only; where we wish to speicfy that “exclusive or" is to be used, we use a new symbol *” Hence in the above example, the more correct notation is pv q. ‘Normally in our everyday language, the relation “or” is used betweer two statements. which have some kind of relationship between them. In logic, this is not necessin, as the following example demonstrates. Example 3: Let p : Itis raining today q_ : Divyaisan intelligem girl Then pvq : Itis maining today and Divya is anintelligent pin Makes perfect sense in logic, though not in English. Discrete Structures 25 Loge 2.2.4 Conditional (if ...then) If p and q arc statements, the compound statement ‘If p then q’, denoted by p > q is called a Conditional Statement pis called the antecedent or hypothesis, while q is called the consequent Example 1: Let p : Harish works hard. q. ~ Harish will pass the exam. ‘Then pq. > If Harish works hard, then he will pass the exam Converse, Inverse and Contrapositive Propositions : If p— qis the conditional statement then 1. q— pis called its Converse. 2. ~p ais called its Inverse. 3. gis. If Tcamy an umbrella, then it rains qP: Contrapositive of p> ais, ~q If do not camy an umbrella, then it does not rain ent may not ‘always have the form “If... then”. While In ordinary usage, the conditional statem: have to correctly interpret the statement. Consider the putting the statement into symbolic form, we following examples. Example 3: Write in symbolic form the statement: Farmers will face hardship if the dry spell continues. Solution: Let p< Farmers will face hardship q pis the correct symbolic representation of the given statement. Discrete Structures 26 Logie Example 4: ‘Write in symbolic form the statement : A sufficient condition for a function to be continuous is that the? function is differentiable Solution : Let pp: The function is differentiable 4: The function is continuous. The statement has to be interpreted as p is sufficient for q. Hené® the correct solution is p > q Example § : Wnite in symbolic form the statement Stavan’s father will buy him a computer only if he passes the ¢8am, with distinction. Solution : Let p+ Stavan's father will buy him a computer q+ Stavan passes the exam with distinction. ‘Then p—>» q 1s the correct symbolic version of the statement Example 6 : Put into symbolic form statement A necessary condition for a candidate to get admission ts to pass the entrance exam, Solution : Let Pp. Acandidate gets admission 4 The candidate has passed the entrance exam In this example. the statement q is necessary for p. Hence p +4 '5 the required symbolic form Example 7: Put into symbolic form the statement : Unless I reach the statio on time, I will miss the train. Solution : Let p< Lreach the station on time, q © Lwill miss the tra Then ~ p+ q is the required symbolic form, Hence it is IMPORTANT to REMEMBER that the statemer!/7s. Ifp, then q, qifp, ponly if q pis sufficient for q, is necessary for p. all are EQUIVALENT to the stateinent form na Discrete Structures 27 ai Logie 2.2.5 Biconditional (If and only if) Lf p and q are statements, the compound statement 'p ifand only if q. denoted by p + q, is called a biconditional statement, Often “if and only if” is shortened as" p.© qisalso read as "If p then, and conversely” Many of the theorems in Mathematics are of the type “if and only i Examples : (i) Am integer is even if and only if itis divisible by 2 (ii) A right angled triangle is isosceles if and only if the other two angles are each equal to forty-five degrees ii) Two fines are parallel if and only if they have the same slope 42.37_Propositional or Statement Form : We know whata statement variable is (refer to Section 2.12), Using the logical connectives defined expression, involving the statement variables. The following are above, we can construct or form examples of statement forms ~@~vaop ) (Pao (Pr~4) (i) ((pagy (psn) Cpanya) ‘One can thus construct any number of complicated statement forms. from the statement variables by using the logical connectives ‘A Statement form hay no fived truth value. Itis only when tls assigned definite truth values, that we obtain the truth value of the statem Hence the tnith value of a statement assumes the truth value ‘true’ or the truth value ‘false’, depending on the truth values assigned to the statement variables, appearing in the statement form We denote by ‘T the truth value tre, and by 'F' the truth value false In circuit logic, "Tis denoted by "I' and 'F by "0 2.3.4 Examples : Example 4: Using the following statements : p : Rajan is tall q.: Rajani is beautiful Write the following statements in symbolic form, (i) Rajani is tall and beautiful. (ii) Rajani is tall but not beautiful (iii) It is false that Rajani is short or beauuful (jv) Rajani is tll or Rajani is short and beautiful Discrete Structures 28 Logie Solution ; @ paq i) pa~q (iti) ~(~pvq). @) py (~paag) Example 2: Express the proposition ‘Either my program nuns and it contains no bugs, or my program contains bugs’ in symbolic fort Solution : Let p My program nuns q_© My program contains bugs. Then the proposition can be written in symbolic form 38, (pa-qyya Example 3: Using the following statements p Iwill study discrete structures q Tull go toa move r . Lamina good mood Write the follow ng statements in symbolic form (i) If Fam not ma good mood, then I will go to a sO¥Ie. {a1} Lwill not go toa movie and I will study discrete stmuctures (iii) Twill go to a movie only if Twill not study discee€ structures (iv) Twill not studs discrete structures. then I am not iM 2 good mood, (Dee %) Solution: @ ~r34q Gi) ~qap (i) q>~p (iv) ~po~r Example 4: Write the following statements in symbolic form (Indians will win the world cup if their fielding igProves (ii) [f Lam not in a good mood or | am not busy, thet! will go fora movie. (iii) If you know object oriented programming and ortle, then you will pet a job, (iv) Lill score good marks in the exam if and only fl study hard. Discrete Structures 29 Logie Solution : ( Let p< Indians will win the world cup, q.: Their fielding improves. Then q -» pis the required form. (iy) Let p : Lam ina good mood. q: Fam busy. 1 Twill go fora movie. ‘Then ( ~ pv ~q) 91s the required symbolic form (iii) Let p_ You know object oriented programming q+ You know oracle 1. You will geta job ‘Then p 4 q— ris the required symbolic form (iv) Let p= Evil score good marks in the exam q: I study hard “Then p > q is the required symbolic form Example 5 : Translate the following statement into symbolic form : ( May 95) Trike uuty cost goes up oF the request for additional funding és desired, then a new ComPuGE will te purchased ifand only if we eam show thatthe curent computing facilities are indeed not adequate Solution : p © The utility cost goes up q+ The request for additional funding is desired fF Anew computer will be purchased s > We can show that the current computing facilities are indeed adquate, ‘Then (pv a) —? (re = SPIS the required symbolic form. Example 6: Write English sentences corresponding, to the following statement WCC PIADAE ww ro (pya Gin) (= -gy Pp) Ww) (av Epnet where p> Lwill study discrete structures, > Twill go toa movie 1 + Lam ina good mood. (Dec. 96} eaie Diacret Solution @ Gapraarert ICT do not sty discrete structures snd | po toa movie, then Tam in a pood mood rorya IC} am ina good mood, then { will study diserete structure oF {wil po to a movte 4 Naa {Fam not im good mood, then | will mot go toa movie oF L will study discrete structure Ww @verer Toll go toa movie off will not study discrete structure if and only af 1am jn a good mood Example 7 : Put the following statements info s¥mibolic form ()._Afeither Anit thes Mathematics or Aparna takes Biology, then Deepa will take cliemistry (38) Uns he stds, fhe wil fal in the examination Solution : (Let p> Aniftakes Mathematics Aim takes Biology 1 Deepa ill take Chemisty, ‘Then (p vq) ~¥ isthe requited forin (i) Let p © He studies 4) He will fal in the examination ‘The statement és equivitlent to the statement, "IT he does not study, then he will fail wn the Hence ~ p -»4 is the requited form Example 8 : To describe the various restaurants 1n the city, let p denote the statement “the food is good" rating is three-star", Write the following statement “the service is good" and r the statement "th statements in symbolic fora (May 93) (0 Either the food is good or service 1s good, oF both. (ii) Either the food is good or service is good, but not both {iid) The food is good while the service is poor. (iv) Ttis not the case that both the food is good and the rating is thuee-star (0) If both the food! and service are good, then the rating is three star (si) Tis not tme that a three star rating always means good food and good service, Discrete Structures 241 Solution : @ As"v" means “inclusive or”. the statement required is pv q. Hence the statement is p ¥ q. Equivalently the (i) We have to use "exclusive of” i. € statement is also p Aq v pq (iii) *While” is interpreted as “and”. Hence the statement is p a ~q (ix) “Iti not the case” implies negation Hence the statement is~(p #1). (s) The statement is (p Aq) > & a (vi) The statement is ~(r > (pq). Example 9: Using the following propositions - p : lambored q_: Tam waiting for one hour +: There is no bus translate the following into English. @ @vnap. (i) ~q>~p. (i) > p)v > PP. (May 94) Solution: (If am waiting for one hour or there is no bus. then I get bored. (i) If Lam not waiting for one hour. then I am not bored. (iil) If Lam waiting for one hour then | am bored, or if there is no bus, then I am bored Example 10: Write the logical negation of the following statements in the symbolic form (Gopal is intelligent and rich. (ii) Gopal is intelligent but not rich. (iii) Gopal is either intelligent or rich. Solution : Let p : Gopal q.: Gopal is rich (i) ~ (pq) which is equivalent to ~p v ~q intelligent Gi) ~ (pA~q) which is equivalem to ~ pv q (ii) ~ (pv q) which is equivalent © ~p a~q Discrete Structures 242 Logic Example 11: Let phe “Jack speaks French" qbe "Jack speaks English" Give a simple verbal sentence which describes cach of the following. @ py qu) pan~q @) ~~P di) pag (n) ~py~q (wi) ~Cpa~@ Solution : @ pya: Jack speaks French or English (i) pray Jack speaks French and English. Git) pa~q: Jack speaks French but not English, ng (iw) ~Ppy~qa Jack does not speak French or he does not speak English Meme? = tis not true that Jack does not speak French, wi) ~(~pa~qQ: Ibis not truc that Jack speaks neither French nor English Example 12: Determine the contrapositive of each statement. If he has courage he will win. (ii) It is necessary to be strong in order to be a sailor. (iii) Only if he does not tire will he win. (iv) It is sufficient for it to be a square in order to be a rectangle, Solution : i) If he does not win, then he does not have courage. (ii) If he is not strong, then he is not a sailor. ii) If he tires, then he will not win, (iv) If itis not a rectangle, then it is not a square, (Dec 2000) Example 13 : Consider p : Youstay in Mumbai q_: Youvisit Hotel Taj Land. Determine converse, inverse and contrapositive of p + q i.e, If you stay in Mumbai, you visit Hotel Taj Land. Discrete Structures 213 Logic Solution : () Converse (q > P) “If you visit Hotel Taj Land, you stay in Mumbai (ii) Contrapositive (~ 4 ~P) “If you do not visit Hotel Taj Land, then you do not stay in Mumbai" (iii) Inverse (~p > ~9) "If you do not stay in Mumbai, then you will not visit Hotel Taj Land” Example 14 : Write the converse and contrapositive of the given propositions (i) Ihe teacher is absent then some students do not compete their homework (ii) If Lani not president of United States then I will walk to work. (iii) If Tam late then I do not take the brain to work (iv) UT have enough money then 1 will buy a car and | will buy a house Solution : (i) (a) Converse: If some students do not complete their homework then the teacher is absent (6) Contraposiive: Ifsome students complete their homework then the teacher is not absent Gi) (a) Converse : If Lwill walk to work then I am not president of United States. (b) Contrapositive: If will not walk to work then Tam president of United States. (iii), (a) Converse : If Ido not taken the brain to work then I am late. If | take the brain to work then Tam not late, (b) Conteapositiv (iv) (a) Converse = If twill buy a carand if | will buy a house then I have enough moncy INL will notbuy a car ora house then I do not have enough money (b) Contrapositiv Example 15 = Write down English sentences for th 250) is an even number’ he converse and contrapositive of: “If 250 is divisible by 4 then Solution : Let p< 250 is divisible by 4 q 250 is an even number Sentence takes the form p > 4 “The converse is q—> P, Which we can write as : "76250 is an even number then 250) is divisible by 4". “The contrapositive is, ~q—? ~P. Which we write as "1f 250 is not an even number then 250) is not divisible by 4" Discrete Structures: 214 Logic Example 16 : Consider the following advertisement fora game (May 95) (i) - There are three statements in this advertisement. (ii) Two of them are not true. (iii) The average increase in IQ scores of people who learn this game is more than 20 points, Is the statement (iii) trac? Justi your answer. Solution ; Let us suppose statment (tii) is false. Now statement (i) is true since there are actually three statement in the advertisement. This leaves us with statement (ii). Statement (ii) cannnot be true, since if itso, we shall have only one statement which is false, which contradicts statement (ii) itself. Hence statement (ii) ts false. which means that there are actually two statements which are true. Hence ‘statement (111) cannot be false. It has to be a tre statement. Example 17 : Write the following statements in symbolic form (The sun is bright and humidity is not high. Gi) [his already 900 am. should start my job Gili) If the requirement of computer Engineers is increased, then more seats will be offered by University and more computers will be purchased by the University computer Department if the rates are competable Solution : @ Let p © Ths sunis bright q: Humidity is high Then the given statement in symbolic form : Pa~q 00 a.m, Gi) Let r+ Mis already ss: I should start my job Then the statement in symbolic form ist A's Giiy Let p- The requirement of computer Engineess is increased. q¢ More seats will be offered by University 1 © More computers will be purchased by the University Computer Department s The rates are competable, Then the given statement in symbolic form is : p> (qa (s > 1) Example 18 : Prove that V2 is irrational Discrete Structures 215 Logic Solutio Let p be the statement, p > ¥2is irrational then p is the statement p : Vis rational We argue that p is false. If V2 is rational then there are integers m and n, with no common factor, such that, me V2 n a ni? ywaring BS = 2 Squaring 7 ie m= dn? ‘This implics that im? is even number, and therefore m is also even. Hence, we can write m= 2k, kis an integer. m= 4K? Now.sincen? = 4 nt was 2? Hence, n? is also even which implies that is even. But if both m and n are even, they have the factor 2 an common. This is a contradiction, since we have assumed that m and n have no common factors. Pp is False pis Tne and hence V2 is irrational (Note:p =p =->p=~p) Example 19: Suppose it is true that If Ram cones, so will Gopal and if Arjun will not come, then Gopal will not come Show that If Ram comes. then Arjun will come. Solution : Let p. q, r denote the propositions p : Ramcomes > Gopal will come ts Agjun will come Discrete Structures 216 Logic The given premises are : Pqand~ro~q If we assume ~ r—» ~q is true, then by contrapositive mile q—> ris also tme. Hence, p> qandq> er [Law of syllogism : Let p, q, r be three propositions If p> qand q > rare both trie, then p> ris true] By the law of syllogism, it is trie that p—> r ‘That is, if Ram comes, then Agjun will come, Example 20 ; Translate into symbolic form (May 98) IF play footba . Leannot study, Either I play football or I can pass DBMS. I played football, therefore 1 passed DBMS. Solution : Let p= Iplay football q + Lpass DBMS r : Teannot study @) IFT play football, I cannot study. In Symbolic form : p ->r (ii) Either 1 play football, or I can pass DBMS. In symbolic form | pv q (iii) 1 played football. therefore I passed DBMS. In symbolic form: pq. Example 21: Let p > Heistich q : Heishonest Write each of the following statements in symbolic forms using p and (i) To be poor is to be honest (ii) [tis necessary to be poor in order to be honest (iii) He is poor only if ie is dishonest iv) Ihe is po « he is dishonest Solution : @ ~paq Gi) ~poq Gi) ~pe~q — (s) ~pr~q Example 22: The converse of a statement is given. Write the inverse anid the contrapositive statements. "if T come carly, then I can get the car." Discrete Structures 27 Logic Solution : Converse of the statement 1s given. p Loan get the car. q : Tsome early. Inverse of the statement ts = = €1 cannotget the car, then I shall not come early Contrapositive of the statement is < + If 1 do not come early, then I cannot get the car.” Example 23 : ‘The conversc of a statem * Ife is considerate of others, then a manis 2 gentleman” nent is given. Write inverse and contrapositive statements Solution : Comverse of a statement is given, p > Manisa gentlergan, 4g < Heis considerate of others. Inverse of the statement ist + 1fa man is nota gentleman. then he i not considerate of others” Contrapositive of the statement is = " ithe is wot considerate of eters, then he man snot 2 gentleman Example 24: ‘The inverse of a statement 1s given, Write the converse ‘and contrapositive of the statement. “Ifa man is not a fisherman, then he is not isa swimmer.” ‘Solution : Inverse of the statement is given piA man isa fisherman, q.: Heisaswimmer. Converse of a statement is : = Ihe isa swimmer, then the man isa fisherman.” Contrapositive of a statement is : + tf he is not swimmer, then the man isa fisherman.” Logic Discrete Structures 2418 Example 25: The contrapositive of a statement is given as, "Hex <2, thenx +466" Write the converse Solution : Contrapositive of a statement is given, ps xtsr6 q x>2 Converse of the statement is "Ux > 2, then +4> 6." 2.3.2 Exercise : Example 1: The material is interesting and q denote the statement”. “The exercise Let p denote the statement are challenging’, and r denote the statement "The course i enjoyable” Write the following statements in symbolic form : “The material is interesting and the exercises are challenging, ‘The material is uninteresting, the exercises are wot chalanging and the course's not 8/0 able. If the matefial is not ineresing and the exercises are not challenging. then the course 15 not 0) Gi) (iii) enjoyable “The materia is interesting means the exercises are challenging, and conversely av) longing, bst not both, W Example 2: Let the propositions p Write the following sentences in symbolic form, using p, q and Either the material is interesting. or the exercises are into chal Gopal is tall q.: Gopal is handsome appropriate connectives. (Gopal is tall and handsome. Gopal is tall but not handsome. It is false that Gopal is short or handsome. Gopal is ncither tall nor handsome, Gopal is tall means he is also handsome. It is not tme that Gopal is short or not handsome, (iv) W) (wi) Example 3: Write the following statements in symbolic form (i The sunis bright and humidity isnot high ) Wt finish my homework before dinner and it does not rain, then | will go to the ball game. Gil (ii) ir you do not seem fomoros, it means Ihave gone to Chicago

You might also like