{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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 defined as follows: A 1 = 1 , (1) A n = n 2 - A n - 1 for 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 of A n . Hint: Interpret A n as part of a paving of a chess board with n × n squares. Exercise 2.3 For a natural number n we call l ( n ) the length of the shortest addition chain for n . 1. Specify two addition chains for 4. Which one is optimal?

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

View Full Document
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

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online