There are two strategies I could use to debug this problem.
One is to write the steps out one at a time, with more detail. Let's use this as an example:
Claim: There are 24 ways to order 3 Ts and 1 H if the Ts are distinguishable
Claim: There are 3 Ts, so if the Ts are not distinguishable, each order is counted 3 times because each one is counted 3 times.
If you don't see which claim is false, you can try splitting up each claim into steps or add more detail, or you can try the second strategy: testing it out.
Let's test the first claim:
Suppose the Ts were distinguishable. I will list out the 24 possibilities to see if there are actually 24 (if this turns out to be too large, you can try a smaller example, but 24 isn't too large so I'll just do it; also, do this in a logical order so you don't miss or repeat any):
$\hspace{5pt}1.\hspace{5pt}T_1, T_2, T_3, H\hspace{10pt}$ $\hspace{5pt}2.\hspace{5pt}T_1, T_2, H, T_3\hspace{10pt}$ $\hspace{5pt}3.\hspace{5pt}T_1, H, T_2, T_3\hspace{10pt}$ $\hspace{5pt}4.\hspace{5pt}H, T_1, T_2, T_3$
$\hspace{5pt}5.\hspace{5pt}T_1, T_3, T_2, H\hspace{10pt}$ $\hspace{5pt}6.\hspace{5pt}T_1, T_3, H, T_2\hspace{10pt}$ $\hspace{5pt}7.\hspace{5pt}T_1, H, T_3, T_2\hspace{10pt}$ $\hspace{5pt}8.\hspace{5pt}H, T_1, T_3, T_2$
$\hspace{5pt}9.\hspace{5pt}T_2, T_1, T_3, H\hspace{10pt}$ $10.\hspace{5pt}T_2, T_1, H, T_3\hspace{10pt}$ $11.\hspace{5pt}T_2, H, T_1, T_3\hspace{10pt}$ $12.\hspace{5pt}H, T_2, T_1, T_3$
$13.\hspace{5pt}T_2, T_3, T_1, H\hspace{10pt}$ $14.\hspace{5pt}T_2, T_3, H, T_1\hspace{10pt}$ $15.\hspace{5pt}T_2, H, T_3, T_1\hspace{10pt}$ $16.\hspace{5pt}H, T_2, T_3, T_1$
$17.\hspace{5pt}T_3, T_1, T_2, H\hspace{10pt}$ $18.\hspace{5pt}T_3, T_1, H, T_2\hspace{10pt}$ $19.\hspace{5pt}T_3, H, T_1, T_2\hspace{10pt}$ $20.\hspace{5pt}H, T_3, T_1, T_2$
$21.\hspace{5pt}T_3, T_2, T_1, H\hspace{10pt}$ $22.\hspace{5pt}T_3, T_2, H, T_1\hspace{10pt}$ $23.\hspace{5pt}T_3, H, T_2, T_1\hspace{10pt}$ $24.\hspace{5pt}H, T_3, T_2, T_1$
Because you are good at programming, sometimes writing a program to write all the cases can be a fast way to do this.
Now we test claim 2. Is each configuration listed 3 times? No, each one is listed 6 times, so that is where the error is. We should divide by 6 instead, giving the correct (or at least matching) answer of $24/6=4$.
One more way of finding errors (doesn't quite apply to this problem) is that if you have a lot of steps, you can see if the conclusion you reached somewhere in the middle is consistent with the original statement or if it is consistent with the final answer (e.g. if you are solving an equation and you wrote out all of your steps you can plug in the values you got for each variable into one of the intermediate steps to see if the error was after that step). This is like a binary search in the steps for the error, but you might want to have some preference for the harder steps.
Debugging math is a completely different experience from debugging programs. The difference is that while we have programs, they (tend to be) imperative - that is, they list out a series of steps that need to be followed.
. Without going into details because of lack of time (Lady is waiting at home), I would suggest you to go for George Polya's ultimate classic -> http://www.amazon.com/How-Solve-Mathematical-Princeton-Science/dp/069111966XAll the best for your quest for knowledge.
– Andy K May 03 '16 at 15:44permutation
,combination
andvariation
. – Crowley May 04 '16 at 12:47T
. You can't debug it, because you can't iterate through every type in the world. – Agent_L May 06 '16 at 07:55