# solu11 - This ﬁle contains the exercises, hints, and...

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

This fle contains the exercises, hints, and solutions For Chapter 11 oF the book ”Introduction to the Design and Analysis oF Algorithms,” 2nd edition, by A. Levitin. The problems that might be challenging For at least some students are marked by ± ; those that might be diﬃcult For a majority oF students are marked by ² . Exercises 11.1 1. Prove that any algorithm solving the alternating-disk puzzle (Problem 11 in Exercises 3.1) must make at least n ( n +1) / 2 moves to solve it. Is this lower bound tight? 2. Prove that the classic recursive algorithm For the Tower oF Hanoi problem (Section 2.4) makes the minimum number oF disk moves needed to solve the problem. 3. ±ind a trivial lower-bound class For each oF the Following problems and indicate, iF you can, whether this bound is tight. a. ±inding the largest element in an array b. Checking completeness oF a graph represented by its adjacency ma- trix c. Generating all the subsets oF a n -element set d. Determining whether n given real numbers are all distinct 4. Consider the problem oF identiFying a lighter Fake coin among n identical- looking coins with the help oF a balance scale. Can we use the same inFormation-theoretic argument as the one in the text For the number oF questions in the guessing game to conclude that any algorithm For identi- Fying the Fake will need at least ± log 2 n ² weighings in the worst case? 5. Prove that any comparison-based algorithm For fnding the largest element oF an n -element set oF numbers must make n 1 comparisons in the worst case. 6. ±ind a tight lower bound For sorting an array by exchanging its adjacent elements. 7. ± Give an adversary argument prooF that the time eﬃciency oF any al- gorithm that checks connectivity oF a graph with n vert icesisin Ω( n 2 ) , provided the only operation allowed For an algorithm is to inquire about the presence oF an edge between two vertices oF the graph. Is this lower bound tight? 8. What is the minimum number oF comparisons needed For a comparison- based sorting algorithm to merge any two sorted lists oF sizes n and n +1 elements, respectively? Prove the validity oF your answer. 1

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

View Full Document
9. Find the product of matrices A and B through a transformation to a product of two symmetric matrices if A = ± 1 1 23 ² and B = ± 01 12 ² . 10. a. Can we use this section’s formulas that indicate the complexity equiv- alence of multiplication and squaring of integers to show the complexity equivalence of multiplication and squaring of square matrices? b. Show that multiplication of two matrices of order n can be reduced to squaring a matrix of order 2 n. 11. Find a tight lower bound class for the problem of ±nding two closest numbers among n real numbers x 1 ,x 2 , ..., x n . 2
Hints to Exercises 11.1 1. Is it possible to solve the puzzle by making fewer moves than the brute- force algorithm? Why?

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.

## This note was uploaded on 04/28/2010 for the course CS CSE taught by Professor Drt during the Spring '10 term at Kaplan University.

### Page1 / 36

solu11 - This ﬁle contains the exercises, hints, and...

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

View Full Document
Ask a homework question - tutors are online