Vous êtes sur la page 1sur 42

Prepared by:

Louie Lolong Lacatan, MEng, Ph.D


Computer Engineering Department
College of Engineering
Adamson University Manila

Discrete mathematics is the study of mathematical


structures that are fundamentally discrete rather than
continuous. In contrast to real numbers that have the
property of varying "smoothly", the objects studied in
discrete mathematics such as integers, graphs, and
statements in logic.
Discrete mathematics therefore excludes topics in
"continuous mathematics" such as calculus and analysis.
Discrete mathematics has been characterized as the branch
of mathematics dealing with countable sets (sets that have
the same cardinality as subsets of the natural numbers,
including rational numbers but not real numbers).

LOGIC is the language of reasoning


A PROPOSITION is a declarative sentence (that
is, a sentence that declares a fact) that is either
true or false, but not both.

PROPOSITIONAL LOGIC is the are of logic that


deals with proposition.

PROPOSITIONAL VARIABLES are variables that


represent propositions (commonly used letters
as propositional variables are p, q, r, and s).
TRUTH VALUE is the value of the proposition,
that is denoted by T if true and F if false.
COMPOUND PROPOSITIONS
are new propositions formed from existing
propositions using logical operators.

Negation Operator
Let p be a proposition. The negation of
p, denoted by p, is the statement
It is not the case that p.

The proposition p is read not p. The


truth value of the negation of p, is the
opposite of the truth value of p.

TABLE 1. The Truth Table for the Negation


of a Proposition

Conjunction Operator
Let p and q be propositions. The
conjunction of p and q, denoted by p q, is the
proposition p and q. The conjunction p q is
true when both p and q are true and is false
otherwise.

TABLE 2. The Truth Table for the Conjunction of


Two Propositions.

pq

Disjunction Operator
Let p and q be propositions. The
disjunction of p and q, denoted by p q, is the
proposition p or q. The disjunction p q is
false when both p and q are false and is true
otherwise.

TABLE 3. The Truth Table for the Disjunction of


Two Propositions.

pq

Exclusive Or Operator
Let p and q be proposition. The exclusive or
of p and q, denoted by p q, is the
proposition that is true when exactly one of p
and q is true and is false otherwise.

TABLE 2. The Truth Table for the Exclusive Or of


Two Propositions.

pq

Conditional Statement
Let p and q be propositions. The
conditional statement p q is the proposition
if p, then q. The conditional statement p q
is false when p is true and q is false, and true
otherwise. In the conditional statement p q, p
is called the hypothesis (or antecedent or
premise) and q is called the conclusion (or

consequence)

TABLE 4. The Truth Table for the Conditional


Statement
pq

pq

if p, then q
p implies q
if p, q
p only if q
p is sufficient for q
q whenever p
q if p
q is necessary for p
a sufficient condition for q is p
q when p
a necessary condition for p is q
q unless p
q follows from p

Biconditional Statement
Let p and q be propositions. The
biconditional statement p q is the
proposition p if and only if q. The
biconditional statement p q is true when p
and q have the same truth values, and is false
otherwise.

TABLE 6. The Truth Table for the Biconditional p


q

pq

TABLE 7. Precedence of Logical


Operators
Operator

Precedence

2
3

4
5

The number of rows is equivalent to 2n ,


where n corresponds to the number of
propositional variables.
Use separate columns to find the truth
value of each compound expression that
occurs in the compound proposition.
The truth values of the compound
proposition for each combination of truth
values of the propositional variables in it is
found in the final column of the table.

Computers represent information using bits.


1 represents T (true), and 0 represents F
(false)
Computer bit operations correspond to
logical connectives.
Symbols , , and represent the notation
OR, AND, and XOR operations respectively.

TABLE 8. Table for the Bit Operators OR, AND, and


XOR.

xy xy

xy

Example:
1.

Find the bitwise OR, bitwise AND, and


bitwise XOR of these bit strings

a) 01 1011 0110 and 11 0001 1101.


b) 101 1110 and 010 0001
c) 00 0111 0001 and 10 0100 1000

A compound proposition that is always true, no


matter what the truth values of the propositions
that occur in it, is called a TAUTOLOGY.
(example: p p)
A compound proposition that is always false is
called a CONTRADICTION. (example: p p)
A compound proposition that is neither a
tautology nor a contradiction is called a
CONTINGENCY.

The compound proposition p and q are


called logically equivalent if p q is a
tautology. The notation p q denotes that p
and q are logically equivalent.
Example: Show that (p q) and p q are
logically equivalent.

Identity Laws
pTp
pFp
Domination Laws
pTT
pFF

Idempotent Laws
ppp
ppp
Double Negation Law
(p) p

Commutative Laws
pqqp
pqqp
Associative Laws
p (q r) (p q) r
p (q r) (p q) r

Distributive Laws
p (q r) (p q) (p r)
p (q r) (p q) (p r)
De Morgans Laws
(p q) p q
(p q) p q

Absorption Laws
p (p q) p
p (p q) p
Negation Laws
p p T
p p F

Example:
Show that (p (p q)) and p q are
logically equivalent.

Consider the following statements:


x > 3
x = y+3

x + y = z

Consider the statement:


x is greater than 3
This can be denoted by the propositional function
P(x)
where P denotes the predicate x is greater than 3.
Once a value has been assigned to the variable x,
the statement P(x) becomes a proposition.

Example :
1. Let P(x) denote the statement x>3. What are the
truth values of P(4) and P(2)?
2. Let Q(x,y) denote the statement x = y+3. What
are the truth values of the proposition Q(1,2) and
Q(3,0)?

Quantification is the process of creating a


proposition from a propositional function.
1. Universal Quantification
2. Existential Quantification

The universal quantification of P(x) is the


statement
P(x) for all values of x in the domain.
The notation xP(x) denotes the universal
quantification of P(x). Hence is called the
universal quantifier. We read x P(x) as for
all x P(x) or for every x P(x).

The statement x P(x) is the same as the


conjunction
P(x1) P(x2) .. P(xn)
Therefore, this is true when P(x) is true for
every x and false when there is an x for which
P(x) is false.

The existential quantification of P(x) is the


proposition
There exists an element x in the domain such
that P(x).
We use the notation xP(x) for the existential
quantification of P(x). Here is called the
existential quantifier. The existential
quantification xP(x) is read as there is an x
such that P(x) and there is at least one x
such that P(x).

The statement x P(x) is the same as the


disconjunction
P(x1) P(x2) .. P(xn)
Therefore, we have formed a proposition that
is true if and only if P(x) is true for at least
one value of x in the domain. Otherwise it is
false, meaning, there is no element x in the
domain for which P(x) is true.

What is the truth value of xP(x) and xP(x),


where P(x) is the statement x2<10 and the
domain consists of the positive integers not
exceeding 4?

Example:
1.Let P(x) denote the statement x 4. What
are the truth values of the following?
a.P(0)

b. P(4)

c. P(6)

Vous aimerez peut-être aussi