Question

In: Computer Science

Consider the sequence sn defined as: s0 = 1 s1 = 1 sn = 2sn-1 +...

Consider the sequence sn defined as:

s0 = 1

s1 = 1

sn = 2sn-1 + sn-2

  1. What is the base case for this recursive relation?
  2. Find s5

  3. Write the pseudocode for a recursive function to find Sn for any arbitrary value of n.
  4. Create a non-recursive formula for finding the nth term in the sequence in O(1) time.

Solutions

Expert Solution


Related Solutions

Let S = (s1, s2, . . . , sn) be a given sequence of integer...
Let S = (s1, s2, . . . , sn) be a given sequence of integer numbers. The numbers can be positive or negative. We define a slice of S as a sub- sequence (si,si+1,...,sj) where 1 ≤ i < j ≤ n. The weight of a slice is defined as the sum of its elements. Provide efficient algorithms to answer each of the following questions: a)Is there any slice with zero weight ? b)Find the maximum weight slice in...
Let (sn) be a sequence that converges. (a) Show that if sn ≥ a for all...
Let (sn) be a sequence that converges. (a) Show that if sn ≥ a for all but finitely many n, then lim sn ≥ a. (b) Show that if sn ≤ b for all but finitely many n, then lim sn ≤ b. (c) Conclude that if all but finitely many sn belong to [a,b], then lim sn belongs to [a, b].
E.C. 2. (10 pts.) Suppose that (sn) is a sequence of real numbers such that sn...
E.C. 2. (10 pts.) Suppose that (sn) is a sequence of real numbers such that sn ≥ 0 for all n ∈ N. (a) Show that the set of subsequential limits of S satisfies S ⊆ [0,∞) ∪ {+∞}. (b) Is it possible for S = [0,∞) ? (Hint: apply Theorem 11.9.) Legible handwriting is a must
Let sn be a Cauchy sequence such that ∀n > 1, n ∈ N, ∃m >...
Let sn be a Cauchy sequence such that ∀n > 1, n ∈ N, ∃m > 1, m ∈ N such that |sn − m| = 1/3 (this says that every term of the sequence is an integer plus or minus 1/3 ). Show that the sequence sn is eventually constant, i.e. after a point all terms of the sequence are the same
Define a sequence of string of 0’s and 1’s: 1 The first string, s0, is just...
Define a sequence of string of 0’s and 1’s: 1 The first string, s0, is just the empty string "". The second string, s1, is 1. The third, fourth, fifth, . . . strings are defined as follows: si = si−11ti−1 where ti−1 is the reverse of si−1 with all 0s replaced by 1s and all 1s replaced by 0s. The first few strings are s0 = "", s1 = 1, s2 = 110, s3 = 1101100, s4 = 110110011100100....
Prove that if a sequence is bounded, then limsup sn is a real number.
Prove that if a sequence is bounded, then limsup sn is a real number.
Assume $s0 = 0x00000005, compute the contents of the specified register after every step: sll $s1,...
Assume $s0 = 0x00000005, compute the contents of the specified register after every step: sll $s1, $s0, 2 #$s1 = ? or $s1, $s1, $s0 #$s1 = ? andi $s1, $s1, 15 #$s1 = ? andi $s2, $s2, 0 #$s2 = ? nor $s2, $s2, $s1 #$s2 = ?
Let {an} be a sequence defined recursively by a1 = 1 and an+1 = 2√ 1...
Let {an} be a sequence defined recursively by a1 = 1 and an+1 = 2√ 1 + an where n ∈ N (b) Does {an} converge or diverge? Justify your answer, making sure to cite appropriate hypotheses/theorem(s) used. Hint : Try BMCT [WHY?]. (c) (Challenge) If {an} converges then find its limit. Make sure to fully justify your answer.
The Fibonacci sequence is defined as F_1 = 1, F_2 = 1, and F_n = F_n-1...
The Fibonacci sequence is defined as F_1 = 1, F_2 = 1, and F_n = F_n-1 + F_n-2 for n >= 3. Calculate the sum F_1 + F_2 + ... + F_n using the fundamental theorem of summation.  
1a. Consider the sequence {?? }n≥0 which starts 1,2,7,20,61,122,..., defined by the recurrence relation ?? =...
1a. Consider the sequence {?? }n≥0 which starts 1,2,7,20,61,122,..., defined by the recurrence relation ?? = 2??−1 + 3??−2 and initial conditions ?0 = 1, ?1 = 2. Solve the recurrence relation. That is, find a closed formula for ??. Show your work. The abandoned field behind your house is home to a large prairie dog colony. Each week the size of the colony triples. However, sadly 4 prairie dogs die each week as well (after the tripling occurs). Consider...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT