Hm. It would be nice if it does turn out to be that easy. But I don't think this is right:
Rows and columns are independent.
A valid choice at any given cell is dependant upon the existing values of the preceding two cells to the left, and the two above.
Also, after 1 billion simulations, the ratio is consistently, (since the first 1 million), 8.972something%. Your figure is too high as would be the case if you omit some of the dependencies:
A B C D +---------------- 1 | 6 | 6 |5.8| ? | |---+---+---+---+ 2 | 6 | 6 |5.8| ? | |---+---+---+---+ 3 |5.8|5.8| ? | ? | |---+---+---+---+ 4 | ? | ? | ? | ? | |---+---+---+---+
Of the 36 possible pairings for those two dependencies, 30 leave the choice as 6. 6 pairings leave the choices as 5.
On average, choices in C1 (etc.) are therefore: 30*6 + 6*5 = 210 / 36 = 5.8333...
On average, of the 6*5.8333... = 35 pairings that can occur, 6 will be invalid. Therefore 29*6 + 6*5 = 204 / 35 = 5.8285714...... choices.
This calculation is wrong!
Of the 5.8333...^4 - 1158 possible combinations, 6^2 = 36 are invalid. Therefore 1122*6 + 36*5 = 6192 / 1158 = 5.9689119170984455958549222797927.
Which cannot be right because with the extra constraint, the choices should go down, not up!
But I'm having trouble wrapping my brain around extending the previous cases to this case?
There should be a pattern, but I am not yet seeing it.
Update: Progress! I see (one) error above.
The choice will be restricted if either pair matches. So the invalid states are 6 * 5.8333^2 * 2; not 6*6. With that, the revised calculation is:
Of the 5.8333...^4 - 1158 possible combinations, 6 * 5.8333^2 * 2 = 408.333 are invalid.
Therefore 750*6 + 408.333*5 = 6541.66 / 1158 = 5.6491076568796632124352331606218.
Which looks much closer to my expectations.
In reply to Re^8: Pattern enumeration. (UPDATED)
by BrowserUk
in thread Pattern enumeration.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |