Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views64 pages

DiscreteMath Lec1 With SW2

The Discrete Mathematics course covers topics such as logic, sets, proofs, algorithms, and graph theory, and is structured as a 3-unit subject with 3 hours of weekly instruction. Prerequisites include Calculus 1, and the course includes various assessment methods including attendance, quizzes, and exams. Key objectives include understanding mathematical arguments, developing proof methods, and applying logic in computer science and related fields.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views64 pages

DiscreteMath Lec1 With SW2

The Discrete Mathematics course covers topics such as logic, sets, proofs, algorithms, and graph theory, and is structured as a 3-unit subject with 3 hours of weekly instruction. Prerequisites include Calculus 1, and the course includes various assessment methods including attendance, quizzes, and exams. Key objectives include understanding mathematical arguments, developing proof methods, and applying logic in computer science and related fields.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Discrete Mathematics

Discrete Mathematics
• This course deals with logic, sets, proofs,
growth of functions, theory of numbers,
counting techniques, trees and graph
theory
Discrete Mathematics
• 3 unit subject
• 3 hours/week
– 1.5 hours Tuesday
– 1.5 hours Wednesday

Prerequisite: Calculus1
Discrete Mathematics
Course Content:
1. Logic, Sets, Proofs, and 3. Counting Techniques
Functions
4. Relations
2. Algorithms, Integers and
5. Graph Theory
Matrices
6. Trees
2.1 Growth of Functions
7. Introduction to Modeling
2.2 Complexity of Algorithms
Computation
2.3 Number Theory
2.4 Matrices
Discrete Mathematics
Course Outline:
1. Logic, Sets, Proofs, and Functions
2. Algorithms, Integers and Matrices
2.1 Growth of Functions
2.2 Complexity of Algorithms
2.3 Number Theory
2.4 Matrices
Discrete Mathematics
Course Outline:
3. Counting Techniques
4. Relations
5. Graph Theory
6. Trees
7. Introduction to Modeling
Computation
Discrete Math
Grade breakdown
– Attendance, Seatworks, Notebook,
Assignments-30%
– Quizzes-30%
– Exam-40%
Every student output will be evaluated based
from the following criteria:
1. completeness/correctness
2. timeliness
3. uniqueness/originality/authenticity
The Foundations:
Logic and Proofs
Logic and Proofs
• The rules of logic specify the meaning of
mathematical statements. For instance,
these rules help us understand and reason
with statements such as
• “There exists an integer that is not the sum
of two squares”
• “For every positive integer n, the sum of
the positive integers not exceeding n is
n(n + 1)/2.”
Logic and Proofs
• Logic is the basis of all mathematical
reasoning, and of all automated reasoning.
• It has practical applications to the design
of computing machines, to the
specification of systems, to artificial
intelligence, to computer programming, to
programming languages, and to other
areas of computer science, as well as to
many other fields of study.
Logic and Proofs
• To understand mathematics, we must
understand what makes up a correct
mathematical argument, that is, a proof.
Once we prove a mathematical statement
is true, we call it a theorem.
Logic and Proofs
Objectives:
• explain what makes up a correct mathematical argument
and introduce tools to construct these arguments
• develop an arsenal of different proof methods that will
enable us to prove many different types of results
• introduce many different methods of proof and several
strategies for constructing proofs.
• introduce the notion of a conjecture
• explain the process of developing mathematics by
studying conjectures
Propositional Logic
• The rules of logic give precise meaning to
mathematical statements. These rules are
used to distinguish between valid and
invalid mathematical arguments.
Propositional Logic
• the importance of logic in understanding
mathematical reasoning, logic has
numerous applications to computer
science.
• These rules are used in the
– design of computer circuits
– construction of computer programs,
– verification of the correctness of programs
Propositions
• A proposition is a declarative sentence
(that is, a sentence that declares a fact)
that is either true or false, but not both
Propositions
Example1:
All the following declarative sentences are
propositions.
1. Washington, D.C., is the capital of the
United States of America. T
2. Toronto is the capital of Canada. F
3. 1 + 1 = 2. T
4. 2 + 2 = 3. F
Propositions
Example2:
Consider the following sentences.
1. What time is it?
2. Read this carefully.
3. x + 1 = 2
4. x + y = z
Propositions
We use letters to denote propositional
variables (or statement variables), that is,
variables that represent propositions, just as
letters are used to denote numerical
variables.
Propositions
The conventional letters used for
propositional variables are p, q, r, s, . . . .
The truth value of a proposition is true,
denoted by T, if it is a true proposition, and
the truth value of a proposition is false,
denoted by F, if it is a false proposition.
Propositions
The area of logic that deals with propositions
is called the propositional calculus or
propositional logic.
It was first developed systematically by the
Greek philosopher Aristotle more than 2300
years ago.
Propositions
• methods for producing new propositions
were discussed by the English
mathematician George Boole in 1854 in
his book The Laws of Thought.
• Many mathematical statements are
constructed by combining one or more
propositions.
• New propositions, called compound
propositions, are formed from existing
propositions using logical operators
Negation
Let p be a proposition. The negation of p,
denoted by ¬p (also 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, ¬p, is the
opposite of the truth value of p
Negation
Example: Find the negation of the proposition
1. Michael’s PC runs Linux.
Michael’s PC does not run Linux.
2. Vandana’s smartphone has at least 32GB of
memory.
Vandana’s smartphone does not have at least
32GB of memory.
or
Vandana’s smartphone has less than 32GB of
memory.
Negation
• Truth table

p p
0 1
1 0
Conjunction
• 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.
Conjunction
Example:
• Find the conjunction of the propositions p
and q
• p= Rebecca’s PC has more than 16 GB
free hard disk space
• Q=The processor in Rebecca’s PC runs
faster than 1 GHz.
Conjunction
Truth table
p q pq
0 0 0
0 1 0
1 0 0
1 1 1
Disjunction
• 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
Disjunction
Truth table
p q pq
0 0 0
0 1 1
1 0 1
1 1 1
XOR
• 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
Xor
Truth table
p q pq
0 0 0
0 1 1
1 0 1
1 1 0
Implication
• 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)
Implication
Truth table
p q pq
0 0 1
0 1 1
1 0 0
1 1 1
Implication
• The statement p → q is called a
conditional statement because p → q
asserts that q is true on the condition that
p holds.
• A conditional statement is also called an
implication.
Implication
• Using the truth table for the conditional
statement p → q, we take note that the
statement p → q is true when both p and q
are true and when p is false (no matter
what truth value q has).
Implication
• Because conditional statements play such
an essential role in mathematical
reasoning, a variety of terminology is used
to express p → q.
• You will encounter most if not all of the
following ways to express this conditional
statement:
– “if p, then q”
– “p implies q”
Implication
– “if p, q”
– “p only if q”
– “p is sufficient for q”
– “a sufficient condition for q is p”
– “q if p”
– “q whenever p”
– “q when p”
– “q is necessary for p”
– “a necessary condition for p is q”
– “q follows from p”
– “q unless ¬p”
Implication
Example
• Let p be the statement “Maria learns
discrete mathematics” and q the statement
“Maria will find a good job.”
• Express the statement p → q as a
statement in English
CONVERSE, CONTRAPOSITIVE, AND
INVERSE
There are three related conditional
statements that occur so often that they
have special names.
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.
CONVERSE, CONTRAPOSITIVE,
AND INVERSE
• Example:
• What are the contrapositive, the converse,
and the inverse of the conditional
statement
“The home team wins whenever it is
raining.”
Bi-implications
• 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. Biconditional statements
are also called bi-implications
Bi-implication
Truth table Note that the statement p ↔ q
is true when both the
conditional statements p → q
p q pq and q → p are true and is false
0 0 1 otherwise. That is why we use
0 1 0 the words “if and only if” to
1 0 0 express this logical connective
1 1 1 and why it is symbolically
written by combining the
symbols → and ←.
Bi-implication
• There are some other common ways to
express p ↔ q:
– “p is necessary and sufficient for q”
– “if p then q, and conversely”
– “p iff q.”
The last way of expressing the biconditional
statement p ↔ q uses the abbreviation “iff” for
“if and only if.”
Note that p ↔ q has exactly the same truth
value as (p → q) ∧ (q → p)
Bi-implication
Example
• Let p be the statement “You can take the
flight,” and let q be the statement “You buy
a ticket.” Then p ↔ q is the statement
Truth Tables of Compound
Propositions
Example:
• Construct the truth table of the compound
proposition (p ∨ ¬q) → (p ∧ q)
Truth Tables of Compound
Propositions
(p ∨ ¬q) → (p ∧ q)

