Question text is in black, my answers in blue.
Maybe an example will help. Look at n=3, where your program will list the six permutations (with k=3 as well) as 123, 132, 213, 231, 312, and 321. We can convert each of these six into cycle notation. With 123, each element goes to itself and forms a cycle of size 1, so the cycle notation is (1) (2) (3). With 132, 1 goes to itself and 2 and 3 go to each other, so there are two cycles and the cycle notation is (1) (2 3). With 213, the cycle notation is (1 2) (3), with 231 it is (1 2 3) -- in this last case element 1 goes to 2, 2 goes to 3, and 3 goes to 1, so all three elements are in the same cycle. Then 321 has cycle notation (1 3) (2) and 312 has cycle notation (1 3 2). Note that (1 2 3) and (1 3 2) are two different permutations even though they have the same set as a cycle.
You could get the right answer that way, but it would be very tedious unless you managed to automate the process. What I recommend is counting each conjugacy class the way you count poker hands in section 6.6. How could a permutation have cycle structure of the form (a b c) (d e)? It's not as simple as figuring out what a, b, c, d, and e could be, because (1 3 2) (4 5), (2 1 3) (5 4), and (3 2 1) (4 5) are all the same permutation. Maybe looking at the classes for n=4 will give you an idea how to count the ones for n=5.
It is horrible, which is why I gave you a hint. If you use the eight sets I suggest rather than the simpler groups of sets you describe above, the I/E calculation gets much simpler because most of the intersections are empty.
No, 4-3's or 4-2-1's count as "four of a kind", not as full-house. Remember that the player chooses five of her seven cards so as to make the highest-ranking possible hand. Since four-of-a-kind outranks a full house, she will choose to call the 4-3 or 4-2-1 a four-of-a-kind, so you should count it that way too.
Ok, let's see if I can help. For Sequences, it should be pretty clear that an (n,k) Sequence can consist of a first element plus an (n,k-1) Sequence, which we call "first" and "theRest". We list all the (n,k) Sequences by taking each value of "first" in turn and attaching each possible value of "theRest" to it in turn. The trick for the other three situations is finding out what "theRest" should be. Let's look at Multiset first. Suppose I have an (n,k) Multiset and its first element is i. Then the rest of the elements must still come in order and the first of them must be at least i. They will form a Multiset of length k-1, ranging from (i,i,...,i) to (n,n,...,n). But if we want to list all of these possibilities using a recursive call to our own Multiset-lister, we need to take all the Multisets from (1,1,...,1) to (n-i+1,n-i+1,...,n-i+1) because that's what our Multiset-lister can give us. So an (n,k) Multiset has a first element i and a remaining part, "theRest", which is an (n-i+1,k-1) Multiset. The situation for Sets is very similar, because if the first element is i, the remaining elements must be in order and must all be greater than i. The situation for Perms is the most complicated. If the first element is i, then the remaining elements can take any value except i, so there are n-1 possible values. Thus "theRest" will be a (n-1,k-1) Perm. The trick is to take the (n-1,k-1) Perm listed by the recursive call, which ranges from (1,1,...,1) to (n-1,n-1,...,n-1), and view it as ranging over the values from 1 to n excepting i.
No, actually blazes are much rarer than three-of-a-kind hands. The traditional poker hand ranks obey the rule that rarer hands are more valuable, but there is no reason that specially-defined hands have to obey this rule and in this case they don't.
Yes, the answer will be a function of the string length, k. But you know how to add and subtract functions of k, just as you can add and subtract numbers. If you let X be the strings of length k with at least one b, and let Y be the set of strings of length k with at least one c, then the hint should tell you how to compute |X|, |Y|, and |X ∪ Y|. Then the Double-Counting Rule (Two-Set I/E) will let you compute |X ∩ Y|.
Last modified 27 September 2009