Exam 5: Sequences, Mathematical Induction, and Recursion

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

The following while loop is annotated with a pre- and post-condition and also a loop invariant. Use the loop invariant theorem to prove the correctness of the loop with respect to the pre- and post-conditions. [[ Pre-condition: product =A[1]= A [ 1 ] and i=1]i = 1 ] while (im)( i \neq m ) 1. i:=i+1i : = i + 1 2. product := product. A[i]A [ i ] end while [[ Post-condition: product =A[1]A[2]A[m]]= A [ 1 ] \cdot A [ 2 ] \cdots A [ m ] ] loop invariant: I(n)I ( n ) is "i=n+1" i = n + 1 and product :=A[1]A[2]A[n+1]": = A [ 1 ] \cdot A [ 2 ] \cdots A [ n + 1 ] "

(Essay)
4.9/5
(35)

A sequence a0,a1,a2,a _ { 0 } , a _ { 1 } , a _ { 2 } , \ldots satisfies the recurrence relation ak=4ak13ak2a _ { k } = 4 a _ { k - 1 } - 3 a _ { k - 2 } with initial conditions a0=1a _ { 0 } = 1 and a1=2a _ { 1 } = 2 . Find an explicit formula for the sequence.

(Essay)
4.9/5
(38)

 Compute k=0312k\text { Compute } \sum _ { k = 0 } ^ { 3 } \frac { 1 } { 2 ^ { k } }

(Essay)
4.8/5
(38)

A single pair of rabbits (male and female) is born at the beginning of a year. Assume the following conditions: (a) Rabbit pairs are not fertile during their first two months of life, but thereafter they give birth to four new male/female pairs at the end of every month; (b) No deaths occur. Let sn=s _ { n } = the number of pairs of rabbits alive at the end of month nn , for each integer n1n \geq 1 , and let s0=1s _ { 0 } = 1 . Find a recurrence relation for s0,s1,s2,s _ { 0 } , s _ { 1 } , s _ { 2 } , \ldots Justify your answer carefully.

(Essay)
4.9/5
(37)

A sequence is defined recursively as follows: a0=2 and ak=4ak1+1 for all k1.a _ { 0 } = 2 \quad \text { and } \quad a _ { k } = 4 a _ { k - 1 } + 1 \quad \text { for all } k \geq 1 . It is proposed that an explicit formula for this sequence is an=74n13a _ { n } = \frac { 7 \cdot 4 ^ { n } - 1 } { 3 } Use mathematical induction to check whether this proposed formula is correct.

(Essay)
4.8/5
(26)

Use repeated division by 2 to find the binary representation of the number 1032. Show your work.

(Essay)
4.8/5
(31)

Use a summation symbol to rewrite the following: 112+1314+15161 - \frac { 1 } { 2 } + \frac { 1 } { 3 } - \frac { 1 } { 4 } + \frac { 1 } { 5 } - \frac { 1 } { 6 }

(Essay)
4.7/5
(36)

Transform the following summation by making the change of variable i = k + 1: k=0nk2k+n\sum _ { k = 0 } ^ { n } \frac { k ^ { 2 } } { k + n }

(Essay)
4.8/5
(34)

 Compute k=14k2\text { Compute } \sum _ { k = 1 } ^ { 4 } k ^ { 2 } \text {. }

(Essay)
4.7/5
(34)

Use the recursive definition of summation together with mathematical induction to prove that for all positive integers nn , if a1,a2,,ana _ { 1 } , a _ { 2 } , \ldots , a _ { n } and b1,b2,,bnb _ { 1 } , b _ { 2 } , \ldots , b _ { n } are real numbers, then k=1n(2ak3bk)=2k=1nak3k=1nbk.\sum _ { k = 1 } ^ { n } \left( 2 a _ { k } - 3 b _ { k } \right) = 2 \sum _ { k = 1 } ^ { n } a _ { k } - 3 \sum _ { k = 1 } ^ { n } b _ { k } .

(Essay)
4.9/5
(31)

Define a set SS recursively as follows: I. BASIS: 11S11 \in S II. RECURSION: a. If sSs \in S , then 0sS0 s \in S and s0Ss 0 \in S b. If xx is any string (including the null string) such that 1x1S1 x 1 \in S , then 10x1S10 x 1 \in S and 1x01S1 x 01 \in S III. RESTRICTION: No strings other than those derived from I and II are in SS . a. Is 010010S010010 \in S ? Justify your answer. b. Is 011011S011011 \in S ? Justify your answer.

(Essay)
4.9/5
(41)

Suppose a certain amount of money is deposited into an account paying 4%4 \% annual interest, compounded quarterly (i.e., four times a year). For each positive integer nn , let Sn=S _ { n } = the amount on deposit at the end of the nn th quarter, and let S0S _ { 0 } be the initial amount deposited. (a) Find a recurrence relation for S0,S1,S2,S _ { 0 } , S _ { 1 } , S _ { 2 } , \ldots , assuming no additional deposits or withdrawals for a 3-year period. (b) If S0=$5000S _ { 0 } = \$ 5000 , find the amount of money on deposit at the end of three years. (c) Find the APR for the account.

(Essay)
4.9/5
(32)

Use iteration to find an explicit formula for the sequence b0,b1,b2,b _ { 0 } , b _ { 1 } , b _ { 2 } , \ldots defined recursively as follows: =2+3 for all integers k\geq1 =1. If appropriate, simplify your answer using one of the following reference formulas: (a) 1+2+3++n=n(n+1)21 + 2 + 3 + \cdots + n = \frac { n ( n + 1 ) } { 2 } for all integers n1n \geq 1 . (b) 1+r+r2++rm=rm+11r11 + r + r ^ { 2 } + \cdots + r ^ { m } = \frac { r ^ { m + 1 } - 1 } { r - 1 } for all integers m0m \geq 0 and all real numbers r1r \neq 1 .

(Essay)
4.8/5
(42)

In a Double Tower of Hanoi with Adjacency Requirement there are three poles in a row and 2n disks, two of each of n different sizes, where n is any positive integer. Initially pole A (at one end of the row) contains all the disks, placed on top of each other in pairs of decreasing size. Disks may only be transferred one-by-one from one pole to an adjacent pole and at no time may a larger disk be placed on top of a smaller one. However a disk may be placed on top of another one of the same size. Let C be the pole at the other end of the row and let sn=[ the minimum number of moves  needed to transfer a tower of 2n disks from pole A to pole C]s _ { n } = \left[ \begin{array} { l } \text { the minimum number of moves } \\\text { needed to transfer a tower of } 2 n \\\text { disks from pole } A \text { to pole } C\end{array} \right] (a) Find s1s _ { 1 } and s2s _ { 2 } . (b) Find a recurrence relation expressing sks _ { k } in terms of sk1s _ { k - 1 } for all integers k2k \geq 2 . Justify your answer carefully.

(Essay)
4.9/5
(28)

Use the formula 1+r+r2++rn=rn+11r11 + r + r ^ { 2 } + \cdots + r ^ { n } = \frac { r ^ { n + 1 } - 1 } { r - 1 } (for all real numbers r1r \neq 1 and for all integers n0n \geq 0 ) to find 2+22+23++2m2 + 2 ^ { 2 } + 2 ^ { 3 } + \cdots + 2 ^ { m } where m is an integer that is at least 1.

(Essay)
4.8/5
(40)

In a Triple Tower of Hanoi, there are three poles in a row and 3n disks, three of each of n different sizes, where n is any positive integer. Initially, one of the poles contains all the disks placed on top of each other in triples of decreasing size. Disks are transferred one by one from one pole to another, but at no time may a larger disk be placed on top of a smaller disk. However, a disk may be placed on top of one of the same size. Let tnt _ { n} be the minimum number of moves needed to transfer a tower of 3n disks from one pole to another. Find a recurrence relation for t1,t2,t3,t _ { 1 } , t _ { 2 } , t _ { 3 } , \ldots Justify your answer carefully.

(Essay)
4.8/5
(36)

Use strong mathematical induction to prove that for all integers n2n \geq 2 either n is prime or n is a product of prime numbers.

(Essay)
4.8/5
(35)
Showing 21 - 37 of 37
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)