CSCI 255 Fall 2020
Introduction to Algorithms and Discrete Structures
Archived Class
Charles Cusack
Computer Science
Hope College
Main
Schedule
Grading
Gradebook
Homework

Policies
Advice
College
    Policies

Notes
Programs
Tutorials

CSCI 125
CSCI 255
Others

Admin

Homework 3

General Comments

  • Most problems are found in one of the following:
    1. AIDMA: An Active Introduction to Discrete Mathematics and Algorithms
    2. IDAA: Introduction to the Design and Analysis of 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).
  • Remember that you can get up to 50% credit on a problem if you get significant outside assistance. Thus, if you are totally stuck on a problem it might be worth getting help. However, you must indicate any assistance/collaboration (See the Homework Assistance section on the Policies page). Failure to do so could result in a failing grade for the course! Note that getting help from the Help Center or me does not count as significant outside assistance, but talking with your classmates or searching on the Internet does!
  • 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

  1. AIDMA Problem 3.1 (page 72)
  2. AIDMA Problem 3.10 (page 73)
  3. AIDMA Problem 3.14 part (c) (page 73)
    Your code should be in a Java Class as follows (Package is important!):
    package stuffFor255;
    public class RoundIt {
        public int roundDivision(int n, int m) {
            // Implement your algorithm here and have it
            // return the correct answer instead of -1.
            return -1;
        }
    }
    

    Submit RoundIt.java using WebHandin 255-HW3

    NOTE: If your code is significantly broken (e.g. crashes or has an infinite loop) please rename the class/file to RoundItBroken.java before handing it in so that you do not break the autograder. (It will not run the tests properly, but I will still be able to run them by hand and look at your code.) (Actually, ignore that comment. I forgot to turn on the autograder.)
The rest of your answers should go in the HW Google Doc as usual.