0% found this document useful (0 votes)
45 views44 pages

Unit 2 Ch-Logic

Dm all unit available unit 2 logics. Download for free . Command to connect with examples.

Uploaded by

Gaurav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
45 views44 pages

Unit 2 Ch-Logic

Dm all unit available unit 2 logics. Download for free . Command to connect with examples.

Uploaded by

Gaurav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 44
Logie is the study of reasoning and is spe: Whether a Particular reasoning is valid, [t is laws of thought, Without which ‘ the reason takes Place, AL. PROPOSITIONS Definition 4.1.1. 4 declarat but not both is called a Propositio Example 4.1.2. Propositions ? cifically concerned Wi 4 science of the neces, ich no employment of the understanding ang tive sentence that is either tru © OF false, nm or a statement. Which of the following sentences gp. (i) London is the capital of France (ii) Open the door Gii) Take two tablets of medicine (iv) xt+y>0, x, yeZ (v) The only positive integers that divide a prime number are | and the number itself. | (vi) The sun is hot. | Solution. (i) The sentence is declarative and false. Hence it By proposition. i i i (ii) ‘The sentence “Open the door” is not declarative. It is rather # command. Therefore, it is not a proposition. i i iti ition. (iii) The given sentence is not declarative and so it is not a propositio™ A es (iv) The sentence is not a statement because it is true for some ye of x and y whereas for other values of x and y it is false. a ifx= 2. y= 1, then itis true butifx=~-2,y= 1,1 exampl Logie ony The VEN SENKENCE ig dee] ) aarement Ihe sentence “The sun j qe, Hence itis a Proposi Notations. The proposit yaspeaand r. Thus the ee sition 3+ 7= 10, eer SHAVE as Wel] 8 true, Henee it is a hot" ion, IONS are Tepresented b: Nolation p : 347 ~ ) wl is both declarative sentence and y lower case letters 10 means that p the a Many propositions are Composite, that propositions and various con, ab nectives. Thus, Definition 4.1.3, Composite Propositions are called compound yropositions. is, composed of we have A proposition which is Not compound is jus. a primitive proposition cannot be broken i, | The sun is shining id : Itis cold, inected by the connective “and” f I Be prit On the other hand, the Proposition London is in Denmark mitive statement. Defi nition 4.1.5. The truth values of a compound statement in of its Component parts is called a truth table. BASIC LOGICAL OPERATIONS Miree basic logical Operations are junction Nunction tion fortespond Fespectively to “and”, “or” and “no! 212 DISCRE DMATHEMA] Definition 4.2.1, The conjunction of two propositions Dan the proposition dy pand q. Itis denoted by pa q. Example 4.2.2. Let p: This child is a boy : This child is intelligent Then 4 P Aq: This child is a boy and intelligen, Thus DA qis true, if the child is a boy and intelligent both. Even if one of the component is false, pq is false. Thus ke “the proposition pq is true if and onl are both true”. ly if the proposition p andy rue”. 1 The truth value of the com pound proposition p q is defined by the tné table: i { Pp q pag =] ay T T a F F F Hy F | E F F Example 4.2.3. If p: London is capital of India q: A decade is 10 years, then p is false, q is true and the conjunction pq: London is capital of India and a decade is 10 ye is false. Definition 4.2.4. The disjunction of two proposition p and 0 he proposition porg __. Iris denoted by pv a The compound statement PY qis true ita s Ut Lei C of i fee ae least one ofp or qis true, Itis ~The truth values of the ah compound Propo: truth table: sition pv q is defined by the - For example, if P : London is Capital of India 9: A decade is 10 years, b then pis false, q is true, The disjunction Pv q: London is capital of India or a decade is 10 years _ is true. _ Example 4.2.5, Form the disjunction of p and q for each of the following: (a) p : 2 is a positive integer , q: V2 isa rational number. (b)p:2+3=5, q:Londonis the capital of France, Solution. 7 @pvq:2isa Positive integer or V2 is a rational number. Since p is ttue, the disjunction PV qis true, even though q is false. _ @)PVq:243=5 of London is the capital of France. Since both p and are false, p vq is false. Remark 4.2.6. 1. It is clear from the above example that in logic, ke in ordinary English, we may join totally unrelated statements by ‘connective “or”, DISCRETE MATHEMATICS (ii) Paris is in France and V2 is a ray (iii) Paris is in England and 242 6 , (iv) Paris is in England and 2 + 2= 5 nat nom Solution, Here the propositions are combined by ¢ “and”, There fi ae ct beers a rere the compound proposition shall be conjunetion tt sachet 8 0) both subpropostion are true. Inthe ae Statements, at least one subproposition is false. He Dis tue truth table ig proposition is false. Hence only (i) is true, The P 9 pag a v T T i q E, F F T : : F FE FE Definition 4.2.8. If p is a stat i 2.8, tt i statement net p, denoted by ey Siaee ge newation C&P bs Thus ~P is the statement “it is not the case that p”. Hence if p is true than ~p is false and if p is false, then ~p is true. he truth table for negation is P =P T F F al Example 4.2.9. Give the negation of the following statements : (a)p:2+3>1 (b) q: It is cold Solution. (a) ~p : 2 +3 is not greater than 1. That is,~p:2+3 <1. is false. Since p is true in this ca: (b) ~q : It is not the case that it is cold. More simply, ~q : It is not cold. Remark 4.2.10. (i) In expressions that include the symbol ~ & well as” or v, the order of operation is that ~ is performed first. For ample, ~p Aq = (-P) Aa LOGIC 215 | expression such as Pq vt is considered ambiguous. This must be written as either (pq) v ror Patavs)teheve esston es iS pat RANSLATING FROM ENGLISH TO SYMBOLS gull F We consider 2.12. Write each of the following sentences symbolically. i 4. grample pot” and q : “It is sunny”: jating P* ) Iris not hot but it is sunny ; ® jris neither hoLnar sunny. solution. (2) In logic the words “but” and “and” mean the same hing. Generally but is used in place of and when the part of the sentence that follows is in some way unexpected. The given sentence IS equivalent to “It is not hot and it is sunny” which be written symbolically as ~p q. “canbe (b) The phrase neither A nor B means the same as not A and not B. Thus - [tis neither hot nor sunny” means that it is not hot and it is not to say ~ _ Fi Therefore the given sentence can be written symbolically as Remark 4.2.13. The notation for inequalities involves “and” and = statements. For example if x, a and b are particular real numbers, X Sa means x b are either true or false and hence that sentences are statements. Definition 4.2.14. A “Statement form” or “Propositional form” is pression made up of statement variables (such as ~, 0. v) that ons a statement when actual statements are substituted for the Mhonent statement variable. The truth table for a given statement 218 DISCRETE MATHEMATIC fo s : Ti atsmlays the truth values that correspond to the differen combinations of truth values for the variables, 42.15. TRUTH TABLE FOR EXCLUSIVE OR When or is used in its exclusive sense, the statement “p or g* means “p or q but not both” or “p or q and not both p and q” whi translates into symbols as Viet 2 ° . (Pv q)a~Paq) This is sometimes abbreviated as p@q orp XORq. The truth table for p @ q is Lp q pvqa paq (paq) [tT T i BY F __ F ity F T ;F oT T F Ly LF F F F T Example 4.2.16. Construct a truth table for the statement form: (@aAqgv-~r. Solution. The truth table for the given statement form is P q r Paq (pag) v =r iat Dn F Tas T OT F T T Tse | T F Ty E F F | Tin F F F T Ts | FT T F F Ep s| FOOT F F Ty Tees | F F © F F F | FF F E T T Definition 4.2.17. Two different compound propositions(et statement forms) are said to logically equivalent if they have the sam truth value no matter what truth values their constituent propositions have. LOGIC 217 OR Tw 0 dYereny Compound Proposition: loricatly equiy Ment if they have ide We use the SYMbol = for logic IS (Or Staten ntical tra al equivale Ment forms) ar © said to be h tables, Nee, Exampte 4.2.19, Nog statement, Sy mboli Solution, ‘7 ALON Of the Ney ally, he truth ~p)s Mable of AION Of a st atement is equal to the ~Cp)is Thus truth values for p and ~(~p) and henee p logically equivalent The lo, are same gical equiv ‘alence ~(~p)= Involution Lay. and ~(~p) are Example 4.2.19, Show that the statement forms ~(p a q) and ~PA~q are not logically equivalent, Solution. Construct the truth table for both statement forms: ———T mama apo F = Thus we have different truth values in rows 2 and 3 and so ~(p aq) and ~p Aq are not logically equivalent. ider ~p v ~q. then its truth values shall § Remark 4.2.20. If we consider ~p v ~q, t } be F T T T ivalent, Symbolically ) and ~p « ~q are logically equivalent. Sy and hence ~(p a q) and ~ 218 DISCRETE MATHEMATICS ~PAq)=~pv~q Analogously, (Pv q)=~pa~q The above two logical equivalence are known as De Morgan's Laws op Logie. Example 4.2.21. Use De Morgan’s Law to write the negation ~42 ‘ample 4.2.22. Use De Morgan’s Laws to write the negation of p: John is a boy and John is handsome Solution. The negation of p is ~p : John is not a boy or John is not handsome Remark 4.2.23. In logic, the connectives “and” and “or” are used between complete statements. Thus, we cannot write “John is a boy and handsome.” Definition 4.2.24. A compound proposition which is always true egardless of truth values assigned to its component propositions is called ‘autology. Definition 4.2.25. A compound proposition which is always false regardless of truth values assigned to its component propositions is call a Contradi a LOGIC 219 Definition 4.2.26. 4, ce truc oe false depending on the led a Contingeney, MpOUNA propositi D sition which can be ei truth valu sitio ICS Of its component propositions Example 4.2.27, Consider the statement form Py~p. The truth table for this statement form is all T’s Hence p v ~pisa tautology. Example 4.2.28. Consider the statement form PA~p. ‘The truth table for this statement form is P Pp AY T F F F T F t f all F’s _ Hence the statement form p a ~p isa Contradiction. Remark 4.2.29. If t and c denote tautology and contradictions respectively, then we notice that qa) _ and 2) _ Also from the above two examples : Py~pst @) psec @ 290 DISCRETE MATHEMATICS the logical equivalence (1), (2), 8) and (4) ate Known as Comptey Laws. Men r UIVALENCE INVOLVING TAUTOLOGHEs CONTRADIC TIONS ANY I tis.a tautology and cis a contradiction, then the truth table, f oy parandpacare: paola pat Tae reece T | | T F same truth values: ave have patep and pa Her Similarly, the truth tables for p vt and pv care Same truth value Same truth values Hence, we have pvt and pvc=p Thus we have the following logical equivalen These four logical equivalence are known as Identity Law. 1. (Idempotent Laws): Consider the truth tables for psy Example 4. and pv piven below: Pp. p__|pap__|pvp il T iT T P E P We note that (i) pa pand p have same truth values (ii) pv p and p have same truth values, - LOGIC 29) Hence PAPED andpy Pep SC WO logical equi These we logical “divalence are Known as. ley Example 4. qQap: Mpotent Laws, 3.2, (Commutative Laws PY qandayp. W )- Consider the truth t ce have ables of pa q, -——. aap th (Same wuth vatues and so pa Ba lar (Same truth values and so PYq=qvp) It follows therefore that PAG=qApandpvqzqvp ‘These logical equivalences are known as Commutative Laws. Example 4.3.3. (Absorption Law S):- Consider the truth tables of PA(pv q) and pv (p Aq). We have P 4 PAg Pv( pag) T T T | T F F T i F T FE T F F F F | (Same truth values and so p v (p A q) = p) 222 DISCRETE MATHEMATICS Henee PAY A=p and PY (paqgesp These logical equivalence are known as Absorption Laws, Example 4.3.4. (Associative Laws and Distributive Laws) Ifp, Gand, are propositions, then : WAMAT=PAMAD, (PVA) YF=PV (GY) (Associative tay, and ' : PA VD=(PAQYV PAD PY GAD= PV QA (pvr) (Distributive Laws) These laws can be established by the readers themselves. Example 4.3.5. Simplify the logical statement ~(~p Aq) a(py a) Solution, We have ~(~p) v-~q) A (pv q) (De-Morgan Law) pv ~q)a(pvq) (involution Law) pv(-qnq) (Distributive Law) pv (qa~q) (Commutative Law) =pve (Complement laws or Negation Law) =p (Identity law). ~-pAQA(PY 4.4, CONDITIONAL PROPOSITIONS Definition 4.4.1, If p and q are propositions, the com" proposition | N 8 LOGIC ifptheng or pimpliesq |.» conditional proposition or implication and is denoted by poq. {he proposition p is called the hypothesis or antecedent whereas the proposition q is called the conelusion or consequent. The connective if......then is denoted by the symbol >. It is false when p is true and q is false, otherwise it is true. In particular, if p is false, then p — q is true for any q. Definition 4.4.2. A conditional statement that is true by virtue of the fact that its hypothesis is false is called true by default or vacuously true. For example, the conditional statement £4 is a prime number, then J am President of America” is true simply because p : 4 is a prime number is false. So it is not the case that p is true and q is false simultaneously. Thus the truth values of the conditional proposition p > q are defined by the truth table: [pa pq iT I F LE F | OT} tach of the following expressions is an equivalent form of the conditional aan samall tatement p —> q: p implies q qifp ponly ifq pis sufficient condition for q q is necessary condition for p. xample 4.4.3, Restate each proposition in the form of a conditional roposition: )) Twill eat if I and hungry =a 2M DISCRETE MATHEMATICS (b) 3) S> 8 iPitis snowing (©) when you sing. my cars hurt (a) Ram will be a good teacher if he teaches well, (e) A sufficient condition for Sohan to visit Disney land. alcutta is that he Hoes Solution, i (a) If Lam hungry, then 1 will eat (b) If itis snowing. then 3 + 5 =8 (c) If you sing, then my ears hurt (d) If Ram teaches well, then he will be a good teacher (e) If Sohan visit Calcutta, then he goes to Disney land. 4.4.4. REPRESENTATION OF “IF ..... THEN” AS OR. Lemma 4.4.5. Show that for proposition p and q, p> q=-pvq Proof. The truth values for p > q and ~p v q are given below a P| 4 p>4 -P Te en Tj F alee F F Fo) oT T T eae [beak Ht T Same truth values Hence p>q=~pvq Example 4.4.6. Rewrite the statement in “Tf....then” form: Either you teach well or you are terminated. Solution. Let : =p: you teach well and q: you are terminated LOGIC 225 ‘Then the given st ‘atement is ~p vq. But P:youdo not ach Well Hence, the equivalent “Tf. then’ Version of the given statement is Ifyou do not teach well, then you are terminated, Negation of a conditional and only if p is true above that tatement, u We know that p and its conclusion, V > q is false if is false. Also, we have shown P>q=~pvq Taking negation of both sides, we have ~P>q ~P vq) “P) (4) (De-Morgan’s Law) =PA~q (Double negativ (This can also be obtained b the truth tables for ~(p > q) and p A ~q; the truth tables Would have the same truth values proving the ogical equivalence) Thus: Law or Involution Law) Y constructing ‘The negation of “If p then q” is logically equivalent to “p and not q”. Example 4.4.7. Write negations for each of the following statements: Fi (a) IfTamill, then I cannot go to university (b) If my car is in the repair shop, then I cannot attend the class. Solution. We know that negation of * If p then q” is logically quivalent to “p and not q”. Using this fact, the negations of (a) and (b) are spectively ES (1) Tam ill and I can go to university (2) My car is in the repair shop and I can attend the class. _ Remark 4.4.8. The negation of a “if.....then” proposition does ot start with the word “if”. 226 DISCRETE MATHEMATICS Definition 4.4.9. If p > q is an implication, then the » gis the implication q > p oven, mb ition 4.4.10. TI is “If~q then ~p” De “fp then In symbols. contrapositive of a conditiong Slaten, The contrapositive of p > q is ~q -> “p Lemma 4.4.11, A conditional statement is logically ¢ its contrapositive. Svat Proof. The truth tables of p > q and ~q > ~p are: ___p>4 g>~p [p_ | pa [=p ~q iT T Tro | I F r T F iF T ;FOOT T F T T F lp _F[ T FOF [Tt T 1 | a ae Hence p>q=~q>~p Example 4.4.12. Give the converse and contrapositive of the implicatic, (a) If itis hot, then I take cold drinks. (b) If today is Monday, then tomorrow is Tuesés; Solution. (a) We have p: Itis hot q: I take cold drinks The converse is q > p: If I take cold drinks, then it is hot. ‘The contrapositive is ~q > ~p: If I do not take cold drinks, then it isnot hot. (b) we have p: Today is Monday q: Tomorrow is Tuesday The converse is q > p : If Tomorrow is Tuesday, then today is Mon} a — LOGIC 297 SOnttpositive jg qo Monday pelt tomorrow is not Tuesday, then today is Definitio; x Phe inve [ i nition 4.4.13, The MVerse of the Conditional Statement P > q Mple, the inverse of sip today is Sunday, then, tomorrow js lay” is “Wtod ay is not Sunday, then tomorrow is not Monday”, Remark 4.4.14, pg Conditi d inverse may or may not onal state be true, Ment is true, then its converse Only ift- ~ p only iq = mean: also. That is. if 9 does not tak > >~p. Therefore equiv; trapositive imply that ~ iS that p can t © place, then lence between if p occurs, th ‘ake place only if g takes P cannot take place, a statement and en q must also occur”, Hence - “p only if q” means « e. “if not q, then not P” or Remark 44.15. “p only if q” does not mean “pifq’. ple 4.4.16. Use contrapositive to rewrite the following statement | xample 4.4.16. then” form: Solution. Version 1: We have p: Ram will stand first in the class q: he works twelve hours a day itive is ~q — ~p : If Ram does not works twelve hours a ntraposi ~ 2 en he will not stand first in the class. Version 2 : If Ram stands first in the class, then he will work i : If Ram stands first i lass. ‘ill 7 i Defi i tion 4 4.17. If p statements, the compound E a and q are em " ° it ind only : q” is called a Biconditional statement or an Ment “p if ai y if alence. It is denoted by p © q. a Observe that p <> q is true only when by when both p and q are false.(i.e. if both p and and is false if p and q have opposite truth values, 228) DISCRETE MATHEMATICS oth Pa have gant 4 a : . Thug 91° tug statement has the following truth table: MS the pih , peg : ~ pee | iT TJ iT F Hy pole ee E Be lig Lemma 4.4.18. If p and q are propositions, then PqG=(P>qQ)A(q>p) Hence p< q =(~pvq)A(~qvp)- Proof. We know that “ p if and only if q” means that oy, . and “ p only if q” hold. This means p <> q should be Io, pall means p ically en.” to (p > q) A (q > p). We verify it using the truth table: at pq p>q q=>p poq | (pa)aigay pa z F TI else) Ta 15 F T } F | F F - T F IE | F Fae ie T Te S| Sa c Same truth values Hence peg = (pq) 4 (GP) It follows therefore that biconditional statement can be wa the conjunction of two “if......then” statement namely p > 42: Also we know that P>q=-pvq and so q>p=~qvp Hence peq=(p>q)a(q>P) =(-pvq)a(-avP) LOGIC 229 _ quatements having > or © symbol are logic Land v. ly equivalent to ition AAL9, Letp and q be statements, Then pis a sufficient if p then q” pis a necessary condition for q means 4.4.20. The hierarchy of opera ns of logical connectives : The a , of operations of connectives are onde! >A OLE Definition 4.4.21. An argument is a sequence of statements. All but the final one are called premises (or assumptions or The final statement is called the conclusion. read “therefore”, is generally placed just before the 2. LOGICAL FORM OF AN ARGUMENT Fs The logical form of an argument can be obtained from the contents ‘of the given argument. For example, consider the argument: If a man is a bachelor, he is unhappy Ifa man is unhappy, he dies young . Bachelors die young The logical form of the argument is : Ifp then q Ifqthenr por, p: He is bachelor q: He is unhappy r: He dies young Definition 4.4.23. An argument is said to be valid if the lusion is true whenever all the premises are true. 232 DISCRETE MATHEMATICS The tact that this argument is valid is called Modus To! x alled ‘ Tollens Which (Method of denying) since the conclusion is a denial, Mee, Theorem 4.4.29 (Rule of Inference, Law of Hypothetical Sylogism). The argument Deeadl q>r Syllogi fr “por is universally valid and so is a rule of inference. In other words, @>g)AqG>nN>0>n is a Tautology. Proof. The truth table for the argument and the Conclusion given below : pq r p>q qor por | Tete T T T T Critica Ty eh =F T F F Wor F T T TF F F T F FOOT T T T T Cty FT F T F T Fe eeeeT, T ie T Cite FF F T a T | ties We observe that the critical rows for the premises pP>4q4,q>rarls Tow, Sth row, 7th row and 8th row. The conclusion (p — r) in these ros is also true. Hence the argument is valid. Also we note tt (Pp > 4) A (q > 1) > (p > 2) is a tautology because all the truth values this case are true, Example 4.4.30. Consider the argument If you invest in the stock market, then you will get rich If you get rich, then you will be happy ~. If you invest in the stock market, then you will be hap): hoa 2h satution, Ny tule oF Mferenee, the argument iy valid, aympte gah Verily the validity of the argument Drinking ts healthy {drinking is healthy, then wine iv preseribed by the phyntelana «. Wine is preseribed by the phyalelans, Solution. In symbols, the argument is p pod vq ‘ye argument is of the form Modus Ponens (or Law of Detachment) and Se itis valid. However, the conclusion is false, Observe ‘that the first ynises, p 2° Drinking is healthy", is false, The second premines, p> 4 isthen true and conjunction of the (wo premises (p> (p —>q)) is false “Faample 4.4.32. ‘The following arguments are valid: Conclusion pv 1 aC riticnl row AC ritical row . Hence the argument ts r. 4 DISCRETE MATHEMATICS ) The truth table is The conclusion in the critical rows is true. Hence the argument is vatig Example 4.4.33. The following arguments are valid: (a) (b) P q .paq “iPaq (These arguments are called Conjunetive Simplification and are used j, particularizing. For example (a) says that if both p and q are true, then in particular, true. The validity of these arguments can be proved using truth tables Example 4.4.34. The arguments (a) (b) pvq and pvq ~q ~P Pp q are valid For zmple. (a) says that there are two possibilities p or q but q isn there. Hence p is there. So (a) is valid. Similarly (b) is valid. Ths arguments are called “Disjunctive Syllogism”. Example 4.4. argument Dilemma: (Proof by Division into cases). ‘The pyq por qor ae feat Recaimes GOW EPA —e C+ fu ec erm eae Fesmpfe £4.36. Coime the thllnwong ame mame near te ree sider che aoa: iV the house: a meet ay ¢ lake het tee reso ea ie ie OF die tres inp fhm vant oo 2 mates ret fer te teem he sachee. Tite Hane Ot leet Oe ak re tres im thee Shane gent os = mene es or thie ree ee efi de mmr ar he wail ot he tet eo, the wes on tte back cant is an adit wes few fe creme i fe crowing mam. Snfrtinm Lec o> felnmeicomrarsiie ¢@ > hetere sin fe oe © > feces onde inerrant See S$ > te veasume & sigest Sehmt he mor or fe wall of the det om to dees in de eck vant Se erack mee the logical fhemsof te clues are - p+ re z (mp cus sy t—£ The fhilowing deductions oun te made ap poe EB ay = ay Slade Somes GQ coe re ag ay die cmeisin af 2 ue oe ay Minihs Tailizx mes Sy ia a Aor iy NG bg ee Ms, Me PASC RE TE VECTTTIEAEATIOS Seon Whe Henman bs laced Helin the mite fn the a Hoe Mey elie fas Het Tid set fy net the eonetision Rranaphe dab ob Ur ithene ts a nas HY the eats then toni ay AE Naty gay iy The staves Hhett he WHE pet sada Thene AUAtt Ratt geld san iN jp to AS Was jn, yen Notations ot Jy Vivore ts a gta tht the ear ay) John vill gota stare ye dota vill peta soda. Yomnaal farans of the yven statements ane | Ww parg WwW yger we) p Now trys dhatiretions can be mtd sy psa bya) » by (e) =) by Modus Ponens OQ) ger by a) Q oo by the conclusion of (1) ag by Modus Ponens Renee, Jotn will get a soda, Example 44.38, The software engineer makes the follow ing observate® An a conrputer programming | Ww Urere ts an undeclared variable or there is a the first five tines syntax erm" , cas A Rect fac at cist (ii) (there isa syntay ertor in the first tive lines, then ther missing semicolon or a variable name is misspelled. ya ii) There is not a missing semicolon LOGIC 237 (iv) There is not a misspelled variable name Find the mistake in the program. Solution. Let p: There is undeclared variable qi There isa syntax error in the first five lines tr: There is a missing semicolon s: Variable name is misspelled The logical forms of the given statements are (i) pyvq (ii) qrarvs (iii) o~r (iv) ~s ().4er by (iii) rs by (v) att by conjunction. But~rA~s= ~(rvs). Thus the first conclusion is ~ (rv s). (2) q7rvs by (ii) ~(rvs) by the conclusion of (1) oq by Modus Tollen GB) pyq by (i) ~q by the conclusion of (2) p by Disjunctive Syllogism. 238 DISCRETE MATHEMATICS i Frample 44.29, Show that the following argument ig invatig Ee Itayes are lowered, then income tises, 5 Income rises: Ee Vaxes are lowered Solution, Let p: Taxes are lowered q: Income rises Then the argument form is p>q q oC ‘The truth table for the premises and conclusion is Premises Conclusion foros | © Critical my 7 mad aa }- © Critical me In the third critical row, the conclusion is not true. Hence the argument not valid. Example 4.4.40. Is the following argument valid? If two sides of a wiangle are equal. then the opposite angles are equal Two sides of a triangle are not equal *- The opposite angles are not equal, Solution. In symbolic form the argument is Pq ~P The truth table is as LOGIC 239 Critical row “| Critical row Grd and 4th row are itical rows. But in the 3rd row, the false. Hence the proposition is a fallacy. edd. Consider the following argument for validi aple 4 If | study, then I will not fail in mathematics If Edo not play basketball, then I will study But I failed in mathematics -.L must have played basketball © Solution. The symbolic form of the argument is (a)p>q (b) rp ()~4 y can be verified by the following two methods : rst Method:- The following deductions can be made: (1) p>q by (a) ~q by (c) - iene by Modus Tollen 2) rop by (b) ~P by (1) oT by Modus Tollen tue (conclusion). Hence the argument is valid. = Wig MO DISCRETE MATHEMATICS: Second Methods Cho tite table Ge the arginine < Hromises: > Conolininy [pea | ron] ca eae t \ \ \ 1 t v i | ' | | | \ \ \ t t \ \ ' yo} v ; \ y by} fy R ti} t ; ¥ v P ELT { \ ' \ Wy, " hat there is only one critical cow (SIA row) in the ttt Aah sion is also true in the critical row, Hence the angume “ly SUM Is Vali Remark 4442. tis pos conclusion and for an invalid 2 example ible for a valid argument to Nave gay gute 4 HAVE AE wong | i (1) Uf Sohan was an artist, then Sohan had green hair Sohan was an artist Soban had green hair, In symbol, we have pq | | P 4 The argument is valid by Modus Ponens, But its major premises ki and so is its conclusion, (2) If Delhi is a big city, then Delhi has tall buildings Delhi has tall buildings Delhi is a big city The symbolic form of the argument is LOGIC Ay pod 4 p q-op a cup Which is valid, ed.d3. Consider the argument form Remark . pod “p aq valid, But il’ we replace the see that the argument form is valid. pq. then it becom is called Inverse E f the supposition that the statement p is false leads logically to a tadiction, then you can conclude that p is true, is a contradiction 5 1 poe F—sCritcal row E F | lises and conclusion are both true in the critical row and hence nent is valid. M420 DISCRETE MATHEMATICS, Pyample 44.48, Knights and Knaves (Raymond § | of an island containing Wo types of people): "Thi wan k types of people: knights who always tell the truth and Ki a cone bie \ visitor visits the island and approached two mative 2) \isitor as follows: *5 Whos , \ A says : Bisa knight B says : A and I are of opposite type, What are A and B? Solution. Suppose A is a knight. Because A always it follows that B is a knight. they Therefore what B says is true (by the definition of Knight). They, and B are of opposite type. Thus we arrive at a contradiction: ands, both Knights and A and B are of opposite type. Therefore Supposig wrong. Hence A is not a Knight. So A is a Knave. Therefore wha, is false. Hence B is not a Knight and so is a Knave. Hence A and, both Knaves. SUMMARY OF RULES OF INFERENCE Valid Argument Forms 1.Modus Ponens: p>q P od 2. Modus Tollens: p>q ~q Dp 3. Disjunctive Addition: (a) op (b) 4 pyq for any q pvq foranyP 4, Conjunctive Simplification: ia) paq oO Dp 4 Conjunctive Addition: P 4 “paq Disjunctive Syllogism: pea (b)pyvq e ~P xp a Bric! Syllogism: p>4q q>r “por . Dilemma: proof by division into cases: pyq por k q->r r Rule of contradiction: ~p—> c, where c is a contradiction E Ap, SOUANTIFIERS So far we have studied the compound statements which were made ple statements joined by the connectives ~. a, v, ~> and «>, That Not be used to determine validity in the majority of everyday and ical situations. For example, the argument 2440 DISCRETE MATHEMATICS: All men are mortal All teachers are men are mortal All teacher is intuitively correct. Yet its validity cannot be derived using studied so far. To check the validity of such argument it ig eq separate the statements into parts, subjects and predicates, Also Sy analyse and understand the special role played by words qo quantities such as All or Some. ney Definition 4.5.1. The symbolic analysis of prediogy, quantified statements is called the predicate calculus Whom. ® symbolic analysis of ordinary compound statements is. aj Statement Calculus or prepositional calculus. t In English grammar, the predicate is the part of a sentenge« gives information about the subject. For example, in the sentence is a resident of Karnal”, the word Ram is the subject and the phrases, resident of Karnal” is the predicate. Thus, predicate is the part ty sentence from which the subject has been removed. In logic, predicates can be obtained by removing any nouns fre statement. For example, if P stands for “is a resident of Karnal” aj is a resident of”, then both P and Q are predicate symbols jj mal” and “x is a resident of y” are de: ', where x and y are predicate variables stands for sentences “x is a resident of Ki as P(x) and Q(x, y) respectivel take values in appropriate sets. Definition 4.5.2. A predicate is a sentence that contains a number of variables and becomes a statement when specific valus: substituted for the variables. The domain of a predicate variable is the set of all values th! be substituted in place of the variables. The predicates are also kno" “propositional functions or open sentences”. Definition 4.5.3, Let P(x) be a predicate and x has domain." the set {x © D: P(x) is true} LOGIC 945 et of POS) 4 P(x) be “x is an integer less than §* ee ; " sche set oF all positive integers, Then the . we ,6, 7) and suppose the truth set of P(x) is yand Q(X) be predicates with common domain D of x. The po) = Q(x) means that every clement in the truth Set of P(x) is fa set of QS). et US anne et the domain of x be these of positive integers and et rex! 7 P(x): “x is an integer less than 8” Q(x) 7x is a factor of 4” ‘Truth set of P(x) is (1, 2.3, 4, 5,67} Truth set of Q(x) is (1.2, 4} every element in the truth set of Q(x) is in the truth set of P(x), Defimni such as “All”, some” and tell for how many elements a given predicate is true are All men are strong, En be written as Vx © §, xis strong, S denotes the set of all men. Mo DISCRETE MATHEMATIOS Vetinition ASo. Lot POX be a predicate and py tho vex) a8 calle ‘ statentent at the farm "ye De BO) is called andy 19 gly arene Sa stag, A universal statement Pox) ts trae ian only PDQ) iy VY anal a universal statement POX) is false Hand only: ie the : O° ete, least one vc 1. y Modis th, \ vale tor x tor whieh POX) is false is called a Conny tere, universal statement. | Example 48.7. Let = (12.3.4) and consider the Universal} tt le DDE Ve Dextay " ; . \ Uhis is true forall values of x cD since | = 2 and so on, But the universal statement QW: VreN nt 2sg se ifwe taken 6, then 8 > 8 which is absurd Definition 4. The symbol 3 denotes “there eNists" and called the existential q utifier, Vhere is a Universi ample, the sentences n Kurukshetra id ‘can hy Sa university u such thatu is in Kurekshetra, oF, We can write Jue U such that u is in Kurekshetra, where U is the set of universiti ‘The words such that are inserted just before the predicate, Let P(x) be a predicate and D is the domaine! . 2 statement of the form “3.x © D such that P(x)" is called an Existentil Statement. It is defined to be true if and only if P(x) is true for at le! one x in D. Its false if and only if P(x) is false for all x in D. For example the existential statement dneN:nt+3<9 ts true since the set fnint3<9}5 (1: VaVGTC 24? oN ROA S When HO Cdistatee statement tye Arwen RNS CARAT WA Whose eQuare Ys equal ty tiselt ARYL. \xeetenrent aot the Bay, EAC APD AD Pres QA) gine OPFOR MEAHOMTONT SANA UO BERANE EVE RATS DAN SS einnatih (ASNT RNART NERROANNT censeto ASD YARD Bis ats KARAT NB SATONAT otihe fan Aho HAAN OF A WAVE rsal statentent Sua Dyed Ha DOD eve Dyes Fre D oO) soca ge'k SANOENRT SEARRNORE AT ave" fs Rogieally equivalent to an SiH RAE BRE OE eR OF ) Sar all postive Mateger 8 We have f+ 2>0° © Phare ONIN @ Powe Hntager nh such thatn + 2 F nm SQA of All sraddass ave rrellgent” “Some stants are rat inteltigant™ “2 a sradent who is trot atellgean’. - MS DISCRETE MATHEMATICS (i) the negation at * No potiticians ate honest! “J apotitionan x sttel thats is honest ao : “Some politicians are honest”, Definition 4.5.12, The negation of a universal conditionay Staley me detinod by : (UN, P(X) > Q(x) e FN stich that QUX}) & POX). 4 ~Q(). Hence (WN, P(X) > Q(x) @ TN sue that P(x) a QW), that is, “VN, P > QU) = x such that P(x) and Qh), Example 4.3.14, ‘The negation of universal conditional statement “V human being x, ix 1s. man, then x is strong” “Fa human being v such that y isa man and x is not strong” [FP(x) is a predicate and the domain of x i then the statement VxeD,Pix) and P(X) A PX3) Asad POS) ate logically equivalent, For example, let P(x) be NX and let D © (0,1). Then Vxe D,P(x) LOGIC ayo Ayritten as V binary digitss, yg yoy js cquivalent to 0.0=Oand 1, can be written as P(O) A PUL) n} then the statements 3x € DPQ) P(x) v POD) v...V POXn) ically equivalent. - Definition 4.5.15. Let Vx € D. if P(x) then Q(x) statement. Then ntrapositive of this statement is Wx € D. if ~Q(x) then ~P(x) ‘onyerse of this statement is a Wx € D. if Q(x) then P(s) Vx €D, if~P(x) then ~Q(x) NIVERSAL MODUS PONENS Formal Version Informal Version If P(x) then Q(x) Ifx makes P(x) true, then x makes Q(x) true i) for a particular a a makes P(x) true . amakes Q(x) true. 250 DISCRETE MATHEMATICS \n argument of this form is called a SyMlagism, 4 ; : hes Sond premises are called its major premises ant mingy it Tespectively Example 4.6.1, Consider the argument i All men are good Ramesh is a man Ramesh is good The major premise of this argument is VX. ifs is aman, then x is good Let P(x): x isa man Q(x): x is good P(a) : Ramesh is a man Therefore. by Modus Ponens, the argument is valid, 4.7. UNIVERSAL MODUS TOLLENS ‘ The following argument form is valid Formal Version Informal Version Y x if P(x) then Q(x) Tfx makes P(x) true, then x makes Q(x) ne ~Q(a) for a particular a a does not makes Q(x) true ~P(a) “. a does not makes P(x) true. Example 4.7.1. Consider the argument form All intelligent persohs ate engineers John is not an engineer v John is not intelligent The major premise of this argument can be rewritten as Vx, ifx is intelligent, then x is an engineer Let yx): \ is ireeiliigene Quy | an engineer Zon isa tautology. Restate the following as implications “If..., then..." : ji ‘A suflicient condition that a figure be rectangle is that it be a square, (ji) Lam citizen of India if Lam living in Bangalore (iii) A necessary condition for Pakistani’s to win cricket match is that they have at least two left hander batsmen. Write negations of the following propositions : (i) No rectangle is a square (ii) He takes his bath if'and only if the water is cold. (iii) If it rains, then they do not go for a walk. Verify the validity of the following arguments : (a) (i) If there are more pigeons, then there are pigeonholes, then atleast two pigeons fly into the same pigeonhole. 234 DISCRETE MATHEMATICS ai) There are more pigeons than there are pigeon» (iii) Therefore, at least two pigeons fy into yg, pigeonhole. (b) (i) If this number is divisible (ii) This number is not divisible by 3 is number is not divisible by 9. by 9. then it is divisibje, (iii) Therefore. thi 5. State the converse, inverse and contrapositive to the fol, statement : “If triangle ABC is a right triangle. then [ABI ~ BC) rgument is a fallacy : 6 Show that the following a yy. then, today is May 18. If today is Smith’s birthda; Today is May 18 birthday. Therefore, today is Smith's ¢ argument valid? Let x be a real number. Is the followin: 7. x is positive or x is negative If x is positive. then x° > 0 Ifx is negative, then x*> 0 ox >0 §._ Verify the validity of the following argument by using rules inference : If Julia does not live in Italy, then she does not speak Italian. Julia does not drive a car If Julia lives in Italy, then she travels by a train Either Julia speaks Italian or she drives a car. Therefore, Julia travels by a train 9. Verify the validity of the following argument : ~r pq LOGIC 255 qor =P rll in the blanks : jy ‘(the graphs are isomorphic, then thei . ir degre: will be the same inital ‘Their degree spectrums are different Hence.......-. eee (ii) fit rains, Bill will be happy Bill is not happy Therefore... Write negation of the following sentence by changing quantifi fiers ~Evecy complete bipartite graph is not planar” Express the following statement ii ae te e in te i quantification rms of existential ~The number 24 can be written as a sum of two even integers”

You might also like