You are on page 1of 21

CSE 211 Course Info

Discrete Mathematics

CSE 211 Discrete Mathematics 1


CSE 211 Course Info
 Objectives:
• To introduce with the concepts and applications of
discrete mathematical structures.
• To introduce various techniques for designing and
analyzing algorithms.
• To learn how to apply the techniques in designing and
analyzing some fundamental algorithms, such as
sorting and graph algorithms.

CSE 211 Discrete Mathematics 2


CSE 211 Course Info
 Syllabus:
• Foundations: logic, sets, functions.
• Combinatorics: counting, permutations, combinations.
• Recurrence relations.
• Graph theory: tree, graph, connectivity, graph
traversal. (Intro.)
• Design and analysis of algorithms (Intro.).
• Computability and complexity

CSE 211 Discrete Mathematics 3


CSE 211 Course Info
 Textbooks:
• R. P. Grimaldi, Discrete and Combinatorial Mathematics (an
Applied Introduction), Addison-Wesley, 2004.  

• Discrete Mathematics and its applications Kenneth H.


Rosen.
• Schaums outlines Discrete mathematics

CSE 211 Discrete Mathematics 4


Lecture 1 Introduction
 Introduction to Discrete Mathematics
• Definitions
• Applications

CSE 211 Discrete Mathematics 5


1.1. Introduction to Discrete Math.

 What is discrete mathematics?


• Part of mathematics devoted to the study of discrete
objects.
• Discrete means consisting of distinct or unconnected
elements.
• Operations:
• Combinatorics: counting discrete objects
• Logical operators, relations: specifying relationship
between discrete objects
• Dealing with: Discrete objects – sets, propositions.
 Why discrete ?

CSE 211 Discrete Mathematics 6


1.1. A formal definition - Wikipedia
 Discrete mathematics, sometimes called finite mathematics, is the study of mathematical
structures that are fundamentally discrete, in the sense of not supporting or requiring the
notion of continuity. Most, if not all, of the objects studied in finite mathematics are
countable sets, such as the integers.

 Discrete mathematics has become popular in recent decades because of its applications to
computer science. Concepts and notations from discrete mathematics are useful to study or
express objects or problems in computer algorithms and programming languages. In some
mathematics curricula, finite mathematics courses cover discrete mathematical concepts for
business, while discrete mathematics courses emphasize concepts for computer science
majors.

 For contrast, see continuum, topology, and mathematical analysis.

 Discrete mathematics usually includes :


• logic - a study of reasoning
• set theory - a study of collections of elements
• number theory
• combinatorics - a study of counting
• graph theory
• algorithmics - a study of methods of calculation
• information theory
• the theory of computability and complexity - a study on theoretical limitations on algorithms …

CSE 211 Discrete Mathematics 7


1.1. Introduction to Discrete Math.
 Applications of discrete mathematics:
• Formal Languages (computer languages)
• Machine translation
• Compiler Design
• Artificial Intelligence
• Relational Database Theory
• Network Routing
• Algorithm Design
• Computer Dame
• many more (almost all areas of computer science)…
A building block of computer science ! (Why ?)

CSE 211 Discrete Mathematics 8


1.1. Introduction to Discrete Math.

 Topics in discrete mathematics :


• Foundations: logic, sets, functions.
• Combinatory: counting, permutations,
combinations.
• Recurrence relations.
• Graph theory: tree, graph, connectivity, graph
traversal.
• Design and analysis of algorithms (Intro.)
• Computability and complexity (Intro.).

CSE 211 Discrete Mathematics 9


1.2. Application: Logic&Formal Language

 Natural language:
• If tomorrow is sunny, then I’ll go to downtown
• If tomorrow is sunny and the school is closed, or the school
is not closed but the bus is not in service, then I’ll go to
downtown or I’ll go to Richmond.
• If your account balance is lower than $1500 and there are
more than 10 transactions, or if your balance is greater than
$1500 and there are no more than 10 transactions, we will
charge a service fee of $10.
 Math:
• If x>100 and y<50 or x<30 and not y<40, the system of
equations have a solution, subject to x and y are real
numbers.

CSE 211 Discrete Mathematics 10


