Upcoming SlideShare
×

# Chapter 1

599 views

Published on

1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
599
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
0
0
Likes
1
Embeds 0
No embeds

No notes for slide

### Chapter 1

1. 1. SUBTOPIC 1 : PROPOSITIONS AND LOGICAL OPERATIONS.1.1 Propositional Logic.Definition A proposition is a declarative sentence that is either TRUE or FALSE, but NOT BOTH.For the example of declarative sentence that are not propositions: Zulhelmy will not win the Thomas cup this year. X+1=3For the example of declarative sentence that are not propositions: Kuala Lumpur is a capital of Malaysia. 2+2=4NotationWe use letters to denote propositional variables (or statement variables) that is , variablesthat represent propositions , just as a letters are use to denote numerical variables. Theconventional letters used to denote numerical variable. The conventional letters used forpropositional variables are p , q , r , s ,….. The area of logic that deals with propositions iscalled propositional calculus or propositional logic. Logic is more precise than natural language. The study of the principles of reasoning,especially of the structure of propositions as distinguished from their content and of method andvalidity in deductive reasoning. 1
2. 2. Examples : - You may have a chiken rice or spagethi ( vague ) Can I have a both? - If you buy this karipap in advance, its cheaper. Are there not cheap last minute karipap? For the reason, logic is used for hardware and software specification such as given a setlogic statement and one can decide whether or not they are satisfiable, although this is a costlyprocess. By George Boole, born on November 2 , 1815 in Lincoln , England. Died on December 8, 1864 in Ballintemple, Ireland at 49 years old. In 1854, George Boole established the rules of symbolic logic in his book , The Laws Of Though. USE OF LOGIC GATES Logic gates are the building block of digital electronics. They are formed by the combination of transistors to make digital operations possible. Every digital product like a computer, mobile phones, calculator even digital watch contains logic gates. That’s mean, the logic gates are very important in the electric and electronics to know the solution of every components. 2
3. 3. Propositional Logic – Negation is another propositions. Let p be a proposition. Thecompound proposition is “it is not the case that p”. It called the negation of p and the denoted of⌐p. The truth value of the negation of p is the opposite of the truth value of p. The proposition ⌐pis also can say as “not p”. Example: Discrete mathematics is Hasrul’s favorite subject. ( p ) Discrete mathematics is NOT Hasrul’s favorite subject. ( ⌐p )Truth the table for negation : p ⌐p p ⌐p True False or T F False True F T Table A Table B The truth table presents the relations between the truth values of many propositionsinvolved in a compound proposition. This table has a row for each possible truth value ofpropositions. Logical operators are more interesting statements can be created through the combinationof two propositions using logical operators. Operators use to combine propositions and the resultof connecting two propositions is another proposition. The common logical are AND (˄),OR(˄ and NOT OR (⊕). ) 3
4. 4. Propositional Logic – Conjunction is a compound proposition that has componentsjoined by the word and or its symbol and is true only if both or all the components are true. Let pand q be propositions. The compound proposition “p and q“ or we can say that “p ˄ q”, is truewhen both p and q are true and false otherwise. For the example in a sentence are: Faiz is a singer (p) and dancer (q).Truth the table for conjunction: p q p˄q T T T T F F F T F F F F Propositional Logic – Disjunction is a proposition that presents two or more alternativeterms, with the assertion that only one is true. Let p and q be propositions. The compoundproposition “p or q“ or “p ˄ q“, is false when both p and q are false and true otherwise. Thecompound proposition “p ˄ q“ is called disjunction of p and q. For the example in a sentence are: Faiz is a singer (p) or dancer (q).Truth the table for disjunction: p Q p˄q T T T T F T F T T F F F 4
5. 5. Propositional Logic – Exclusive Disjunction is a Logic the connective that gives thevalue true to a disjunction if one or other, but not both, of the disjunction are true. Let p and q beproposition. The compound proposition “p exclusive or q“, denoted “p ⊕ q“, is true whenexactly one of p and q is true and is false otherwise. This compound proposition “p ⊕ q“ iscalled exclusive disjunction of p and q. For the example in a sentence are: You can have a PS2 (p) or PSP (q).Truth the table for the exclusive disjunction: p q p⊕q T T F T F T F T T F F F 5
6. 6. EXERCISE: 1. Write the truth table of each proposition a) p ˄ ⌐q b) (p ˄ q) ˄ ⌐p 2. Formulate the symbolic expression in words using. p: you play football q: you miss the midterm exam r: you pass the course a) p ˄ q b) ⌐ (p ˄ q) ˄ r 6
7. 7. SUBTOPIC 2 : CONDITIONAL STATEMENT 2.1 CONDITIONAL Propositional Logic – Implication mean that the operator that forms a sentence from twogiven sentences and corresponds to the English if … then … Let p and q be propositions. Thecompound proposition “if p then q“, denoted “p → q“, is false when p is true and q is false, andis true otherwise. This compound proposition p → q is called the implication (or the conditionalstatement) of p and q. In this implication, p is called hypothesis ( or antecedent or premise ) and q is called theconclusion ( or consequence ). Example: If muzzamer is the agent of Herbalife (p), then he used the product (q). If p, then 2 + 2 = 4.Truth the table for the implication: p q p→q T T T T F F F T T F F T REMARKS: - The implication p → q is false only when p is true then q is false. - The implication p → q is true when p is false whatever the truth value of q. 7
8. 8. THE IMPLICATION: Variety of terminology is used to express the implication p → q If p then q p implies q q is p p only if q q when p p is sufficient for q a sufficient condition for q is p q follows from p q whenever p In natural language, there is a relationship between the hypothesis and the conclusion ofan implication. In mathematical reasoning, we consider conditional statements of a more generalsort that we use in English. The implication “if today is Friday , then I pray in the mosque “Is true every day except Friday, even though I pray in the mosque is false. The mathematical concept of a conditional statement is independent of a cause and effectrelationship between hypothesis and conclusion. We only parallel English usage to make it easyto use and remember. 8
9. 9. 2.2 BICONDITIONAL Definition: let P and Q be two propositions. Then, P ↔ Q is true whenever P and Q have the same truth values. The proposition P ↔ Q is called biconditional or equivalence, and it is pronounced “P if and only if Q”. When writing, one of frequently uses “iff” as an abbreviation for “if and only if”.The truth table is given above. The following is an example of a biconditional. Let P be theproposition that “x is even” and Q be the proposition that “x is divisible by 2.” In this case, P ↔Q expresses the statement “x is even if and only if x is divisible by 2.”Let p : Jamal receives a scholarship q : Jamal goes to college. The proposition can be written symbolically as p ↔ q. Since the hypothesis q is false,the conditional proposition is true. The converse of the propositions is “If Jamal goes to college, then he receives the scholarship”.This is considered to be true precisely when p and q have the same truth values.If p and q are propositions, the proposition p if and only if qIs called a biconditional proposition and is denoted p↔q 9
10. 10. Truth table for the biconditional: p q p↔q T T T T F F F T F F F TLogical equivalencesSimilarly to standard algebra, there are laws to manipulate logical expressions, given as logicalequivalences.1. Commutative laws PVQ≡QVP PΛQ≡QΛP2. Associative laws (P V Q) V R ≡ P V (Q V R) (P Λ Q) Λ R ≡ P Λ (Q Λ R)3. Distributive laws: (P V Q) Λ (P V R) ≡ P V (Q Λ R) (P Λ Q) V (P Λ R) ≡ P Λ (Q V R)4. Identity PVF≡P PΛT≡P5. Complement properties P V ￢P ≡ T (excluded middle) P Λ ￢P ≡ F (contradiction)6. Double negation ￢ (￢P) ≡ P7. Idem potency (consumption) PVP≡P PΛP≡P8. De Morgans Laws ￢ (P V Q) ≡ ￢P Λ ￢Q ￢ (P Λ Q) ≡ ￢P V ￢Q9. Universal bound laws (Domination) PVT≡T PΛF≡F10. Absorption Laws P V (P Λ Q) ≡ P P Λ (P V Q) ≡ P 10
11. 11. 11. Negation of T and F: ￢T ≡ F ￢F ≡ TFor practical purposes, instead of ≡, or ↔, we can use = .Also, sometimes instead of ￢, we willuse the symbol ~.Example:Show that [p˄ (p → q)] →q is atautology.We use ≡ to show that [p˄ (p → q)] →q ≡ T[p˄ (p → q)] →q≡ [p˄ (⌐p ˄ q)] →q Substitution for →≡ [(p˄ ⌐p) ˄ (p ˄ q)] →q Distributive≡ [F ˄ (p ˄ q)] →q Uniqueness≡ (p ˄ q) →q Identity≡ ⌐ (p ˄ q) ˄ q Substitution for →≡ (⌐p ˄ ⌐q) ˄ q DeMorgan’s≡ ⌐p ˄ (⌐q ˄ q) Associative≡ ⌐p ˄ T Excluded middle≡T DominationSo, Show that [p˄ (p → q)] →q is a tautology (true). 11
12. 12. 2.3 DE MORGAN’S LAW FOR LOGIC We will verify the first of De Morgan’s Law ⌐ (p ˄ q ≡ ⌐p ˄ ⌐q, ) ⌐ (p ˄ q) ≡ ⌐p ˄ ⌐q By writing the truth table for P = ⌐ (p ˄ q) and Q = ⌐p ˄ ⌐q, we can verify that, givenany truth values of p and q, either P or Q are both true or P and true are the both false: p q ⌐ (p ˄ q) ⌐p ˄ ⌐q T T F F T F F F F T F F F F T TExample:~ (B Å C) = ~ ((B Λ ~C) V (~B Λ C)) =Apply De Morgans Laws= ~ (B Λ ~C) Λ ~ (~B Λ C) =Apply De Morgans laws to each side= (~B V ~ (~C)) Λ (~ (~B) V ~C) =Apply double negation= (~B V C) Λ (B V ~C) =Apply distributive law= (~B Λ B) V (~B Λ~C) V (C Λ B) V (C Λ ~C) =Apply complement properties= F V (~B Λ~C) V (C Λ B) V F =Apply identity laws= (~B Λ~C) V (C Λ B) =Apply commutative laws= (C Λ B) V (~B Λ~C) =Apply commutative laws= (B Λ C) V (~B Λ~C) = B C 12
13. 13. EXERCISE: 1. Assuming that p and r are false and q are true, find the truth value of each proposition: a) p → q b) (p → q) ˄ (q → p). 2. Formulate the symbolic expression in words using: P: today is Monday q: it is raining r: it is hot a) ⌐ (p v q) r 3. Show that (p ˄ q) → q is a tautology. 4. Show that ⌐ (p q) ≡ (p ⌐q) 13