CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE
Spring 2019
1
CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2019 2 - - PowerPoint PPT Presentation
1 CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2019 2 Announcements Exam 1 is Wednesday, Feb 13. 6pm 7:50pm If you get special accommodations, you should have received email from Ms. Eberwein with the date, time, and location
Spring 2019
1
received email from Ms. Eberwein with the date, time, and location of your exam.
about Exam 1.
2
Section 2.5
3
function f: S → Z+
4
5
the elements in the set in a sequence.
there some time in the future at which I will read that element.
6
7
8
9
Better Approach
10
11
12
13
14
15
16
17
Theorem: If A is countable and B is countable, then A U B is countable.
then |A| = |B|. In other words, if there are injective functions f: A → B and g: B → A, then there is a bijection from A to B (and B to A).
18
19
Section 2.4
20
count her ancestors.
grandparents, etc.
21
1 2 3 4 5 6 2 4 8 16 32 64
set S.
set S.
22
23
elements of a sequence?
amount, or an amount that depends on position in the sequence?
particular amount?
24
where the initial term a and the common difference d are real numbers.
Examples:
1.
Let a = −1 and d = 4:
1.
Let a = 7 and d = −3:
25
a + nd, n = 0, 1, 2, . . .
where the initial term a and the common ratio r are real numbers.
Examples: Let a = 1 and r = −1. Let a = 2 and r = 5. Let a = 6 and r = 1/3.
26
tn = arn, n = 0, 1, 2, . . .
expresses an in terms of one or more of the previous terms of the sequence.
precede the first term where the recurrence relation takes effect.
an = an-1 + 3 for n = 1,2,3,4,….
27
relation an = an-1 – an-2 for n = 2, 3, 4, ….
28
Define the Fibonacci sequence f0 ,f1 ,f2,…, by:
Example: Find f2 ,f3 ,f4 , and f5.
29
by a recurrence relation is called solving the recurrence relation.
relation an = 2an-1 – an-2 for n = 2,3,4,….
30
an = 2an-1 – an-2 for n = 2,3,4,….
31
Let {an} be a sequence that satisfies the recurrence relation an = an-1 + 3 for n = 2,3,4,…. Suppose that a1 = 2. Finding a Solution - Method 1: forward substitution
32
an = an-1 + 3 for n = 2,3,4,…. Suppose that a1 = 2.
33
bank yielding 11% per year with interest compounded annually. How much will be in the account after 30 years?
34
35