Compulsory Exercises (Tuesday 20 October 2015)
Exercise 3.1 Write down Euclid’s algorithm in recursive form and use mathematical induction to prove that it correctly returns the highest common factor.
Exercise 3.2 Use mathematical induction to prove that
is equivalent to
Exercise 3.3 Use mathematical induction to prove that
is equivalent to
Exercise 3.4 Solve the following recurrences:
Exercise 3.5 Solve the following recurrences:
Exercise 3.6 Review the number of swaps needed for selection sort in the worst case. What is the Big-O expression of this number? This is known as the (asymptotic) complexity of the algorithm.