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

  • Thread starter Thread starter badluckbrian
  • Start date Start date
  • Tags Tags
    Combination
AI Thread 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.
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top