Solving Combination Puzzle in C++ - How Many Possible Combinations?

  • Thread starter Thread starter badluckbrian
  • Start date Start date
  • Tags Tags
    Combination
Click For Summary
To determine the number of combinations for arranging nine distinct squares in a 3x3 grid, the discussion emphasizes calculating two components: the assignment of tiles to positions and the orientation of each tile. The first part involves assigning the tiles, while the second part considers the rotation of each tile, which can be oriented in four different ways. The final calculation involves multiplying the outcomes of these two parts, leading to a total that is slightly under 10^11 combinations. The poster seeks clarity on the mathematical approach, expressing a lack of comfort with math. Understanding these calculations is essential for effectively programming the brute-force solution in C++.
badluckbrian
Messages
1
Reaction score
0
I'm writing a C++ program to brute-force solve a puzzle, but in order to determine the number of iterations the loop of the program should have (in order to exhaust all possible solutions) I need to know how many possible combinations there are. This isn't homework, I was just intrigued on how to do it.

The puzzle has nine distinct squares which are to be arranged in a 3x3 grid, like one face of a Rubik's cube; any piece can go in any place. However, each piece, being a square, can be rotated in its place to produce a different solution (each edge of the square has a unique "piece" on it that must pair with other edges).

9^9^4 yielded a number that seemed way too big, and 9*9*4 seemed too small. I tried researching the formula, but since I have found every way possible through both high school and college to avoid math, it was lost on me.

tl;dr: how many possible combinations are there for a puzzle like this

http://www.google.com/imgres?imgurl...=pF7iT5ahLc_16gGmtbUI&ved=0CH8Q9QEwBg&dur=630


Thanks to anyone who can give me some help.
 
Mathematics news on Phys.org
Break it into two parts: first, how many ways are there of assigning the tiles to positions in the 3x3 grid? (For simplicity, don't worry about symmetries.)
Having assigned the tiles to positions, how many ways are there of orienting each tile?
The 10 numbers obtained above are independent of each other, so multiply them together.
You should get a number a bit under 10^11.
 
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

  • · Replies 1 ·
Replies
1
Views
8K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
10K
  • · Replies 5 ·
Replies
5
Views
5K
Replies
2
Views
2K
  • · Replies 18 ·
Replies
18
Views
43K