CS2104: Introduction to Problem Solving
Homework Assignment 6

Due at 11:00pm on Tuesday, October 14
30 Points

Here are the problems for Homework 6.

  1. Assume standard cryptarithmetic rules. In particular: every letter stands for a digit 0-9; no two letters stand for the same digit; and there are no leading zeroes. Solve the following:
              SNIPS
            +NOAIPS
            -------
            BLABFUL
    
    Document the steps you take.

  2. A pharmacist receives a shipment of 10 bottles of the hair loss medication NewGrow, with 2000 pills per bottle. The pharmacist has a scale that is accurate to 1 microgram.

    1. Assume that one bottle is defective, with all pills in that bottle being 10 milligrams too heavy. How can the pharmacist identify the defective bottle with a single weighing? Justify your solution.
    2. Assume that one or more bottles are defective, with all pills in those bottles being 10 milligrams too heavy. How can the pharmacist identify ALL the defective bottles with a single weighing? Justify your solution.

  3. A group of N people are standing in a field in such a way that all the pairwise distances between people are distinct. Each person is told to watch the person nearest to him or her. Show that, if N is odd, then there is at least one person who is not being watched. Is the same true if N is even? Justify your answers.