08.08.2013 Views

Ex03 - Cs.ioc.ee

Ex03 - Cs.ioc.ee

Ex03 - Cs.ioc.ee

SHOW MORE
SHOW LESS

Transform your PDFs into Flipbooks and boost your revenue!

Leverage SEO-optimized Flipbooks, powerful backlinks, and multimedia content to professionally showcase your products and significantly increase your reach.

Concrete Mathematics, Lesson 3: Exercises<br />

Exercise 2.3<br />

Silvio Capobianco<br />

Revised: October 3, 2012<br />

Demonstrate your understanding of σ-notation by writing out the sums<br />

<br />

ak and <br />

ak2 .<br />

0≤k≤5<br />

0≤k 2 ≤5<br />

in full. (Watch out—the second sum is a bit tricky.)<br />

Solution. Recall that <br />

P (k) af(k) is the sum of precisely those values aj such<br />

that j = f(k) and the property P is satisfied by the index k. Then the first<br />

sum is clearly a0 + a1 + a2 + a3 + a4 + a5.<br />

And what is the second sum? It is the sum of ak2 for k satisfying 0 ≤<br />

k2 ≤ 5. But k is an integer value, and there are five integers whose square<br />

is betw<strong>ee</strong>n 0 and 5: that is, 0, 1, 2, −1, and −2. For f(x) = x2 the second<br />

sum is thus a (−2) 2 + a (−1) 2 + a02 + a12 + a22 = a0 + 2a1 + 2a4.<br />

Exercise 2.13 (as we did it)<br />

Find a closed form for n<br />

k=0 (−1)k · k 2 .<br />

Solution. The solution can be found by considering the cases n even and n<br />

odd separately. If n = 2m + 1 is odd, then<br />

n<br />

(−1) k · k 2 =<br />

k=0<br />

=<br />

m<br />

((2j) 2 − (2j + 1) 2 )<br />

j=0<br />

m<br />

(−4j − 1) :<br />

j=0<br />

1


this is the opposite of the sum of the first m + 1 terms of an arithmetic<br />

sequence with initial value a = 1 and step b = 4, therefore<br />

n<br />

(−1) k · k 2 <br />

<br />

m(m + 1)<br />

= − (m + 1) · 1 + · 4<br />

2<br />

k=0<br />

If n is even, then n + 1 is odd and<br />

n<br />

(−1) k · k 2 =<br />

k=0<br />

= −(m + 1) · (2m + 1)<br />

(2m + 1)(2m + 2)<br />

= −<br />

2<br />

n(n + 1)<br />

= − .<br />

2<br />

n+1<br />

(−1) k · k 2 + (n + 1) 2<br />

k=0<br />

(n + 1)(n + 2)<br />

= − + (n + 1)<br />

2<br />

2<br />

<br />

−n − 2 + 2n + 2<br />

= (n + 1) ·<br />

2<br />

= (n + 1) · n<br />

2 .<br />

In conclusion, n<br />

k=0 (−1)k · k 2 = (−1) n n(n + 1)/2 = (−1) n n<br />

k=0 k.<br />

Exercise 2.13 (as it was supposed to be done)<br />

Use the repertoire method to find a closed form for n<br />

k=0 (−1)k k 2 .<br />

Solution. The function g(n) = n<br />

k=0 (−1)k k 2 is a special solution of the<br />

recurrence equation<br />

R0 = α ,<br />

Rn = Rn−1 + (−1) n (β + γn + δn 2 ) for n ≥ 1<br />

for the special values α = β = γ = 0, δ = 1: the recurrence equation has the<br />

form Rn = Φ(Rn−1) + Ψ(n; β, γ, δ) with Φ(g) = g linear and Ψ(n; β, γ, δ) =<br />

(−1) n (β + γn + δn 2 ) linear in β, γ and δ. As we know that we can express<br />

Rn = A(n)α + B(n)β + C(n)γ + D(n)δ for special functions A(n), B(n),<br />

2


C(n) and D(n), if we manage to find D(n) in closed form, then that will be<br />

the closed form of g(n).<br />

Let us use the repertoire method. First of all, for α = 1, β = γ = δ = 0<br />

we find A(n) = 1 for every n ≥ 0. The next step should not be to put<br />

Rn = 1 for every n ≥ 0, as we already know that this is associate to the<br />

special values α = 1, β = γ = δ = 0. Instead, we put Rn = (−1) n , which<br />

corresponds to α = 1, β = 2, γ = δ = 0 and yields A(n) + 2B(n) = (−1) n :<br />

as we know that A(n) = 1 for every n ≥ 0, this means 2B(n) = (−1) n − 1<br />

and thus B(n) = ((−1) n − 1)/2 = −[n is odd].<br />

The third step will be to put Rn = (−1) n · n. This corresponds to α = 0<br />

and the recurrence equation<br />

(−1) n n = (−1) n−1 (n − 1) + (−1) n β + (−1) n γn<br />

= (−1) n−1 n − (−1) n−1 + (−1) n β + (−1) n γn + (−1) n δn 2 ,<br />

which is satisfied for every n ≥ 1 if and only if δ = 0, β = −1, and γ = 2.<br />

We thus get the equation −B(n) + 2C(n) = (−1) n n.<br />

The fourth step will be to put Rn = (−1) n n 2 . This corresponds to α = 0<br />

and the recurrence equation<br />

(−1) n n 2 = (−1) n−1 (n − 1) 2 + (−1) n (β + γn + δn 2 )<br />

= (−1) n−1 (n 2 − 2n + 1) + (−1) n (β + γn + δn 2 )<br />

= ((−1) n−1 + (−1) n β)<br />

+((−1) n−1 · (−2) + (−1) n γ)n<br />

+((−1) n−1 + (−1) n δ)n 2 ,<br />

which is satisfied for every n ≥ 1 if and only if β = 1, γ = −2, and δ = 2.<br />

We thus get B(n) − 2C(n) + D(n) = (−1) n n 2 .<br />

At this point, we have a full system of equations:<br />

A(n) = 1<br />

A(n) +2B(n) = (−1) n<br />

−B(n) +2C(n) = (−1) n n<br />

B(n) −2C(n) +2D(n) = (−1) n n 2<br />

from which we want to find D(n). But by adding together the third and<br />

fourth equation we immediately find 2D(n) = (−1) n · (n + n 2 ). Then g(n) =<br />

D(n) = (−1) n (n 2 + n)/2 = (−1) n Sn.<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!