I decided to do an image to explain this better, I just want to check my thinking is ok, and that I can reduce total permutations by 75%:
alt text http://www.freeimagehosting.net/uploads/45e5c6b05e.gif
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you are reducing the number of permutations, but not by 75%, since all possible positions of the small square fill up a 6×6 square, and your “quarter” fills up a 4×4 square.
Since there are “overlaps” to your quarters, you are actually adding a little permutations.
Since your quarter is 4×4, you have 4 squares overlapping in the middle column, and another four in your middle row.
Still, this is less than actually computing for each small square.
also, you could further increase performance with 2 squares by doing this:
let’s say you have 2 squares, 1 & 2. if your square is:
11110000111100000000000002000000this will be equivalent to:
00001111000011110000000000000020and
00000020000000000000111100001111so, you could loop through all permutations of 1 in the first quarter of the grid, against all permutations of 2 in the FIRST HALF (left) of the grid. do this for quarters 1 and 2 (where quarter 1 is upper-left, and quarter 2 is upper right).