Upload
syed-umair
View
38
Download
7
Embed Size (px)
Citation preview
Discrete Mathematics
Defecation of Discrete Mathematics:
Concerns processes that consist of a sequence of individual step are called Discrete Mathematics
Continuous Discrete
LOGIC:
Logic study of principles and method that distinguishes/difference b/w valid and invalid argument is
called logic.
Simple statement:
A statement is declarative sentence that is either true or false but not both.
A statement is also referred to as a proposition
Examples:
1. If a proposition is true then we say that a value is true.
2. And if proposition is false then we say that truth value is false.
3. Truth & false are denoted by T and F
Examples:
Propositions: Not Proposition:
1. Grass is green. Close the door.
2. 4+3=6. X is greater than 2.
3. 4+2=6. He is very rich.
Rules:
If the sentence is preceded by other sentences that make the pronoun or variable reference clear, then
the sentence is a statement.
Examples:
False True
I. X=1 Bill gates is an American
II. x>3 He is very Rich
III. x>3 is a statement with truth-value He is very rich is a statement with
truth-value
UNDERSTANDING STATEMENTS:
1. X+2 is positive Not a statement
2. May I come in? Not a statement
3. Logic is interesting A statement
4. It is hot today A statement
Compound Statement:
Simple statement could be used to build a compound statement.
Examples:
1. 3+2=5 and Multan is a city of Pakistan
2. The grass is green or it is hot today
3. Ali is not very rich
And, Not, OR are called Logical Connectives.
SYMBOLIC REPRESENTATION:
Statement is symbolically represented by letters such as “p, q, r…
EXAMPLES:
p=”Multan is a city of Pakistan”
q=”17 is divisible by 3”
CONNECTIV MEANING SYMBOL CALLED NEGATION NOT ˜ TILDE
CONJUNCTION AND ^ HAT DISJUNCTION OR v VEL
CONDITIONAL IF……THEN ARROW
BICONDITIONAL IF AND ONLY IF DOUBLE ARROW
EXAMPLES:
p=”Multan is a city of Pakistan”
q=”Ali is a Muslim”
p ^ q=”Multan is a city of Pakistan” AND “Ali is a Muslim”
p v q=” Multan is a city of Pakistan” OR” Ali is a Muslim”
˜p=”Multan is not a city of Pakistan”
TRANSLATING FROM ENGLISH TO SYMBOLIS:
Let p=”it is cold”, AND “it is Ali”
SENTENCE SYMBOLIC
1. It is not cold ˜P
2. It is cold AND Ali P ^ q
3. It is cold OR Ali p v q
4. It is NOT cold BUT Ali ˜p ^ q
COMPOUND STATEMENT EXAMPLES:
Let a=”Ali is Healthy” b=”Ali is Wealthy” c=”Ali is Wise”
i. Ali is healthy AND wealthy But NOT wise. (a ^ b) ̂ (˜c)
ii. Ali is NOT healthy BUT he is wealthy AND wise. (˜a) ̂ (b ̂ c)
iii. Ali is NEITHER healthy, Wealthy NOR wise. (˜a ^ ~ b v ~ c)
TRANSLATING FROM SYMBOLS TO ENGLISH:
Let: m=”Ali is a good in math” c=”Ali is a com. science student”
I. ~ C Ali is “NOT” com. Science student.
II. C v m Ali is com. Science student” OR “good in math.
III. M ^ ~ c Ali is good in math” BUT AND NOT “a com. Science student.
WHAT IS TRUTH TABLE?
A truth table specifies the truth value of a compound proposition for all possible truth values of its
constituent proposition.
A convenient method for analyzing a compound statement is to make a truth table to it
NEGATION (~)
If p=statement variable, then negation of p “NOT p”, is denoted by “~p”
If p is true, ~p is false
If p is false ~p is true
TRUTH TABLE FOR ~P
P ~P
T F
F T
CONJUNCTION (^)
If p and q is statement then conjunction is “p and q”
Denoted by “p ^q”
If p and q are true then true
If both or either false then False
P ^q
P q P ^q T T T
T F F F T F
F F F
DISJUNCTION (v)
If P and q is statement then “p or q”
Denoted by “p v q”
If both are false then false
If both or either is true then true
P v q
P q P v q T T T
T F T
F T T F F F
Truth Table for this statement ~p^ q
P q ~p ~p ^q T T F F
T F F F
F T T T F F T F
Truth Table for ~p^ (q v ~r)
P q r ~r (q v ~r) ~p ~p ^(q v ~r) T T T F T F F
T T F T T F F
T F T F F F F T F F T T F F
F T T F T T T F T F T T T T
F F T F F T F F F F T T T T
Truth table for (p v q) ̂ ~ (p ̂ q)
P q (p v q) (p ^ q) ~(p ^q) (p v q)^~(p ^q) T T T T F F
T F T F T T
F T T F T T F F F F T F
Double negation property ~ (~p) =p
P (~p) ~(~p) T F T
F T F
So it is clear that “p” and double negation of “p” is equal.
Example
English to symbolic
P= I am Umair Shah
~p= I am not Umair Shah
~ (~p) = I am Umair Shah
So it is clear that double negation of “p” is also equal to “p”.
~ (p ̂ q) & ~p ^~q are not Equal.
P q (p ^q) ~(p ^q) ~p ~q ~p ^~q T T T F F F F
T F F T F T F F T F T T F F
F F F T T T T
So it is clear that “~ (p ̂ q) & ~p ^~q” are not equal
De Morgan’s Law
1. The negation of “AND” statement is logically equivalent to the “OR” statement in which each
component is negated.
Symbolically ~ (p ^q) = ~p v ~q
P q P ^q ~(p ^q) ~p ~q ~p v ~q
T T T F F F F T F F T F T T
F T F T T F T F F F T T T T
So it is clear that ~ (p ̂ q) = ~p v ~q are logically equivalent
2. The negation of “OR” statement is logically equivalent to the “AND” statement in which component
is negated.
Symbolically ~ (p v q) = ~p ^ ~q
P q (P v q) ~(p v q) ~p ~q ~p ^ ~q
T T T F F F F T F T F F T F
F T T F T F F F F F T T T T
So it is clear that ~ (p v q) = ~p ^ ~q is Equal.
Application
Negation for each of the following:
a. The fan is slow or it is very hot
b. Ali is fit or Awais is injured.
Solution:
a. The fan is not slow “AND” it is not very hot
b. Ali is not fit “AND” Awais is not injured
Inequalities and DE MORGANES law:
Exercise:
1. (p ^q) ^ r = P^(q ^ r)
p q r (p ^q) (p ^q)^r (q ^r) P^(q ^r) T T T T T T T
T T F T F F F T F T F F F F
T F F F F F F F T T F F T F
F T F F F F F
F F T F F F F F F F F F F F
So it clears that Colum 5 and Colum 7 are equal
2. (P ^q) v r = p ^ (q v r)?????
P q r (p ^q) (p ^q) v r (q v r) P ^(q v r) T T T T T T T
T T F T T T T
T F T F T T T T F F F F F F
F T T F T T F F T F F F T F
F F T F T T F F F F F F F F
So it clear that Colum 5 and Colum 7 are not equal.