









































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
lectures note discrete mathematics discrete mathematics discrete mathematics discrete mathematics discrete mathematics discrete mathematics discrete mathematics discrete mathematics
Typology: Lecture notes
1 / 49
This page cannot be seen from the preview
Don't miss anything!










































Professor Anita Wasilewska
Course Web Page www.cs.stonybrook.edu/˜ cse
The webpage contains:
detailed lectures notes slides;
very detailed solutions to homework problems;
some previous tests;
all to be used for study
Course Text Book
Concrete Mathematics
A Foundations for Computer Science
R. Graham, D. Knuth, O. Patachnik
Course has been taught annually at Stanford University since 1970 and we will follow the book very closely
We use this book for part one of our course
What is Concrete Mathematic? Book Definition
Concrete Mathematics is a controlled manipulation of (some ) mathematical formulas using a collection of techniques for solving problems
We will learn techniques to evaluate horrendously looking sums, to solve complex recurrences, manipulations methods.
The original text of the book was an extension of the chapter ”Mathematical Preliminaries” of Knuth’s classic book ”Art of Computer Programming”
Concrete Mathematics and Abstract (Discrete) Mathematics
Concrete Mathematics (Foundations 1) is supposed (and hopefully will) to help you in the art of writing programs Abstract Mathematics (Foundations 2) is supposed (and hopefully will) to help you to think about the art and correctness of programming
PART ONE: Tower of Hanoi
The Tower of Hanoi
Tower of Hanoi puzzle is attributed to the French mathematician Edouard Lucas, who came up with it in 1883.
His formulation involved three pegs and eight distinctly-sized disks stacked on one of the pegs from the biggest on the bottom to the smallest on the top, like so:
The Tower of Hanoi GENERALIZED
Tower has now n disks, all stacked in decreasing order from bottom to top on one of three pegs,
Question: what is the minimum number of (legal) moves needed to move the stack to one of the other pegs?
Plan:
The Tower of Hanoi GENERALIZED to n disks
We denote by
Tn - the minimum number of moves that will transfer n disks from one peg to another under the
L - rule:
must move one disk at a time;
a larger disk cannot be on top of any smaller disks at any time
do it in as few moves as possible
peg 1 to peg 2, remaining (larger) disk from peg 1 to peg 3, the disk from peg 2 (smaller) on the top of the disk (larger) on
Recurrent Strategy to evaluate Tn
Recurrent Strategy to evaluate Tn
(empty) peg - we do it in Tn− 1 moves;
resulting in 2. - another Tn− 1 moves;
How many moves? together we have at most
Recursive Formula for Tn - end of the proof
Observe that in order to move the largest bottom disk
of it onto one of the other pegs.
This will take at least Tn− 1 moves.
Once this is done, we have to move the bottom disk at least once; we may move it more than once!
After we’re done moving the bottom disk, we have to move
take again at least Tn− 1 moves;
our Recursive Formula
From Recursive Formula to Closed Form Formula
Often the problem with a recurrent solution is in its computational complexity;
Observe that for any recursive formula Rn, in order to calculate its value for a certain n one needs to calculate
It’s easy to see that for large n, this can be quite complex.
So we would like to find (if possible) a non- recursive
Such formula is called a Closed Form Formula
Provided that the Closed Form Formula computes the same function as our original recursive one.