Friday, February 6, 2009

Happy or not?

A community of K people can be happy or not happy. Can you enumerate and generate all the possible states?

1 comment:

  1. Assign one bit to each person. Then you count from 000...00 (K bits) to 111...11.
    Exponential time with respect to K, useful for rainy days.

    ReplyDelete