DS Lecture-1
DS Lecture-1
Discrete Structures
Introduction
Lecture-1
Overview of this Lecture
• Course Administration
• What is it about?
Lecture Hours:
Location:
Online (MS Teams/Class Room)
Homework (10%)
Quiz (15%)
Midterm (25%)
Final (50%)
Homework and Quiz
Discrete Mathematics
by Richard Johnsonbaugh
7th or 8th Edition
Reference Book
Discrete Mathematics
by Edgar Goodaire and Michael Parmenter
3rd Edition.
Overview of this Lecture
Course Administration
Continuous Mathematics
It considers objects that vary continuously;
Example: analog wristwatch (separate hour, minute, and second hands).
From an analog watch perspective, between 1 :25 p.m. and 1 :26 p.m.
there are infinitely many possible different times as the second hand moves
around the watch face.
Discrete Mathematics
It considers objects that vary in a discrete way.
Example: digital wristwatch.
On a digital watch, there are only finitely many possible different times
between 1 :25 P.m. and 1:27 P.m. A digital watch does not show split
seconds: no time between 1 :25:03 and 1 :25:04. The watch moves from one
time to the next.
Integers --- core of discrete mathematics
Discrete mathematics --- models and tools for analyzing real-world
phenomena that change discretely over time and therefore ideal for studying
computer science – computers are digital! (numbers as finite bit strings; data
structures, all discrete! Historical aside: earliest computers were analogue.)
Discrete vs Continuous
What is MA-210 about?
Formal: Input_wire_A
value in {0, 1}
–The router can send packets to the edge system only if it supports the new address space.
–For the router to support the new address space it’s necessary that the latest software release be installed.
–The router can send packets to the edge system if the latest software release is installed.
–The router does not support the new address space.
How to write these specifications in a formal way? Use Logic. Bart Selman
CS2800
Why Discrete Mathematics? (I)
Alice and Bob have never met but they would like to
exchange a message. Eve would like to eavesdrop.
E.g. between you and the Bank of America.
•Examples:
– Distribution problems
– Routing problems Aside: finding the right
– Maximum flow problems problem representation
– Designing computer / phone / road networks is one of the key issues
– Equipment replacement
– And of course the Internet
in this course.
Networks are
New Science of Networks pervasive
Sub-Category Graph
No Threshold
NYS Electric
Power Grid Network of computer scientists
Cyber communities
(Thorp,Strogatz,Watts) ReferralWeb System
(Automatically discovered)
(Kautz and Selman)
Kleinberg et al
Applications of Networks
Physical analog Physical analog
Applications Flow
of nodes of arcs
phone exchanges,
Cables, fiber optic Voice messages,
Communication computers,
links, microwave Data,
systems transmission
relay links Video transmissions
facilities, satellites
Pumping stations Water, Gas, Oil,
Hydraulic systems Pipelines
Reservoirs, Lakes Hydraulic fluids
Integrated Gates, registers,
Wires Electrical current
computer circuits processors
Rods, Beams,
Mechanical systems Joints Heat, Energy
Springs
Passengers,
Intersections, Highways,
Transportation freight,
Airports, Airline routes
systems vehicles,
Rail yards Railbeds
operators
Example: Coloring a Map
How can the final exams at UET be scheduled so that no student has
two exams at the same time? (Note not obvious this has anything to do
with graphs or graph coloring.)
Graph:
A vertex correspond to a course.
An edge between two vertices denotes that there is at least one common
student in the courses they represent.
Each time slot for a final exam is represented by a different color.
1 1
Time Courses
Period
2 7 2 I 1,6
7
II 2
III 3,5
IV 4,7
6 3 6 3
5 4 5 4
Approach:
Represent the cellular structure as a graph
Each node represents a cell (center)
Interference relationships represented by the graph edges
Assigning a frequency same as assigning a fixed-width band
centered around the frequency
Binary variables that indicate whether a (center) frequency is
assigned
Index Registers
13508!= 1.4759774188460148199751342753208e+49936
The optimal tour!
Social Networks
3 Sample Graphs
Directed / Un-Directed Networks
Properties of Nodes
Measuring Centrality
Measuring Centrality
Course Themes, Goals, and Course Outline
Goals of MA-210
Introduce students to a range of mathematical tools from discrete
mathematics that are key in computer science
Mathematical Sophistication
How to write statements rigorously Practice works!
How to read and write theorems, lemmas, etc.
How to write rigorous proofs
Actually, only practice works!
Areas we will cover:
Logic and proofs Note: Learning to do proofs from
Set Theory watching the slides is like trying to
Number Theory learn to play tennis from watching
Counting and combinatorics
it on TV! So, do exercises!
Tentative Topics MA-210
Logic and Methods of Proof
Propositional Logic --- SAT as an encoding language!
Predicates and Quantifiers
Methods of Proofs
Number Theory
Modular arithmetic
RSA cryptosystems
Sets
Sets and Set operations
Functions
Counting
Basics of counting
Pigeonhole principle
Permutations and Combinations
Topics MA-210
Graphs and Trees
Graph terminology
Example of graph problems and algorithms:
graph coloring
TSP
shortest path
Min. spanning tree
Scenario I
Bart Selman
CS2800
Scenario II
• Task 2
– In the second scenario,
• the limo service allows customers to bid on a ride
• so that the highest bidder gets a limo when there aren’t enough
limos available
– The program should make a schedule that
• Is feasible (no limo is assigned to two or more customers at the
same time)
• While maximizing the total profit
Bart Selman
CS2800
Scenario III
• Task 3
– Here each customer
• is allowed to specify a time window for each car and
• bid different amounts for different “car bundles”
• The limo service must choose to accept the entire set of times
or reject it
– The program must again maximize profit
Bart Selman
CS2800
Bart Selman
CS2800
What’s your job?
Bart Selman
CS2800
The goal of this course
Bart Selman
CS2800
… and analyze the information…
Bart Selman
CS2800
The Digital World
Identification numbers and codes are associated with
many aspects of our modern world.
This credit
card is a fake! Codabar
3 1
1
4
2
2 1 3 4
3
3
What google maps do?
3 1
1
4
2
2 1 3 4
3
3
What google maps do?
3 1
1
4
2
2 1 3 4
3
3
What google maps do?
3 1
1
4
2
2 1 3 4
3
3
The END