SlideShare a Scribd company logo
Introduction
to
Discrete
Mathematics
Lecture 1: Sep 7
A B
C
a = qb+r gcd(a,b) = gcd(b,r)
Basic Information
▪ Instructor: Dr Asif Taj
▪ Office hour: (SHB 911)
▪ Lectures: M7-8 (TYW LT), W6 (LSB)
▪ Tutorials: H5 (ERB 404) or H6 (EGB 404)
Course Material
▪ Textbook: Discrete Mathematics with Applications
Author: Susanna S. Epp
Publisher: Brooks/Cole
▪ Reference: Course notes from “mathematics for computer science”
http://courses.csail.mit.edu/6.042/spring07/
Course Requirements
▪ Homework, 20%
▪ Midterm, 25%
▪ Course project, 10%
▪ Final Exam, 45%
Midterm: Oct 28 (Wednesday), 7-9pm
Course Project
4 students in a group
Pick an interesting mathematical topic,
write a report of about 10 pages.
Can use any references, but cite them.
Choose 1-3 groups to present, up to 5% bonus
Tell an interesting story related to mathematics.
More about good topic and nice presentation, than mathematical difficulty.
A Project
▪ Interesting or curious problems, interesting history
▪ Surprising or elegant solutions
▪ Nice presentation, easy to understand
Checker
x=0
Start with any configuration with all men on or below the x-axis.
Checker
x=0
Move: jump through your adjacent neighbour,
but then your neighbour will disappear.
Checker
x=0
Move: jump through your adjacent neighbour,
but then your neighbour will disappear.
Checker
x=0
Goal: Find an initial configuration with least number of men to jump up to level k.
K=1
x=0
2 men.
K=2
x=0
K=2
x=0
4 men.
Now we have reduced to the k=1 configuration, but one level higher.
K=3
x=0
This is the configuration for k=2, so jump two level higher.
K=3
x=0
8 men.
K=4
x=0
K=4
x=0
K=4
x=0
K=4
x=0
K=4
x=0
Now we have reduced to the k=3 configuration, but one level higher
20 men!
K=5
a. 39 or below
b. 40-50 men
c. 51-70 men
d. 71- 100 men
e. 101 – 1000 men
f. 1001 or above
Example 1
How to play Rubik Cube?
Google: Rubik cube in 26 steps
Example 2
The mathematics of paper folding
http://www.ushistory.org/betsy/flagstar.html
Example 3
3D-images
▪ Magic tricks
▪ More games, more paper folding, etc
▪ Logic paradoxes
▪ Prime numbers
▪ Game theory
Project Ideas
Deadline: November 16.
Why Mathematics?
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…
Topic 1: Logic and Proofs
Logic: propositional logic, first order logic
Proof: induction, contradiction
How do computers think?
Artificial intelligence, database, circuit, algorithms
Topic 2: Number Theory
• Number sequence
• (Extended) Euclidean algorithm
• Prime number, modular arithmetic, Chinese remainder theorem
• Cryptography, RSA protocol
Cryptography, coding theory, data structures
Topic 3: Counting
• Sets and Functions
• Combinations, Permutations, Binomial theorem
• Counting by mapping, pigeonhole principle
• Recursions
Probability, algorithms, data structures
A B
C
Topic 3: Counting
How many steps are needed to sort n numbers?
Algorithm 1 (Bubble Sort):
Every iteration moves the i-th smallest number to the i-th position
Algorithm 2 (Merge Sort):
Which algorithm runs faster?
Topic 4: Graph Theory
• Graphs, Relations
• Degree sequence, Eulerian graphs, isomorphism
• Trees
• Matching
• Coloring
Computer networks, circuit design, data structures
Topic 4: Graph Theory
How to color a map?
How to send data efficiently?
Objectives of This Course
CSC 2100, ERG 2040, CSC 3130, CSC 3160
•To learn basic mathematical concepts, e.g. sets, functions, graphs
•To be familiar with formal mathematical reasoning, e.g. logic, proofs
•To improve problem solving skills
•To see the connections between discrete mathematics and computer science
Practice, Practice and Practice.
2 2 2
a b c
+ =
Familiar?
Obvious?
c
b
a
Pythagorean theorem
c
b
a
(i) a cc square, and then
(ii) an aa & a bb square
Good Proof
b-a
We will show that these five pieces can be rearranged into:
b-a
And then we can conclude that
c
c
c
a b
c
Good Proof
The five pieces can be rearranged into:
(i) a cc square
c
b
a b-a
b-a
Good Proof
How to rearrange them into an axa square and a bxb square?
b
a
a
a
b-a
b
Good Proof
Bad Proof
A similar rearrangement technique shows that 65=64…
What’s wrong with the proof?
Mathematical Proof
To prove mathematical theorems, we need a more rigorous system.
http://en.wikipedia.org/wiki/Pythagorean_theorem
Euclid’s proof of Pythagorean’s theorem
The standard procedure for proving mathematical theorems is invented by
Euclid in 300BC. First he started with five axioms (the truth of these
statements are taken for granted). Then he uses logic to deduce the truth
of other statements.
1.It is possible to draw a straight line from any point to any other point.
2.It is possible to produce a finite straight line continuously in a straight line.
3.It is possible to describe a circle with any center and any radius.
4.It is true that all right angles are equal to one another.
5.("Parallel postulate") It is true that, if a straight line falling on two straight lines make the interior angles on the same side less than two right angles,
the two straight lines, if produced indefinitely, intersect on that side on which are the angles less than the two right angles.
See page 18 of the notes for the ZFC axioms that we now use.
Statement (Proposition)
A Statement is a sentence that is either True or False
Examples:
Non-examples: x+y>0
x2+y2=z2
True
False
2 + 2 = 4
3 x 3 = 8
787009911 is a prime
They are true for some values of x and y
but are false for some other values of x and y.
Logic Operators
F
F
F
T
P Q
F
F
T
F
F
T
T
T
Q
P
AND
::=

