Hints for Question 1

You can modify the simple leader election algorithm that I described in class to solve this problem. This time, instead of a processor looking for a processor with larger ID than its own, the processor just counts the number of processors with ID's different from its own.

Try to solve the problem with the above hint. If you really do not see how to design the algorithm, here is are additional hints.