0% found this document useful (0 votes)
36 views

Discrete Mathematics and Its Application: Lamya A. Omer

This document provides an overview of a discrete mathematics course. It outlines the course objectives which are to present discrete mathematics concepts clearly and show their relevance to computer science. The course will cover topics like mathematical reasoning, sets, number theory, induction, and sequences. Evaluation will be based on homework, activities, tests, and exams. It also defines what discrete mathematics is, provides examples of discrete and continuous data, and describes some basic concepts in logic like propositions, truth tables, and logical operators.

Uploaded by

kira sama
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Discrete Mathematics and Its Application: Lamya A. Omer

This document provides an overview of a discrete mathematics course. It outlines the course objectives which are to present discrete mathematics concepts clearly and show their relevance to computer science. The course will cover topics like mathematical reasoning, sets, number theory, induction, and sequences. Evaluation will be based on homework, activities, tests, and exams. It also defines what discrete mathematics is, provides examples of discrete and continuous data, and describes some basic concepts in logic like propositions, truth tables, and logical operators.

Uploaded by

kira sama
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Discrete mathematics and its

application
Lamya A. Omer
Lecture1
2nd Stage
[email protected] 2021-2022
Course Objectives

• To present material in a precise, readable manner, with the


concepts and techniques of discrete mathematics clearly
presented and demonstrated related with computer
sciences subjects.
• To show the relevance and practicality of discrete
mathematics to students, who are often skeptical. I wanted
to give students studying computer science all of the
mathematical foundations they need for their future
studies
Evaluation

• Homework: 10% (each assignment 2%)


• Activities : 5%
• Test Exam: 25%
• Final Exam: 60%
What is Discrete Mathematics?
you learn continuous math. It deals with
.continuous functions, differential and integral calculus
In contrast, discrete math deals with mathematical topics in a
sense that it analyzes data whose values are separated (such as
integers: integer number line has gaps) Here is a very rough
comparison between continuous math and
discrete math: consider an analog clock (one with hands that
continuously rotate, which shows time in continuous fashion) vs.
.a digital clock (which shows time in discrete fashion)
What this course cover ?
• Chapter 1- contain 4 parts coverage of mathematical
reasoning and proof is concentrated in chapter1 flowing from
logic propositional and predicate logic to rules of inference to
basic proof techniques to more advanced proof techniques
and proof strategies .
• Chapter2 – covers sets, functions
• Chapter3 – covers number theory in two sections divisibility ,
and congruence’s in the first section while in the 2nd primes .
• Chapter4 – covers the mathematical inductions and finally
• chapter 5- covers series and the arithmetic and geometric
sequences .
?What is Discrete Mathematics

You learn continuous math. It deals with continuous functions, differential and integral
.calculus
In contrast, discrete math deals with mathematical topics in a sense that it analyzes data
whose values are separated (such as integers: integer number line has gaps) Here is a very
rough comparison between continuous math and
discrete math: consider an analog clock (one with hands that continuously rotate, which
.shows time in continuous fashion) vs. a digital clock (which shows time in discrete fashion)
Discrete Data & Continuous Data

Discrete Data
• Data that can only take  certain values.
Continuous Data
Data that can take any value (within a range)
Discrete Mathematics
• Discrete Mathematics is a branch of modern
mathematics which is deals with discrete objects.
Discrete objects are those which are separated from
(not connected to / distinct ‫ واضحة المعالم‬from) each
other.
• Discrete mathematics, or finite mathematics,
involves breaking up sets of elements into separate
or discontinuous parts.
Why Care about Discrete Math?

• Digital computers are based on discrete “atoms” (bits).


• Therefore, both a computer’s
– structure (circuits) and
– operations (execution of algorithms)
• can be described by discrete math.
Computer Vision:
Logic

• Logic is a language for reasoning. It is a collection of rules


we use when doing logical reasoning. It is the study of
abstract reasoning specifically concern whether is correct
or not , focuses on the relationship among statements.
• These rules are used to distinguish between valid and
invalid mathematical arguments.
Logic

• In English we deal with sentence .


• We call this sentence in mathematic statement now
in logic we call it proposition if this statement has a
truth value.
• Our goal to change the proposition into
computerize language

14
Logic
• In logic we are interested in true or false of statements, and
how the truth/falsehood of a statement can be determined
from other statements.
• However, instead of dealing with individual specific
statements, we are going to use symbols to represent
arbitrary statements so that the results can be used in
many similar but different cases. The formalization also
promotes the clarity of thought and eliminates mistakes.
Types of logic

• There are various types of logic such as


• 1- logic of sentences (propositional logic).
• 2- logic of objects (predicate logic).
• 3- logic involving uncertainties.
• 4- logic dealing with fuzziness, temporal logic etc.
• Here we are going to be concerned with propositional
logic and predicate logic, which are fundamental to all
types of logic.
Logic
• Logic is a system based on propositions.

• A proposition is a declarative sentence that is either true or false. but not both.