F
T
T
T
P Q
F
F
T
F
F
T
T
T
Q
P
OR
::=

NOT
::=
 ~p is true if p is false
Compound Statement
p = “it is hot” q = “it is sunny”
It is hot and sunny
It is not hot but sunny
It is neither hot nor sunny
Exclusive-Or
coffee “or” tea exclusive-or
How to construct a compound statement for exclusive-or?
p q p q
T T F
T F T
F T T
F F F
Idea 1: Look at the true rows
Idea 2: Look at the false rows
Idea 3: Guess and check
Idea 1: Look at the true rows
Idea 1: Look at the true rows
Logical Equivalence
p q
T T F T F F
T F T T T T
F T T T T T
F F F F T F
Logical equivalence: Two statements have the same truth table
Writing Logical Formula for a Truth Table
p q r output
T T T F
T T F T
T F T T
T F F F
F T T T
F T F T
F F T T
F F F F
Given a truth table, how to write a logical formula with the same function?
First write down a small formula for each row, so that the formula
is true if the inputs are exactly the same as the row.
Then use idea 1 or idea 2. Idea 1: Look at the true rows
and take the “or”.
The formula is true iff the
input is one of the true rows.
Writing Logical Formula for a Truth Table
Digital logic:
Idea 2: Look at the false rows,
negate and take the “and”.
The formula is true iff the input
is not one of the false row.
p q r output
T T T F
T T F T
T F T T
T F F F
F T T T
F T F T
F F T T
F F F F
can be simplified further
DeMorgan’s Laws
Logical equivalence: Two statements have the same truth table
T T F F
T F T T
F T T T
F F T T
De Morgan’s Law
De Morgan’s Law
DeMorgan’s Laws
Logical equivalence: Two statements have the same truth table
De Morgan’s Law
De Morgan’s Law
Statement: Tom is in the football team and the basketball team.
Negation: Tom is not in the football team or not in the basketball team.
Statement: The number 783477841 is divisible by 7 or 11.
Negation: The number 783477841 is not divisible by 7 and not divisible by 11.
Simplifying Statement
See textbook for more identities.
DeMorgan
Distributive
Tautology, Contradiction
A tautology is a statement that is always true.
A contradiction is a statement that is always false. (negation of a tautology)
In general it is “difficult” to tell whether a statement is a contradiction.
It is one of the most important problems in CS – the satisfiability problem.
Class Photos! Identify your face and send us your name and nicknames
Two Important Things
Tutorial hours

