I Understand

I Understand

I Understand

Common mistakes


  1. Learning a new programming language
  2. How many 0s are at the end of 999! (Num0s.java Num0s.pl)
  3. Find the last non-zero digit in 999!
  4. Locker Room problem (LockerRoom.java)

    A locker room has lockers numbered 0,1,2,...,1023. All lockers are initially closed.

    The first person walks in and flips every locker The 2nd person flips every other locker (starting at 0) The 3rd person flips every third locker (starting at 0) . . . The 1023 person flips every 1023 locker (starting at 0) At the end, which lockers are open and which are closed?
  5. Card swapping problem: 25 people in a circle, a deck of 50 cards with numbers 1,1,2,2,...,25,25 on them. Each person gets 2 randomly selected cards. At each step, each person looks at their two cards and passes a smallest card left.

    Prove that eventually some person will be holding two cards with the same number on them.

  6. Compress.java
  7. The Jumble Problem
  8. 15 puzzle (example of a simple solution, exercises include: have students write this, have them comment this)