permutations, computation, and counting principle