exercise2 - 2. Calculate l (6) and speci±y two di²erent...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Algorithm and Data Structures Assignment 2 Dr. Andreas N¨uchter Fall 2009 Exercise 2.1 Execute Euclid’s algorithms on the numbers 27 and 3 252 and 105 147 and 105 Exercise 2.2 A series A is defned as ±ollows: A 1 = 1 , (1) A n = n 2 - A n - 1 ±or n > 1 . (2) 1. Show using induction: For n 1 the equality A n = S n = n ( n +1) 2 is true. 2. Show using induction: A 1 = 1 2 , A 2 = 2 2 - 1 2 , A 3 = 3 2 - 2 2 + 1 2 , A n = n 2 - ( n - 1) 2 + ( n - 2) 2 - ··· + ( - 1) n - 1 · 1 2 (3) and derive a graphical interpretation o± A n . Hint: Interpret A n as part o± a paving o± a chess board with n × n squares. Exercise 2.3 For a natural number n we call l ( n ) the length o± the shortest addition chain ±or n . 1. Speci±y two addition chains ±or 4. Which one is optimal?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2. Calculate l (6) and speci±y two di²erent optimal addition chains ±or 6. 3. Calculate l (15) and speci±y three di²erent optimal addition chains ±or 15. 1 4. Given m ∈ and n ∈ . Show l ( mn ) ≤ l ( m ) + l ( n ) . Hint: Construct an addition chain for mn based on the one for m and n and prove that the constructed one fulFlls the criteria of addition chains. Please hand in the solutions on September 10 right before class. Use your own handwriting! Late homework will not be accepted. 2...
View Full Document

Page1 / 2

exercise2 - 2. Calculate l (6) and speci±y two di²erent...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online