More Related Content

PPTX
Discrete Mathematics With Calculus and Derivation
PPTX
Intro.pptx boolean algebra and logic gates
PPTX
Introtodiscteremath123456789qwertyu.pptx
PPTX
Proving techniques for discrete mathematics
PPT
Discrete mathematics by sadat sumon
PPT
Discrete Math Lecture 01: Propositional Logic
PDF
Lecture notes in_discrete_mathematics
PDF
Notes discrete math
Discrete Mathematics With Calculus and Derivation
Intro.pptx boolean algebra and logic gates
Introtodiscteremath123456789qwertyu.pptx
Proving techniques for discrete mathematics
Discrete mathematics by sadat sumon
Discrete Math Lecture 01: Propositional Logic
Lecture notes in_discrete_mathematics
Notes discrete math

Similar to Introduction to Discrete Mathematics and computer science Theory (20)

PPTX
Logic
PPT
Mathematical Logic Part 2
PPTX
LEC 1oral pathology by lecture 23jn yh.pptx
PPT
1019Lec1.ppt
PPT
LogicLogicLogicLogicLogicLogicLogicLogicLogic
PPT
Introduction to Logic Powerpoint presentation.ppt
PPTX
Analysis.pptx
PPTX
Knowledge representation and Predicate logic
PDF
Logic and mathematics history and overview for students
PDF
2003 book discrete_mathematics
DOC
artficial intelligence
PDF
20130928 automated theorem_proving_harrison
PPT
Pnp
DOCX
The University of Maine at Augusta Name ______.docx
PPTX
MATHEMATICS Square-root-and-Cube-root.pptx
DOCX
Module code 124ms Tajvinder Virdee Sets and Log.docx
PDF
Chapter-3-Sample-Space-of-Experiment.pdf
PPTX
Math-802_Group-1_LOGIC final.ppt logicx
PDF
Math and logic overview for students
PPTX
counting techniques
Logic
Mathematical Logic Part 2
LEC 1oral pathology by lecture 23jn yh.pptx
1019Lec1.ppt
LogicLogicLogicLogicLogicLogicLogicLogicLogic
Introduction to Logic Powerpoint presentation.ppt
Analysis.pptx
Knowledge representation and Predicate logic
Logic and mathematics history and overview for students
2003 book discrete_mathematics
artficial intelligence
20130928 automated theorem_proving_harrison
Pnp
The University of Maine at Augusta Name ______.docx
MATHEMATICS Square-root-and-Cube-root.pptx
Module code 124ms Tajvinder Virdee Sets and Log.docx
Chapter-3-Sample-Space-of-Experiment.pdf
Math-802_Group-1_LOGIC final.ppt logicx
Math and logic overview for students
counting techniques
Ad

Recently uploaded (20)

PDF
RMMM.pdf make it easy to upload and study
PDF
Computing-Curriculum for Schools in Ghana
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Complications of Minimal Access Surgery at WLH
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
master seminar digital applications in india
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Lesson notes of climatology university.
RMMM.pdf make it easy to upload and study
Computing-Curriculum for Schools in Ghana
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
Sports Quiz easy sports quiz sports quiz
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Complications of Minimal Access Surgery at WLH
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPH.pptx obstetrics and gynecology in nursing
STATICS OF THE RIGID BODIES Hibbelers.pdf
master seminar digital applications in india
O7-L3 Supply Chain Operations - ICLT Program
VCE English Exam - Section C Student Revision Booklet
human mycosis Human fungal infections are called human mycosis..pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
TR - Agricultural Crops Production NC III.pdf
GDM (1) (1).pptx small presentation for students
Lesson notes of climatology university.
Ad

