Vous êtes sur la page 1sur 41

BIT 1113

Discrete Mathematics


Dr. Mohd.Najib B. Mohd.Salleh
Department of Information System
Faculty of Information Technology & Multimedia
Course Material
Textbook:

(1)Johnsonbaugh R,(2005).
Discrete Mathematics. Fifth Edition.
Singapore: Prentice Hall, Inc.

Other Reference:

Kolman, B., Busby, R., Ross, S. (1996).
Discrete Mathematical Structures.
New Jersey: Prentice Hall, Inc.

D.S Malik and M.K.Sen. (2004).
Discrete Mathematical Structures : Theory & Application
United State: Thomson Course Technology.

James L. H. (2002).
Discrete Structures, Logic, and Computability.
Second Edition. John and Bartlett Pub. Co.

Course Assessment
Test 2x 40%

Assignment ?x 10%

quizzes 5x 10%

Final Exam 40%
Is a language of science
Mathematics
Words of wisdom
Mathematics
Other disciplines
Most of the fundamental ideas of science are essentially
simple, and may, as a rule, be expressed in a language
comprehensible to everyone Albert Einstein

For the things of this world cannot be made known
without a knowledge of mathematics- Roger Bacon
- Todays computer systems are more complex, and
more rapidly evolving.
Thus, need for tools and techniques that assist in
understanding the behavior of the systems.

- This will answer the questions such as cost and
performance of the systems.

- 2 ways : experimental and modeling

Mathematics for IT
What is discrete mathematics?
logic, sets, functions, relations, etc
Logic: artificial intelligence (AI), database, circuit design
Number theory: cryptography, coding theory
Counting: probability, analysis of algorithm
Graph theory: computer network, data structures
Introduction to Discrete Mathematics
Mathematics in Computer Science
Design efficient computer systems.
How did Google manage to build a fast search engine?

What is the foundation of internet security?
algorithms, data structures, database,
parallel computing, distributed systems,
cryptography, computer networks
Logic, number theory, counting, graph theory
Algebra in Programming, Database and
Data Mining
Algebra:

Set, Function, Relation, and Number Theory, Graph
Theory, etc.

Why learn Algebra?

Its a basis for Mathematics which is tool for reasoning.

Algebra in Programming, Database and
Data Mining
Why is Algebra important for Computer Science?
Useful tool for formalizing and reasoning about
computation and the objects of computation.

Algebra, especially set theory is indivisible from Logic
where Computer Science has its roots. It has been and is
likely to continue to be a source of fundamental ideas in
Computer Science from theory to practice.

Given a set of items I={I
1
,I
2
,,I
m
} and a database of
transactions D = {t
1
,t
2
,t
n
} where t
i
={I
i1
,I
i2
,,I
ik
} and I
i1
eI, an
association rule is an implication of the form X=> Y where
X,Y c I are sets of items called itemsets and X Y = C

The support (s) for an AR X=>Y is the percentage of
transactions in the database that contain X U Y.

The confidence or strength () for an AR X=>Y is the ratio of
the number of transactions that contain X U Y to the number of
transactions that contain X.
Data Mining : support and confidence
FUNDAMENTALS
OF
MATHEMATICAL LOGIC

Logic and Proofs
Logic: propositional logic, first order logic

Proof: induction, contradiction
How do computers think?
Artificial intelligence, database, circuit, algorithms
Proposition
Statements that are not propositions
include questions and commands.
A declarative sentence or any meaningful
statement that is either True or False,
but not both.
use lowercase letters, such as p, q, r, , to represent
propositions notation.

p : 2 + 2 = 3

P defined as the proposition 2+2 = 3.
The truth value of a proposition :

true, denoted by T, if it is a true statement
false, denoted by F, if it is a false statement.
Proposition
Example 1.1

Which of the following are propositions? Give the truth
value of the propositions.

a. 5 - 11 = 7.

b. Dato Prof Ismail Bakar is a vice-chancellor of UTHM.

c. How do you do?

d. Look at the weather!

Example 1.2

Which of the following are propositions?
Give the truth value of the propositions.

a. You and me.

b. 2 is even number

c. Kuala Lumpur is the capital city of
Malaysia

d. How are you?
propositional variables
New propositions can be constructed from
existing propositions by using symbolic
connectives or logical operators.
AND ::= .
OR ::= v
Let p and q be propositions.

The conjunction of p and q,

denoted p q,

is the proposition: p and q.

This proposition is defined to be true only
when both p and q are true and it is false
otherwise.
Conjunction
Let p and q be propositions.

The disjunction of p and q,

