Professional Documents
Culture Documents
e co
li b
206
w l
(it
p a d
ot e
r ing
B dy)
a n
Discrete Structures II
han
Casimir A. Kulikowski
Department of Computer Science
Rutgers University | NJ, USA
– Before the end of the day spend ~20 mins going over slides
and make notes of things you did not understand
Combinatorics 1.
2.
Counting determines the complexity of algorithms
Counting determines whether there are enough resources to solve a problem.
What questions
can you ask?
Used to solve many different types of problems
Enumeration, the counting of objects with certain properties
Example:
Combinatorics 1.
2.
Counting determines the complexity of algorithms
Counting determines whether there are enough resources to solve a problem.
Complexity:
What is the runtime?
Resources:
What is the memory
usage?
Combinatorics – Enumerating Example
Combinatorics
mathematical biology,
macromolecules…..
Rosen, 385
Combinatorics
• We will study the basic rules of counting
• They can solve a tremendous variety of problems, such as:
• Enumerate the different telephone numbers possible in the United States,
• Enumerate the allowable passwords on a computer system,
• Enumerate the different orders in which the runners in a race can finish
• They can help us answer questions that seem hard: What is the chance that
among the 240 students in this class, we find 2 with the same birthday?
Sets
• What is a Set?
• A collection of objects which are called elements
• Elements are objects that share the same property
• Examples
• Someone’s followers on Twitter
• The set of webpages for a given Google query
• Collection of YouTube videos
Lehman, 69-72
Sets
• What is a Set?
• A collection of objects which are called elements
• Elements are objects that share the same property
• Examples
• Someone’s followers on Twitter
• The set of webpages for a given Google query
• Collection of YouTube videos
Sets
•
Sets – Common Sets
•
curly braces
Sets - Set Operations
•
Sets - Set Comparisons
•
Power Set
•
New Stuff
•
Venn Diagram
Functions
•
Functions - Example
Types of Functions
Exercise 3: Types of Functions
•
Exercise 3: Types of Functions)
• 𝑓: ℝ ↦ ℝ, 𝑓( 𝑥 )= 3𝑥 + 7
• 𝑓: ℝ ↦ ℝ 𝑓(𝑥) = 𝑥2
Work on it
Proofs
• A mathematical proof…
• …of a proposition is a chain of logical deductions from axioms
and previously proved statements. A prime is an integer greater than one that is not divisible by any other
integer greater than 1, e.g., 2, 3, 5, 7, 11, . . .
• Proposition
• A statement that is either true or false
• e.g., Every even integer greater than 2 is the sum of two primes
(Goldbach’s Conjecture – remains unsolved since 1742…)
• Predicates
• A proposition whose truth depends on the value of variables
• e.g., P 𝑛 ∷= "𝑛 𝑖𝑠 𝑎 𝑝𝑒𝑟𝑓𝑒𝑐𝑡 𝑠𝑞𝑢𝑎𝑟𝑒" – P 4 is true but P 5 is false
Axioms
• A standard procedure for establishing truth in mathematics was
invented by Euclid, a Greek mathematician working in Alexandria,
circa 300 BC.
• He began with 5 assumptions about geometry, which seemed
undeniable based on direct experience. (For example, “There is a
straight line segment between every pair of points.)
• Propositions like these that are simply accepted as true are
called axioms
• Starting from these axioms, Euclid established the truth of many
additional propositions by providing “proofs.”
Euclid’s Axioms of Plane Geometry
• Assumptions about geometry, which seemed undeniable based on direct
experience:
1) There is a straight line segment between every pair of points
2) A finite line can be extended indefinitely
3) A circle can be crawn, given a center and a radius
4) All right angles are equal (and measure ninety degrees)
5) For any given point not on a given line, there is exactly one line
through the point that does not meet the given line (Parallel
Postulate………it does not follow from the previous four axioms, but
this was not proven until the 19th Century!)
Axioms
• Euclid’s axiom-and-proof approach, now called the axiomatic
method, remains the foundation for mathematics today.
!,!⇒$
•
$
• If 𝑃 is true and 𝑃 implies 𝑄, then 𝑄 is true. If we can prove this …
antecedents
!⇒$,$⇒%
• consequent
!⇒%
• If 𝑃 implies 𝑄 and 𝑄 implies 𝑅, then 𝑃 implies 𝑅.
…then this is true
¬!⇒¬$
•
$⇒!
• If ¬𝑃 implies ¬𝑄, then 𝑄 implies 𝑃
Proving an Implication
• To prove: 𝑃 ⇒ 𝑄
Direct Proof
The sum of two even numbers is even.
• To prove: 𝑃 ⇒ 𝑄
Proof x = 2m, y = 2n
• Assume that 𝑃 is true.
x+y = 2m+2n
• Show that 𝑄 logically follows = 2(m+n)
Proof by Contrapositive
• To prove: 𝑃 ⇒ 𝑄
i.e., we will assume the opposite of our desired conclusion and show
that this fancy opposite conclusion could never be true in the first place.
Example of Proof by Contrapositive
• Theorem: If 𝑟 is irrational, then 𝑟 is irrational.
Rational Number
R is rational ó there are integers a and b such that
numerator
and b ≠ 0.
denominator
Remember:
1. A number is rational if it is equal to a ratio of integers
2. The sum of two rational numbers is always a rational number
3. The difference of two rational numbers is always a rational number
4. The product of two rational numbers is always a rational number
5. The quotient of two rational numbers is always a rational number
proving “if P, then Q” is equivalent to proving “if not Q, then not P”
Intuition: Square roots and absolute values are our worst enemies in proofs
Example of Proof by Case Analysis
• Theorem: For all 𝑥 ∈ ℝ, −5 ≤ 𝑥 + 2 − 𝑥 − 3 ≤ 5
Example of Proof by Case Analysis
• Theorem: For all 𝑥 ∈ ℝ, −5 ≤ 𝑥 + 2 − 𝑥 − 3 ≤ 5
Example of Proof by Case Analysis
• Theorem: For all 𝑥 ∈ ℝ, −5 ≤ 𝑥 + 2 − 𝑥 − 3 ≤ 5
Proof by Contradiction
• To prove 𝑃
• Assume 𝑃 is false.
• Logically deduce something that is known to be false.
Example of Proof by Contradiction
• Theorem: There are infinitely many primes.
Lehman, 115-129
Induction
• Let 𝑃(𝑚) be a predicate of non-negative integers