Each rule below is intended to define a function fff on the nonnegative integers 0,1,2,…0, 1, 2, \ldots0,1,2,…. A definition is well defined if it determines exactly one value of f(n)f(n)f(n) for every nonnegative integer nnn. Which of these definitions are well defined? Select all that apply.
f(0)=1f(0) = 1f(0)=1 and f(n)=2f(n−1)f(n) = 2f(n-1)f(n)=2f(n−1) for n≥1n \ge 1n≥1
f(0)=1f(0) = 1f(0)=1 and f(n)=f(n−1)+f(n−2)f(n) = f(n-1) + f(n-2)f(n)=f(n−1)+f(n−2) for n≥1n \ge 1n≥1
f(0)=0f(0) = 0f(0)=0, f(1)=1f(1) = 1f(1)=1 and f(n)=f(n−1)+f(n−2)f(n) = f(n-1) + f(n-2)f(n)=f(n−1)+f(n−2) for n≥2n \ge 2n≥2
f(0)=0f(0) = 0f(0)=0 and f(n)=f(2n)f(n) = f(2n)f(n)=f(2n) for n≥1n \ge 1n≥1
f(0)=3f(0) = 3f(0)=3 and f(n)=f(⌊n/2⌋)+1f(n) = f(\lfloor n/2 \rfloor) + 1f(n)=f(⌊n/2⌋)+1 for n≥1n \ge 1n≥1
Unlock full course notes by signing up
Iterating a second-order recurrence
A sequence is defined by the base cases a0=1a_0 = 1a0=1 and a1=3a_1 = 3a1=3 and the recurrence relation an=an−1+2an−2a_n = a_{n-1} + 2a_{n-2}an=an−1+2an−2 for n≥2n \ge 2n≥2. Complete the table with the exact integer values of a2a_2a2 through a6a_6a6.
Counting elements of a recursively defined set
A set SSS of integers is defined recursively. Base case: 5∈S5 \in S5∈S. Recursive step: if x∈Sx \in Sx∈S, then x+3∈Sx + 3 \in Sx+3∈S. Exclusion rule: an integer is in SSS only if it can be obtained from the base case by finitely many applications of the recursive step. How many elements of SSS are less than 100? Give your answer as a whole number.
Ranking the fifth-index terms of five recurrences
Five sequences ppp, qqq, rrr, sss and ttt are defined recursively below. Some start at index 0 and one starts at index 1, so pay attention to where each base case sits. For each sequence, find the term with index 5 (that is, p5p_5p5, q5q_5q5, r5r_5r5, s5s_5s5 and t5t_5t5), then arrange the definitions from the smallest index-5 term at the top to the largest at the bottom.
Unfolding a recursive definition with cases
A function pow(b,n)\text{pow}(b, n)pow(b,n) is defined for a positive integer bbb and every nonnegative integer nnn by three clauses:
Base case: pow(b,0)=1\text{pow}(b, 0) = 1pow(b,0)=1.
Even clause: if n≥2n \ge 2n≥2 is even, pow(b,n)=(pow(b,n/2))2\text{pow}(b, n) = \big(\text{pow}(b, n/2)\big)^2pow(b,n)=(pow(b,n/2))2.