project easy grasp

John has m keys and n locks, but he forgot which keys open which locks.

a) Assume that each key can open one and only one lock.

  1. Think about this problem in terms of functions. Let the function “open” go from the set of keys to the set of locks. Draw an arrow diagram for this situation.
  1. Let m = 6 and n = 8, can all of the locks be opened?
  1. Again letting m = 6 and n = 8, is this function one-to-one? Onto? Why or why not?
  1. What needs to be true about m and n to ensure that every lock gets opened?

b) Now assume that there are two keys that open the same lock while the rest of the keys open one and only one lock.

  1. Draw an arrow diagram for this situation.
  1. Let m = 6 and n = 5, can John open all of the locks?
  1. Again letting m = 6 and n = 5, is this function one-to-one? Onto? Why or why not?
  1. What is the minimum number of keys needed to open n locks?