| Homework 14General Comments
- Most problems are found in one of the following:
- IDAA: Introduction to the Design and Analysis of Algorithms
- AIDMA: An Active Introduction to Discrete Mathematics and Algorithms
- For full credit, provide context for each problem, show all calculations,
and justify all answers by providing enough comments to explain your reasoning.
- You will lose a significant amount of credit if you do not provide context,
calculations, and justifications for a problem.
- Numbers and/or algebra by themselves are not enough.
A correct answer with no justification will be worth no more than half credit,
and sometimes much less than that.
- Precision is very important. You cannot skip steps, make guesses,
or use flawed logic. Any of these things can lead to incorrect answers.
- Homework assignments must be very neatly written or typeset
(e.g. using Word or OpenOffice).
- You must indicate any assistance/collaboration you had on an assignment as
specified on the Policies page.
- If a problem asks for an algorithm,
you should give the most efficient algorithm you can find to ensure full credit.
You should also specify the complexity of the algorithm with justification,
whether or not the problem asks for it.
Details
- IDAA 3.1 #4 (page 102) (10 points) (Hint: Read part b before you do part a)
- IDAA 3.1 #7 (page 103) (5 points) (Hint: In this problem there is a scale that gives the weight of a single pile of coins. It does not compare two piles. Also, let me clarify part (b). It is really asking you to come up with the most efficient algorithm possible to solve the problem. When it says "minimum number of weighings", it is not implying that you might get lucky and get it with a small number of weighings. It is saying what is the minimum number so that no matter what you determine the proper pile. Getting this part correct requires a very careful reading of the problem!)
- IDAA 3.2 #3 (page 106) (5 points) (Hint: It can be done in O(√n) time)
- IDAA 3.4 #7 (page 121) (5 points) As always, don't forget to analyze your algorithm.
- Choose either IDAA 3.5 #6 or #8 (page 129) (5 points) You don't have to give the full algorithm as long as you clearly say how to modify BFS/DFS to do the required task. For instance, you can say "whenever BFS does such-and-such, have it also do this-and-that." But make sure your description is clear and unambiguous.
Important Reminders:
- Give a clear description of your algorithms. You may give code/pseudocode,
but you must also include a short description of the algorithm since it is usually very difficult to determine what an algorithm is doing from code alone.
- Don't forget to give and justify the complexity of your algorithms.
- Remember to give the most efficient algorithm possible—if there is a
more efficient algorithm, you will likely lose some points.
- This book has hints in the back for many of the problems. Use them as needed.
Tip: Always make sure you test your algorithms on several reasonable inputs to convince yourself they are correct.
|
|
|