Approximate Date Is Wednesday 3/27: #17 On Homework

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

MAT214A

Friday 3/8
Spring 2019 10:50 – 12:05 pm
Questions on Homework?
Quiz on 6-1,6-2 today *Test#2 on 3.1-3.3, 6.1-6.3, 6.8, 7.1-7.2
Approximate date is Wednesday 3/27
Recall:
Section 6-3 Generalized Permutations and Combinations
From 6-2:
Permutation is ordering of r selections from n total distinct items
Combination is a set of r selections from n total distinct items

Now we consider number of sequences or sets from groups of like items (duplicates exist)

Adjust Permutation Rule (some items are identical)


n!
If there are n1 alike, n2 alike, n3 alike, etc., then the number of permutations is: n1 !n2 !...n k !

#17 on homework

Adjusted Combination Rule (some items identical)


In general, if X is a set containing n elements, the number of unordered r element selections from X,
repetitions allowed, is
C(n-1 + r, r) = C(n – 1 + r, n - 1)

What we are trying to figure out is how many sets of (n -1) dividers and (r) not distinct selections.

#18 on homework

Section 6-8 The Pigeonhole Principlem


Pigeonhole Principle: If k is a positive integer and n objects are placed into k boxes where n > k, then at least
one of the boxes will contain two or more objects

Generalized Pigeonhole Principle: If k is a positive integer and n objects are placed into k boxes and n > k, then
n
at least one of the boxes will contain at least ⌈ ⌉ objects.
k

#11 on homework
Today:
Section 7-1 Recurrence Relations - Introduction
A recursive definition of a sequence specifies
1. Initial conditions These are the terms we need before the recurrence relation part can start
2. Recurrence relation This is a sequence where each term is defined in terms of previous terms

Example:
a0 = 0, a1 = 3 initial conditions
2an-1 - an-2 recurrence relation
an = 3n solution – a solution to a recurrence relation is a formula such that we can determine
elements without referring to previous elements.

n 0 1 2 3 4 ….n
2an-1 – an-2 0 3 2a1 – a0= 6 2a2 – a1 = 9 2a3 – a2 = 12 2an-1 – an-2

Another example: Compound interest


Person invests $5,000 at 4% interest compounded annually.
n = years
an is amount after n years

n 0 1 2 3 …. n
an 5,000 5,000 + 5,000(.04) 5,000(1.04) 5,000(1.04) an-1(1.04)
= 5,000(1.04) +5,000(1.04)(.04)= (1.04(1.04)
5,000(1.04)(1.04)

Initial condition is a0 = 5,000


Recurrence relation is an = an-1(1.04)
Solution to the recurrence relation is an = 5,000(1.04)n
One of main reasons for using recurrence relations is that sometimes it is easier to determine the nth term of
a sequence in terms of previous terms rather than find a formula for the nth term in terms of n.

Example:
Let Sn denote the number of n-bit strings that do not contain the pattern 111. Develop a recurrence
relation for S0, S1, S2, S3 …..

Solution: 
S0 is a 0-bit string, S1 is a 1-bit string, S2 is a 2-bit string, S3 is a 3-bit string…..Sn is an n-bit string
S0 is a 0-bit string: ( ) empty string  only 1 string
S1 is a 1-bit string: 0, 1  2 strings
S2 is a 2-bit string: 00, 01, 10, 11  4 strings
S3 is a 3-bit string: 000, 001, 010, 100, 011, 101, 110, 111  7 strings

Patterns?
I can see that S3 = 7 which is the sum of S0 + S1 + S2
I can see that in S3 there are 4 strings that start with 0, 2 strings that start with 10 and 1 string that starts
with 11

From listing our sets, we have S0 = 1, S1 = 2, S2 = 4, S3 = 7


The recurrence relation appears to be: Sn = Sn-1 + Sn-2 + Sn-3 for n > 2.
Note that the recurrence relation implies S3 = S2 + S1 + S0 = 4 + 2 + 1 = 7, which agrees with the direct
count.

Check recurrence relation by direct count and relation for S 4:


There should be 24 = 16 possible 4-bit strings by the Product Rule
S4 = 16 0000, 0001, 0010, 0100, 1000,
0011,0110, 1100, 0101, 1001, 1010
0111, 1110, 1011, 1101,
1111
We must exclude all strings that have the pattern 111, so we will exclude 0111, 1110, 1111. This gives us
13 strings.
S4 = S3 + S2 + S1 = 7 + 4 + 2
S4 = 13
check
B) Section 7-2 Solving Recurrence Relations
Recall that solving a recurrence relation is to write a formula in terms of n without referring to previous terms
in the sequence.
We started class with this example:
Initial conditions: a0 = 0, a1 = 3
Recurrence relation: 2an-1 - an-2 for n>1
Solution: an = 3n

Two methods for solving recurrence relations:


1. Iteration Method
2. Method for solving linear recurrence relations

1. Iteration Method (iteration means repeating a procedure to obtain better approximation)


Example: Solve the recurrence relation an = an-1 + 3 by iteration.
The initial condition is a1 = 2

Step 1:
Replace n with n-1: an-1 = an-2 + 3
Substitute expression for an-1 into an = an-1 + 3
an = [an-2 +3] + 3 or an = an-2 + 2*3

Step 2:
Replace n with n-2: an-2 = an-3 + 3
Substitute expression for an-2 into an-1 = an-2 + 2*3
an-1 = [an-3 +3] + 2*3 or an-1 = an-3 + 3*3

Step 3:
Remove the recursive terms
We can see that an = an-1 + 3 can be written an = an-k + k*3 where k is a nonnegative integer
We need to remove the subscript n-k. We can do this by letting k = n-1
an = an-(n-1) + (n-1)*3
an = a1+ (n-1)*3 we know that a1 is initial condition and a1 = 2
an = 2+ (n-1)*3

----------------------stopped here ------------------------------------

You might also like