Title: Algorithms and Discrete Mathematics 20082009
1Algorithms and Discrete Mathematics 2008/2009
Ioannis Ivrissimtzis
08-Dec-2008
2Overview of the lecture
- Combinatorics
- Exponentiation and logarithms
3Counting pinciples
- The product rule Rosen, p.336 Suppose that a
procedure can be - broken down into a sequence of two tasks. If
there are n1 ways to do - the first task and for each of these ways of
doing the first task, there are - n2 ways to do the second task, then there are
n1n2 ways to do the - procedure.
The sum rule Rosen, 338 If a task can be done
either in one of n1 ways or in one of n2 ways,
where none of the set of n1 ways is the same as
any of the set of n2 ways, then there are n1n2
ways to do the task.
4Exercise
- Exercise R.1
- A bit is a symbol with two possible values,
namely 0 and 1. A bit string - is a sequence of bits.
- How many different bit strings are there of
length six? - How many bit strings of length six start and end
with 1s?
5Answer
- Answer R.1
- Using the product rule, there are 2 2 2 2
2 2 64 different bit strings of length six. - There are two choices for each bit, except for
the first and the last bits where there is only
one choice. - Using the product rule, there are 1 2 2 2
2 1 16 bit strings of length six that start
and end with 1s.
6Factorial
- Definition 2.1 The factorial of an integer n 0
is defined by - and denoted by n!
7Permutations
- Definition 2.2 Rosen, p.355 A permutation of a
set of distinct - objects is an ordered arrangement of these
objects.
We are also interested in ordered arrangements of
some of the elements of a set.
Definition 2.3 Rosen, p.355 An ordered
arrangement of r elements of a set is called an
r-permutation.
8Permutations
- Theorem 2.1 Rosen, p.356 If n and r are
integers with 1 r n, then - there are
- r-permutations of a set with n distinct elements.
Corollary 2.1 Rosen, p.356 If n and r are
integers with 0 r n, then
9Combinations
- Definition 2.4 Rosen, p.357 An r-combination
of elements of a set - is an unordered selection of r elements from the
set.
Theorem 2.2 Rosen, p.358 The number of
r-combinations of a set with n elements, where n
and r are integers with 0 r n, equals
10Binomial coefficients
- Definition 2.5 Rosen, p.357 The number of
r-combinations of a set - with n distinct elements is denoted by C( n, r ).
It is also denoted by - and is called a binomial coefficient. It is
pronounced n choose r.
11Exercise
- Exercise R.2 Rosen, p.361, Ex.20
- How many bit strings of length eight have
- exactly three 1s?
- at most three 1s?
12Answer
- Answer R.2
- The bit strings of length 8 with exactly three 1s
are - The bit strings of length 8 with at most three 1s
are
13Pascals triangle
14Pascals triangle
15Binomial theorem
- The Binomial Theorem Rosen, p.363 Let x and y
be variables, and - let n be a nonnegative integer. Then
16Exercise
- Exercise R.3 Rosen, p.364 Expand (xy)4
Answer R.3
17Overview of the lecture
- Combinatorics
- Exponentiation and logarithms
18Positive integer powers
- Proposition 4.1 If b is a real number and n,m
are positive integers, - we have
Proposition 4.2 If b is a real number and n,m
are positive integers, we have
19Negative integer powers
- Let b?0 be a real number and let n be a positive
integer. We define
Let b0 be a real number and let n be a positive
integer. We define as the n-th root of b. That
is, is a real number x with the property
20Exponential functions
- The exponential functions
- are everywhere positive
- At zero their value is 1.
- For bgt1 they increase
- monotonically. They grow
- fast.
1
0
21Properties of exponentials
- Proposition 4.3 Let a,b,x,y be real numbers,
with a,bgt0. We have
22Exercise
- Exercise R.5 Find one solution of the equation
Answer R.5
23Logarithms
- For real positive numbers x,b with b?1, the
logarithm of x to the base - b, written logbx is the unique real number y that
satisfies byx. - That is, if we raise b to the power of logbx we
get x
24Logarithms
Answer R.4
25Logarithms
- The logarithms are inverses
- of the exponentials.
- They are only defined on
- positive real numbers.
- For any base, the logarithm
- of 1 is 0.
- For bgt1 they increase
- monotonically. They grow
- slow.
1
0
26Properties of logarithms
- Proposition 5.1 Let b,r,s be positive real
numbers with b?1. We have -
-
-
- These properties are related to properties of the
exponents mentioned - in the previous lecture.
27Exercise
- Exercise R.6 Solve the equation
Answer R.6