• Propositional Logic is the logic of compound statements built from simpler statements using
so-called Boolean connectives.
• Some applications in computer science:
• Design of digital electronic circuits.
• Expressing conditions in programs.
• Queries to databases , search engines & knowledge base.

17
Outline of logic topic

• Statements are either:


• 1- Simple statement.
• 2- Compound statements
• 3- Conditional statements
• 4- Quantified statements.
Introduction to Propositional Logic
• Thus sentences considered in this logic are not arbitrary sentences but are
the ones that are true or false. This kind of sentences are called proposition

•A proposition is a statement that is either true or false (not both).


•We say that the truth value of a proposition is either true (T) or false (F).

•Corresponds to 1 and 0 in digital circuits


The Statement/Proposition

• “Elephants are bigger than mice.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? true
The Statement/Proposition

• “520 < 111”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? false
The Statement/Proposition

• “y > 5”

Is this a statement? yes


Is this a proposition? no

Its truth value depends on the value of y, but


this value is not specified.
We call this type of statement a propositional
function or open sentence.
The Statement/Proposition

• “Today is January 24 and 99 < 5.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? false
The Statement/Proposition Game

• “Please do not fall asleep.”

Is this a statement? no
It’s a request.

Is this a proposition? no

Only statements can be


propositions.
The Statement/Proposition
• “If elephants were red, they could hide in cherry
trees.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? probably false
The Statement/Proposition
• “x < y if and only if y > x.”
Is this a statement? yes
Is this a proposition? yes
… because its truth value
does not depend on
specific values of x and y.
What is the truth value
of the proposition? true
A Paradox

• • “I am lying”: Is he speaking the truth or lying?


• True or False??
• – Neither True nor False.
• – If the statement is true, then he says he is lying, that is if
he says the truth he is lying
• – If the statement is false, then his statement, “I am lying” is
false, which means he is telling the truth
• – Thus, although it appears that the statement is a
proposition, this is not. As this cannot be assigned a truth
value.
Propositions

• A proposition is a declarative sentence that is either true or false.


• Examples of propositions:
• Toronto is the capital of Canada.
• Trenton is the capital of New Jersey.
• The Moon is made of green cheese.
• 1+ 0 = 1
• 1+2 =1
• Examples that are not propositions.
• x+1=2
• What time is it?
• Sit down!
• x+y=z

28
Decide which of the following are propositions

• 1- “ It is raining”
• 2- “1 + 2 = 3”
• 3- “Who ís there?
• 4- “La la la la la.”
• 5- “Just do it!”
• 6- “1 + 2”
• 7- Washington D.C. is the capital of China.î
Combining Propositions
•As we have seen in the previous examples, one or more propositions can be
combined to form a single compound proposition.
•We formalize this by denoting propositions with letters such as p, q, r, s, and
introducing several logical operators.

Logical Operators (Connectives)


We will examine the following logical operators:
• Negation (NOT)
• Conjunction (AND)
• Disjunction (OR)
• Exclusive or (XOR)
• Implication (if – then)
• Biconditional (if and only if)
Truth tables can be used to show how these operators can combine
propositions to compound propositions.
Definitions
• DEFINITION 1: Let p be a proposition. The statement "It is not the case that p" is another
proposition, called the negation of p. The negation of p is denoted by ~p. The proposition
~ p is read "not p.“
• EXAMPLE Find the negation of the proposition "Today is Friday.'' express this in simple
English.
• Solution :The negation is "It is not the case that today is Friday."
• This negation can he more simply expressed by
• "Today is not Friday," or "It is not Friday today."

Negation (NOT)

P ~P
A truth table displays
the relationships
true false
between the truth
values of
false true
propositions.
Conjunction (AND)
• Binary Operator, Symbol: 
• DEFINITION 2
• Let p and q be propositions. The proposition "p and q," denoted p ˄q. is
the proposition that is true when both p and q are true and is false
otherwise. The proposition p q is called the conjunction of p and q

EXAMPLE
Find the conjunction of the propositions p
P Q PQ and q where p is the proposition "Today is
Friday" and q is the proposition "It is raining
true true true today."
true false false
Solution:
false true false The conjunction of these propositions, p  q,
is the proposition
false false false "Today is Friday and it is raining today"
Disjunction (OR)
• Binary Operator, Symbol: 

DEFINITION 3
Let p and q be propositions. The proposition "p or q," denoted p v q , is the proposition that
is false when p and q are both false and true otherwise. The proposition p \/ q is called the
disjunction ot p and q.
Compare these two sentences
"Students who have taken calculus or computer
P Q PQ science can take this class.“

true true true "Students who have taken calculus or computer


science, but not both , can enroll
true false true in this class."
false true true Similarly, when a menu at a restaurant states,
"Soup or salad comes with an entree,"
false false false the restaurant almost always means that customers can
have either
soup or salad, but not both.
Hence, this is an exclusive. rather than an inclusive, or.
Exclusive Or (XOR)
• Binary Operator, Symbol: 

DEFINITION 4
Let p and q be propositions 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.

