Showing Page:
1/8
LOGIC 1
What is Discrete Mathematics?: Discrete mathematics is the branch of mathematics
dealing with objects that can assume only distinct, separated values. The term "discrete
mathematics" is therefore used in contrast with "continuous mathematics," which is the
branch of mathematics dealing with objects that can vary smoothly (and which
includes, for example, calculus). Whereas discrete objects can often be characterized by
integers continuous objects require real numbers. Discrete Mathematics concerns
processes that consist of a sequence of individual steps.
LOGIC: Logic is the study of the principles and methods that distinguishes between
a valid and an invalid argument.
SIMPLE STATEMENT: A statement is a declarative sentence that is either true or false
but not both at the same time.
A statement is also referred to as a proposition
Example of Statement:
(i) 2+2 = 4,
(ii) It is Sunday today
If a proposition is true, we say that it has a truth value of "true”.
If a proposition is false, its truth value is "false".
The truth values “true” and “false” are, respectively, denoted by the letters T and F.
EXAMPLES:
1. Apple is red.
2. Peshawar is the capital of pakistan
3. 4+2=7
4. There are four fingers in a hand.
are propositions
Not Propositions
open the door.
x is less than 2.
He is poor.
are not propositions.
Rule: If the sentence is preceded by other sentences that make the pronoun or
variable reference clear, then the sentence is a statement.
Example:
x = 1
x > 2
x > 2 is a statement with truth-value
FALSE.
Example
Bill Gates is an American
He is very rich
He is very rich is a statement with truth-value
TRUE.
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
5.
-1>0
A statement
6. x + y = 12
Not a statement
COMPOUND STATEMENT:
Simple statements could be used to build a compound statement.
Showing Page:
2/8
2
EXAMPLES:
LOGICAL CONNECTIVES
1. “3 + 2 = 5” and “Lahore is a city in Pakistan”
2. “The grass is green” or “ It is hot today”
3. “Discrete Mathematics is not difficult to me”
AND, OR, NOT are called LOGICAL CONNECTIVES.
MEANINGS
SYMBOL
CALLED
Not
~
Tilde
And
Hat
Or
Vel
If then
Arrow
If and only if
Double arrow
English woed
Logical connective
Logical expression
And, but, also, in addition, moreover
Conjuction
A B
or
Disjuntion
A B
If A then B, A implies B, A therefore B,
implication
A B
A only if B, B followes from A, A is
sufficient condition for B,
B is necessary for B
A if and only if B,
Equivalence
A B
A is necessary and sufficient for B
Not A, It is false that A,
Negation
A
/
It is not true that A
SYMBOLIC REPRESENTATION:
Statements are symbolically represented by letters such as p, q, r,...
Note:
(i) The connectives, , , , are called binary connectives because they join
two expressions together to produce a third expression.
(ii) negation is a connective acting on one expression to produce a second expression is
called unary connective. The negation of A symbolized by A
/
or ~A or A is read
“ not A”.
EXAMPLES:
p = “Islamabad is the capital of Pakistan” q = “17 is divisible by 3”
p q = “Islamabad is the capital of Pakistan and 17 is divisible by 3” p
q = “Islamabad is the capital of Pakistan or 17 is divisible by 3”
~p = “It is not the case that Islamabad is the capital of Pakistan” or
simply “Islamabad is not the capital of Pakistan”
TRANSLATING FROM ENGLISH TO SYMBOLS:
Showing Page:
3/8
3
Let p = “It is hot”, and q = “It is sunny”
SENTENCE
SYMBOLIC FORM
1.
It is not hot.
~ p
2.
It is hot and sunny.
p q
3.
It is hot or sunny.
p q
4.
It is not hot but sunny.
~ p q
5.
It is neither hot nor sunny.
~ p ~ q
EXAMPLE:
Leth = “Zia is healthy” w = “Zia is wealthy”
s = “Zia is wise”
Translate the compound statements to symbolic form:
1.
Zia is healthy and wealthy but not wise.
(h
w)
(~s)
2.
Zia is not wealthy but he is healthy and wise.
~w (h s)
3.
Zia is neither healthy, wealthy nor wise.
~h ~w ~s
TRANSLATING FROM SYMBOLS TO ENGLISH:
Let m = “Ali is good in Mathematics” c = “Ali is a Computer Science student”
Translate the following statement forms into plain English:
1. ~ c Ali is not a Computer Science student
2. c m Ali is a Computer Science student or good in Maths.
3. m ~c Ali is good in Maths but not a Computer Science student
A convenient method for analyzing a compound statement is to make a truth
table for it. A truth table specifies the truth value of a compound proposition for
all possible truth values of its constituent propositions.
NEGATION (~):
If p is a statement variable, then negation of p, “not p”, is denoted as “~p”
It has opposite truth value from p i.e., 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 are statements, then the conjunction of p and q is “p
and q”, denoted as “p q”. It is true when, and only when, both p and q are true. If either
p or q is false, or if both are false, pq is false.
TRUTH TABLE FOR p q:
p
q
p q
T
T
T
T
F
F
F
T
F
F
F
F
Showing Page:
4/8
4
DISJUNCTION () or INCLUSIVE OR
If p & q are statements, then the disjunction of p and
q is “p or q”, denoted as
“p q”.It is true when at least one of p or q is true and is false only when both
p and q are false.
TRUTH TABLE FOR p q
p
q
p q
T
T
T
T
F
T
F
T
T
F
F
F
Note it that in the table F is only in that row where both p and q have F and all other
values are T. Thus for finding out the truth values for the disjunction of two statements
we will only first search out where the both statements are false and write down the F in
the corresponding row in the column of p q and in all other rows we will write T in the
column of p q.
Remark: Note that for Conjunction of two statements we find the T in both the
statements, but in disjunction we find F in both the statements. In other words we will
fill T first in the column of conjunction and F in the column of disjunction.
SUMMARY
1. What is a statement?
2. How a compound statement is formed.
3. Logical connectives (negation, conjunction, disjunction).
4. How to construct a truth table for a statement form.
Truth Tables
Constract Truth Tables for: 1. ~ p q 2. ~ p (q ~ r) 3. (pq) ~ (pq) Truth
table for the statement form ~ 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 ~ r)
p
q
r
~r
q
~r
~p
~p
(q
~ r)
T
T
T
F
T
F
F
T
T
F
T
T
F
F
T
F
T
F
F
F
F
Showing Page:
5/8
5
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 (pq) ~ (pq)
p
q
p
q
p
q
~ (q
r)
(p 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 Negative Property ~(~p) p
p
~p
~(~p)
T F T
F T F
Example:“It is not true that I am not happy”
Solution: Let p = “I am happy” then ~ p = “I am not happy” and ~(~ p) = “It is not true
that I am not happy” Since ~ (~p) p. Hence the given statement is equivalent to:
I am happy
~ (pq) and ~p ~q are not logically equivalent
p
q
~p
~q
p
q
~(pq)
~p
~q
T
T
F
F
T
F
F
T
F
F
T
F
T
F
F
T
T
F
F
T
F
F
F
T
T
F
T
T
Different truth values in row 2 and row 3
DE MORGAN’S LAWS:
1) The negation of an and statement is logically equivalent to the or statement in which
each component is negated. Symbolically ~(p q) ~p ~q.
2) The negation of an or statement is logically equivalent to the and statement in which
each component is negated. Symbolically: ~(p q) ~p ~q.
Showing Page:
6/8
6
p
q
~p
~q
p
q
~(p q)
~p
~q
T
T
F
F
T
F
F
T
F
F
T
T
F
F
F
T
T
F
T
F
F
F
F
T
T
F
T
T
Same truth values
Application: Give negations for each of the following statements:
a. The fan is slow or it is very hot.
b. Akram is unfit and Saleem is injured.
Solution
a. The fan is not slow and it is not very hot.
b. Akram is not unfit or Saleem is not injured.