denoted p V q,

is the proposition: p or q.

The or is used in an inclusive way. This proposition
is false only when both p and q are false, otherwise
it is true.

Disjunction
Example 1.3

Assume that

p : 5 < 9

q : 9 < 7

Construct the propositions p q and p V q.
Solution.
The conjunction of the propositions p and q is the proposition
p q : 5 < 9 and 9 < 7
The disjunction of the propositions p and q is the proposition
p V q : 5 < 9 or 9 < 7
Example 1.4

Consider the following propositions

p : It is a monkey

q : It is a banana.

Construct the propositions p q and p V q.
The disjunction of the propositions p and q is the proposition
p V q : It is a monkey or it is a banana
Solution.
The conjunction of the propositions p and q is the proposition
p q : It is a monkey and it is a banana
Truth Table

A truth table displays the relationships
between the truth values of propositions
F
F
F
T
P Q
F F
T F
F T
T T
Q P
F
T
T
T
P Q
F F
T F
F T
T T
Q P
Exclusive-Or

Let p and q be two propositions.

The exclusive or of p and q, denoted p q,
is the proposition that is true when exactly one of
p and q is true and is false otherwise.

The truth table of the exclusive or is displayed below



p q p q
T T F
T F T
F T T
F F F

Example 1.5

a. Construct a truth table for (p q) r

Solution.

p q r p q (p q) r
T T T F T
T T F F F
T F T T F
T F F T T
F T T T F
F T F T T
F F T F T
F F F F F

Example 1.5


b. Construct a truth table for (p p)

Solution.

p p
T F
F F
The final operation on a proposition p that we
discuss is the negation of p.

The negation of p, denoted ~ p, is the proposition
not p.

The truth table of ~ p is displayed below
p ~ p
T F
F T
Negation (Logical Operator)
Example 1.6

Find the negation of the proposition

p : -5 < x = 0


Solution

The negation of p is the proposition

~ p : x > 0 or x = -5
Example 1.7
Consider the following propositions:

p: UTHM is located in Parit Raja.
q: 2 + 5 = 7.
r: There is no pollution in Parit Raja.

Question :

Construct the truth table of [~ (p q)] V r.

solution
p q r p q ~ (p q) [~ (p q)] V r
T T T T F T
T T F T F F
T F T F T T
T F F F T T
F T T F T T
F T F F T T
F F T F T T
F F F F T T
p q r p q ~ (p q) [~ (p q)] V r


Tautology
A compound proposition is called a
tautology if it is always true,
regardless of the truth values of the
basic propositions which comprise it.

Example 1.8
a. Construct the truth table of the proposition

(p q) V (~ p ~ q).

Determine if this proposition is a tautology.
p q ~ p ~ q ~ (p V ~ q) (p q) (p q) V (~ p ~ q)
T T F F F T T
T F F T T F T
F T T F T F T
F F T T T F T

Example 1.8
Determine if this proposition is a tautology.

b. Show that p V ~ p is a tautology.
Equivalent

Two propositions are equivalent if they have exactly
the same truth values under all circumstances.

We write p = q.

Example 1.9

a. Show that ~ (p V q) =~ p ~ q
b. Show that ~ (p q) =~ p V ~ q
c. Show that ~ (~ p) = p.
a. and b. are known as DeMorgans laws.

(Do it your self ! )
Conditional
and
Biconditional Propositions
Let p and q be propositions.
Implication
The connective is called the conditional
connective.
p is called the hypothesis and q is called the
conclusion.
The implication pq is the proposition that
is false only when p is true and q is false;
otherwise it is true.
Example 2.1

Construct the truth table of the implication p q.
p q p q
T T T
T F F
F T T
F F T
Solution: The truth table is
Solution:

~ p V q.
p q ~ p p q ~ p V q
T T F T T
T F F F F
F T T T T
F F T T T
Example 2.2

Show that p q
In terms of words the proposition p q also reads:
(d) q is a necessary condition for p.

(b) p implies q.
(c) p is a sufficient condition for q.

(a)if p then q.
(e) p only if q
Example 2.3

Use the if-then form to rewrite the statement
I become sleepy if I eat nasi lemak in the morning.
.
v

,

Solution:

If I eat nasi lemak in the morning then I become
sleepy.
In propositional functions that involve the connectives
~, , and the order of operations is that ~ is
performed first and is performed last.


Thank you
As a conclusion:

Understand the concept of fundamentals of math logic,

What is proposition and other terminology in logic,

Construct the compound propositions, and

display the truth table.

Vous aimerez peut-être aussi