P Q PQ
true true false
true false true
false true true
false false false
Implication (if - then)
• Binary Operator, Symbol: 
DEFINITION 5 Let p and q be propositions. The implication p  q is the
proposition that is false when p is true and q is false, and true otherwise.
p is called the hypothesis and q is called the conclusion (or consequence).
"p only if q" expresses the same thing as
"if p then q.“ To remember this, note that
P Q PQ
"p only if q" says that p cannot be true true true true
when q is not true.
That is, the statement is false if p is true, true false false
but q is false. When p is false, q may
be either true or false, because the false true true
statement says nothing about the truth
value of q. false false true
If it is sunny today, then we will go to the beach.“
“if today is Friday, then 2 + 3 = 5.“
"If today is Friday, then 2 + 3 =6.“
WAYS to express implies proposition

"if p then q" "p implies q“, or "p only if q“ "q when p" "q is necessary
for p" or "a necessary condition for p is q" "q follows from p"
Biconditional (if and only if)

• Binary Operator, Symbol: 


DEFINITION 6
Let p and q be propositions. The biconditional p  q is the proposition that is
true when p and q have the same truth values, and is false otherwise.
p  q has exactly the same truth value as (p → q) ˄ (q → p).

P Q PQ "You can take the flight if and only if


you buy a ticket."
true true true
true false false
false true false
false false true
Statements and Operators
• Statements and operators can be combined in any way to form new statements.

Write the truth table of (P) (Q) And  (PɅQ)


Are they equivalent ?
P Q PQ  (PQ)
P Q P Q (P)(Q)
true true true false
true true false false false
true false false true true true false false true
false true true false true false true false true
false false true true true
false false false true
Equivalent Statements
P Q (PQ) (P)(Q) (PQ)(P)(Q)

true true false false true


true false true true true
false true true true true
false false true true true
• The statements (PQ) and (P)(Q) are logically equivalent, because
(PQ)(P)(Q) is always true.
How can we translate an English statement to logical expression

• You can access the internet form your collage only if you are a computer science major or not a
freshman .
• first only if is implication statement
• Second Suppose c is” you are a computer science major ”
• f is “you are freshman ”
• a is “You can access the internet form your collage ” so we can write

• third a→( c ˅~f)


• Now translate the following English statement to logical expression
• You cannot ride the roller costar if you are under 4 feet tall unless you are older than 16 years old.

• Answer :
• (r˄~ s)→~ q How and explain ?
• CONVERSE, CONTRAPOSITIVE, AND INVERSE

• There are some related implications that can be formed from p → q .


• The proposition q → p is called the converse of p → q.
• The contrapositive of p → q is the proposition ~q → ~ p.
• The proposition ~ p → ~ q is called the inverse of p → q.

• The contrapositive, ~ q → ~ p. of an implication p → q has the same truth


value as p → q.
EXAMPLE
• What are the contrapositive, the converse. and the inverse of the implication
"The home team wins whenever it is raining."'?
• Solution: Because 'q whenever p" is one of the ways to express the implication p
→ q, the original statement can be written as
"If it is raining, then the home team wins.'.
Consequently. the contrapositive of this implication is
"If the home team does not win, then it IS not raining."
The converse is
"If the home team wins, then it is raining."
The inverse is "If it is not raining. then the home team does not win."
Only the contrapositive is equivalent to the original statement.
Tautologies and Contradictions
• A tautology is a statement that is always true.
• Examples:
• R(R)
• (PQ)(P)(Q)

• If ST is a tautology, we write ST.


• If ST is a tautology, we write ST.
Tautologies and Contradictions

• A contradiction is a statement that is always


• false.
• Examples:
• R(R)
• ((PQ)(P)(Q))
• The negation of any tautology is a contra-
• diction, and the negation of any contradiction is
• a tautology.
Exercises
•We already know the following tautology:
•(PQ)  (P)(Q)
•Nice home exercise:
•Show that (PQ)  (P)(Q).
•These two tautologies are known as De Morgan’s laws.
45
Important Logical Equivalences:
The following logical equivalences apply to any statements;
the p's, q's and r' s can stand for atomic statements or compound statements.

~(~p) ≡p the Double Negative Law

p ˄q≡ q ˄p the Commutative Law for conjunction

p ˅q≡ q˅ p the Commutative Law for disjunction

(p˄ q) ˄ r ≡p˄ (q˄ r) the Associative Law for conjunction

(p ˅q) ˅r ≡p ˅ (q˅ r) the Associative Law for disjunction


~(p˅ q) ≡ (~p)˄ (~q)
De Morgan's Laws
~(p ˄q) ≡ (~p)˅ (~q)

p˄ (q˅ r) ≡(p ˄q)˅ (p ˄r)


the Distributive Laws
p˅ (q˄ r) ≡(p˅ q) ˄(p˅ r)

p˄ p ≡p
Absorption Laws
Applied Discrete Mathematics
p˅ p ≡p Week 1: 46
Logic and Sets
Applied Discrete Mathematics
Week 1: Logic and Sets
47

You might also like