Introduction to Discrete Mathematics and computer science Theory

  • 1. Introduction to Discrete Mathematics Lecture 1: Sep 7 A B C a = qb+r gcd(a,b) = gcd(b,r)
  • 2. Basic Information ▪ Instructor: Dr Asif Taj ▪ Office hour: (SHB 911) ▪ Lectures: M7-8 (TYW LT), W6 (LSB) ▪ Tutorials: H5 (ERB 404) or H6 (EGB 404)
  • 3. Course Material ▪ Textbook: Discrete Mathematics with Applications Author: Susanna S. Epp Publisher: Brooks/Cole ▪ Reference: Course notes from “mathematics for computer science” http://courses.csail.mit.edu/6.042/spring07/
  • 4. Course Requirements ▪ Homework, 20% ▪ Midterm, 25% ▪ Course project, 10% ▪ Final Exam, 45% Midterm: Oct 28 (Wednesday), 7-9pm
  • 5. Course Project 4 students in a group Pick an interesting mathematical topic, write a report of about 10 pages. Can use any references, but cite them. Choose 1-3 groups to present, up to 5% bonus
  • 6. Tell an interesting story related to mathematics. More about good topic and nice presentation, than mathematical difficulty. A Project ▪ Interesting or curious problems, interesting history ▪ Surprising or elegant solutions ▪ Nice presentation, easy to understand
  • 7. Checker x=0 Start with any configuration with all men on or below the x-axis.
  • 8. Checker x=0 Move: jump through your adjacent neighbour, but then your neighbour will disappear.
  • 9. Checker x=0 Move: jump through your adjacent neighbour, but then your neighbour will disappear.
  • 10. Checker x=0 Goal: Find an initial configuration with least number of men to jump up to level k.
  • 13. K=2 x=0 4 men. Now we have reduced to the k=1 configuration, but one level higher.
  • 14. K=3 x=0 This is the configuration for k=2, so jump two level higher.
  • 20. K=4 x=0 Now we have reduced to the k=3 configuration, but one level higher 20 men!
  • 21. K=5 a. 39 or below b. 40-50 men c. 51-70 men d. 71- 100 men e. 101 – 1000 men f. 1001 or above
  • 22. Example 1 How to play Rubik Cube? Google: Rubik cube in 26 steps
  • 23. Example 2 The mathematics of paper folding http://www.ushistory.org/betsy/flagstar.html
  • 25. ▪ Magic tricks ▪ More games, more paper folding, etc ▪ Logic paradoxes ▪ Prime numbers ▪ Game theory Project Ideas Deadline: November 16.
  • 26. Why Mathematics? 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…
  • 27. Topic 1: Logic and Proofs Logic: propositional logic, first order logic Proof: induction, contradiction How do computers think? Artificial intelligence, database, circuit, algorithms
  • 28. Topic 2: Number Theory • Number sequence • (Extended) Euclidean algorithm • Prime number, modular arithmetic, Chinese remainder theorem • Cryptography, RSA protocol Cryptography, coding theory, data structures
  • 29. Topic 3: Counting • Sets and Functions • Combinations, Permutations, Binomial theorem • Counting by mapping, pigeonhole principle • Recursions Probability, algorithms, data structures A B C
  • 30. Topic 3: Counting How many steps are needed to sort n numbers? Algorithm 1 (Bubble Sort): Every iteration moves the i-th smallest number to the i-th position Algorithm 2 (Merge Sort): Which algorithm runs faster?
  • 31. Topic 4: Graph Theory • Graphs, Relations • Degree sequence, Eulerian graphs, isomorphism • Trees • Matching • Coloring Computer networks, circuit design, data structures
  • 32. Topic 4: Graph Theory How to color a map? How to send data efficiently?
  • 33. Objectives of This Course CSC 2100, ERG 2040, CSC 3130, CSC 3160 •To learn basic mathematical concepts, e.g. sets, functions, graphs •To be familiar with formal mathematical reasoning, e.g. logic, proofs •To improve problem solving skills •To see the connections between discrete mathematics and computer science Practice, Practice and Practice.
  • 34. 2 2 2 a b c + = Familiar? Obvious? c b a Pythagorean theorem
  • 35. c b a (i) a cc square, and then (ii) an aa & a bb square Good Proof b-a We will show that these five pieces can be rearranged into: b-a And then we can conclude that
  • 36. c c c a b c Good Proof The five pieces can be rearranged into: (i) a cc square
  • 37. c b a b-a b-a Good Proof How to rearrange them into an axa square and a bxb square?
  • 39. Bad Proof A similar rearrangement technique shows that 65=64… What’s wrong with the proof?
  • 40. Mathematical Proof To prove mathematical theorems, we need a more rigorous system. http://en.wikipedia.org/wiki/Pythagorean_theorem Euclid’s proof of Pythagorean’s theorem The standard procedure for proving mathematical theorems is invented by Euclid in 300BC. First he started with five axioms (the truth of these statements are taken for granted). Then he uses logic to deduce the truth of other statements. 1.It is possible to draw a straight line from any point to any other point. 2.It is possible to produce a finite straight line continuously in a straight line. 3.It is possible to describe a circle with any center and any radius. 4.It is true that all right angles are equal to one another. 5.("Parallel postulate") It is true that, if a straight line falling on two straight lines make the interior angles on the same side less than two right angles, the two straight lines, if produced indefinitely, intersect on that side on which are the angles less than the two right angles. See page 18 of the notes for the ZFC axioms that we now use.
  • 41. Statement (Proposition) A Statement is a sentence that is either True or False Examples: Non-examples: x+y>0 x2+y2=z2 True False 2 + 2 = 4 3 x 3 = 8 787009911 is a prime They are true for some values of x and y but are false for some other values of x and y.
  • 42. Logic Operators F F F T P Q F F T F F T T T Q P AND ::=  F T T T P Q F F T F F T T T Q P OR ::=  NOT ::=  ~p is true if p is false
  • 43. Compound Statement p = “it is hot” q = “it is sunny” It is hot and sunny It is not hot but sunny It is neither hot nor sunny
  • 44. Exclusive-Or coffee “or” tea exclusive-or How to construct a compound statement for exclusive-or? p q p q T T F T F T F T T F F F Idea 1: Look at the true rows Idea 2: Look at the false rows Idea 3: Guess and check Idea 1: Look at the true rows Idea 1: Look at the true rows
  • 45. Logical Equivalence p q T T F T F F T F T T T T F T T T T T F F F F T F Logical equivalence: Two statements have the same truth table
  • 46. Writing Logical Formula for a Truth Table p q r output T T T F T T F T T F T T T F F F F T T T F T F T F F T T F F F F Given a truth table, how to write a logical formula with the same function? First write down a small formula for each row, so that the formula is true if the inputs are exactly the same as the row. Then use idea 1 or idea 2. Idea 1: Look at the true rows and take the “or”. The formula is true iff the input is one of the true rows.
  • 47. Writing Logical Formula for a Truth Table Digital logic: Idea 2: Look at the false rows, negate and take the “and”. The formula is true iff the input is not one of the false row. p q r output T T T F T T F T T F T T T F F F F T T T F T F T F F T T F F F F can be simplified further
  • 48. DeMorgan’s Laws Logical equivalence: Two statements have the same truth table T T F F T F T T F T T T F F T T De Morgan’s Law De Morgan’s Law
  • 49. DeMorgan’s Laws Logical equivalence: Two statements have the same truth table De Morgan’s Law De Morgan’s Law Statement: Tom is in the football team and the basketball team. Negation: Tom is not in the football team or not in the basketball team. Statement: The number 783477841 is divisible by 7 or 11. Negation: The number 783477841 is not divisible by 7 and not divisible by 11.
  • 50. Simplifying Statement See textbook for more identities. DeMorgan Distributive
  • 51. Tautology, Contradiction A tautology is a statement that is always true. A contradiction is a statement that is always false. (negation of a tautology) In general it is “difficult” to tell whether a statement is a contradiction. It is one of the most important problems in CS – the satisfiability problem.
  • 52. Class Photos! Identify your face and send us your name and nicknames Two Important Things Tutorial hours