p q ¬q p ∨ ¬q p∧q (p ∨ ¬q) → (p ∧ q)

0 0 1 1 0 0
0 1 0 0 0 1
1 0 1 1 0 0
1 1 0 1 1 1
Construct the truth table: ((p → q) ∨ ¬ r) → s
Precedence of Logical
Operators

Operator Precedence
 1
 2
 3
 4
 5
Logic and bit operations
• A bit string is a sequence of zero or more
bits. The length of this string is the number
of bits in the string.
Example:
• 101010011 is a bit string of length nine
Logic and bit operations
Example:
• Find the bitwise OR, bitwise AND, and
bitwise XOR of the bit strings 01 1011
0110 and 11 0001 1101. (bit strings can
be split into blocks of four bits to make
them easier to read.)
Logic and bit operations
Solution:
01 1011 0110
11 0001 1101
11 10 11 1111 bitwise OR
01 0001 0100 bitwise AND
10 1010 1011 bitwise XOR
Applications of Propositional Logic
Logic Circuits
• Propositional logic can be applied to the
design of computer hardware. This was
first observed in 1938 by Claude Shannon
in his MIT master’s thesis.
Logic Circuits
• A logic circuit (or digital circuit) receives
input signals p1, p2,...,pn, each a bit
[either 0 (off) or 1 (on)], and produces
output signals s1, s2,...,sn, each a bit.
• Today we design some useful circuits.
restrict our attention to logic circuits with a
single output signal; in general, digital
circuits may have multiple outputs
Logic Circuits
Basic Logic Gates
Logic Circuits
• A combinatorial circuit
Logic Circuits
• Determine the output for the combinatorial
circuit
Logic Circuits
Example:
• Build a digital circuit that produces the
output (p ∨ ¬r) ∧ (¬p ∨ (q ∨ ¬r)) when
given input bits p, q, and r
Logic Circuits
(p ∨ ¬r) ∧ (¬p ∨ (q ∨ ¬r))
• Reference:
– Discrete Mathematics and it’s applications
By Kenneth H. Rosen
Take home Seatwork#2
1. Construct a truth table for each of these
compound propositions.
a. p ⊕ (¬p ∨ q)
b. (¬p ∧ q) ↔ (p ∨ ¬q)
c. (q → p) ↔ (¬p → q)
d. (p ⊕ ¬q) → (¬p ∧ q)
e. (¬p ↔ q) ∨ (¬q → r)
Take home Seatwork#2
2. Find the bitwise OR, bitwise AND, and
bitwise XOR of each of these pairs of bit
strings.
a. 101 1010, 110 0111
b. 1111 0110, 1110 1010
c. 10 0101 0101, 10 0100 1000
d. 11 1101 1100, 00 0110 0000
e. 101 1010 0101, 110 1111 1110
Take home Seatwork#2
3. Evaluate each of these expressions.
a. 1 1011 ∧ (1 1011 ∨ 1 1010)
b. (0 1111 ∧ 1 0111) ∨ 0 1011
c. (0 1011 ⊕ 1 1010) ⊕ (0 1100 ∧ 1 0111)
d. (1 1110 ∨ 0 1010) ∧ (1 1001 ∨ 1 1000)
Take home Seatwork#2
4. Find the output of these combinatorial
circuits
Take home Seatwork#2
5. Construct a combinatorial circuit using
inverters, OR gates, and AND gates that
produces the output
((p ∧ ¬r) ∨q) ∧ (¬p ∧ (q ∨ r))
from input bits p, q, and r.

You might also like