1.2. Application: Formal Language

 Formal language:
• Language generated by grammars
• Grammars:
• Generate the words of a language
• Determine whether a word is in a language
• Words:
• Can be combined in various ways
• Grammars tell whether a combination of words is a valid
sentence
• Applications:
• Design of Programming Languages and Compilers

CSE 211 Discrete Mathematics 11


1.2. Application: Formal Language

 Example 1:
• Natural language: English
• Is “the hungry rabbits eats quickly” in English language?
• Derivation tree of the sentence:
sentence

noun phrase verb phrase

article adjective noun verb adverb

the hungry rabbit eats quickly

CSE 211 Discrete Mathematics 12


1.2. Application: Formal Language

 Example 2:
• Typical problem in the construction of compilers.
• Determine whether the word cbab belongs to the
language generated by the grammar G = (V, T, S, P),
where:
• V =  a, b, c, A, B, C, S 
• T =  a, b, c 
• S is the starting symbol
• P are the productions:
S  AB A  Ca B  Ba
B  Cb Bb C  cb
Cb

CSE 211 Discrete Mathematics 13


1.2. Application: Formal Language
 Example 2 (continued):
• Solution:
• Begin with S and try to derive cbab using a series of
productions.
• Since only one production with S, we must start with
S  AB
• Use the only production for A to obtain:
S  AB  CaB
• Use the production of C  cb since cbab begins with the
symbol cb:
S  AB  CaB  cbaB
• Finish by using the production of B  b:
S  AB  CaB  cbaB  cbab

CSE 211 Discrete Mathematics 14


1.3. Application: Graph Theory
 Example 3
• In Europe: Konigsberg 7-bridge problem
• Konigsberg, originally in Prussia, now in Russia
• Four sections, two rivers, seven bridges
• Euler solved this problem in 1736; the origin of graph
theory

CSE 211 Discrete Mathematics 15


1.3. Application: Graph Theory

 Problem: Draw a path (or circuit) with a pencil in


such a way that you trace over each bridge
once and only once and you complete the 'plan'
with one continuous pencil stroke

CSE 211 Discrete Mathematics 16


1.4. Application: Set Theory

 100 students, two courses for selection


(MACM101&CMPT110)
• 60 of them selected MACM101; 80 of them selected CMPT110. So
how many selected both ?

 Are there more integers than positive integers ? Are there


more integers than real numbers ?

CSE 211 Discrete Mathematics 17


1.5. Application: Complexity Theory

 Example 5:
• The Traveling Salesman Problem
• Important in
• circuit design
• network routing
• many other CS problems
• Given:
• n cities c , c , . . . , c
1 2 n

• distance between city i and j, d ij

• Find the shortest tour.

CSE 211 Discrete Mathematics 18


1.5. Application: Complexity Theory
 Example 5 (continued):
2

4
1

• How many different tours?


• Choose the first city n ways,
• the second city n-1 ways,
• the third city n-2 ways,
• etc.
• # tours = n (n-1) (n-2) . . . .(2) (1) = n! (Combinations)
• A tour requires n-1 additions.
• Total number of additions = (n-1) n! (Rule of Product)

CSE 211 Discrete Mathematics 19


1.5. Application: Complexity Theory
 Example 5 (continued):
• Assume a very fast PC:
• 1 GHz = 1,000,000,000 ops/sec
 1 flop = 1 nanosecond
= 10-9 sec.
• If n=8, T(n) = 7•8! = 282,240 flops << 1 second.
• HOWEVER . . . . . . . . . . . . .
• If n=50, T(n) = 49•50! = 1.48 1066
= 1.49 1057 seconds
= 4.73 1049 years.
• ... a long time. You’ll be an old person before it’s finished.
• There are some problems for which we do not know if efficient
algorithms exist to solve them!

CSE 211 Discrete Mathematics 20


1.5. Application: Complexity Theory

 Example 5 (continued):
• What can we do ?
• Do not waste time unless you are a genius to save the
world
• Less ambitious goals
• With 90% possible, find the best tour
• Find a tour that is no more 1.1 times the best

CSE 211 Discrete Mathematics 21

You might also like