Ah, yes. One of the other posts got me confused.
But then I know the answer.
Rows and columns are independent. There are 6 ^ 8 = 1679616 possible rows. 1444500 are valid (simple brute force calculation). So, picking a single random row (or column) has a 1444500/1679616 of being valid. The grid has 8 rows and 8 columns. (1444500/1679616)^16 = 0.089561362, which seems to be very close what your program is measuring. | [reply] |
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 | ? | ? | ? | ? |
|---+---+---+---+
- The choices at C1, C2 & A3, B3, depend upon the two to left; or two above respectively.
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...
- The choices at D1, D2 & A4 & B4 is dependant upon the pairings left & above:
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.
- For C3, the choices are dependant upon the pairings in (C1,C2) and (A3,B3):
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.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |