posted 16 years ago
I can't understand either of your answers.
In the given example, the forbidde combinations are BB, OO, OY, YY, YO which are 5 in number.
For 3 stripes, we have a total of n*n*n = 27 permutations of which we need to eliminate the invalid ones.
From the 5 invalid combinations given, we need to construct invalid combinations with 3 stripes.
From BB we get: BBB, OBB, BBO, YYB, BBY
From OO we get: BOO, OOB, OOO, YOO, OOY
From OY we get: BOY, OYB, OOY*,OYO, YOY, OYY
From YY we get: BYY, YYB, OYY*,YYO,YYY
From YO we get: BYO, YOB, OYO*,YOO*,YYO*,YOY*
The ones marked * are those that already have been counted; so we get 21 invalid ones. Hence only 27-21=6 are valid ones with 3 stripes.
Can you explain how your formula is working along these lines?
[ May 12, 2008: Message edited by: A Bhattacharya ]