# Possible configurations in a 5*5 square matrix

I noticed a building outside my house with randomly lit rooms and dark rooms. If I treat each one of those windows as a square, is it possible to calculate the total number of patterns that can be created by illuminated rooms. Say there are 25 windows in total. (5*5) I don't know if I'm being articulate enough with my problem.

I tried using Combinations, but I'm not sure how to approach it properly.

In a 2*2 matrix, the number of patterns that can be created is 12.(Including the pattern where none of the rooms are lit). I calculated this without using a formula, just by logic. Is there a simple method I can use to find out a similar answer to a 5*5 square, without using a computer simulation?

If computer simulations are to be used, how would one go about solving this, and what is the principle involved in this kind of simulation?

• Why 12 and not 16. If you have two choices for each window (light, dark), the total number of patterns is 2^4=16 – Robin Nicole Mar 16 at 18:08
• Ignoring symmetries, there are $2^{25}$ possibilities, every square can be dark or light. – Peter Mar 16 at 18:09
• How do we know that the total number of configurations is given by squaring "number of choices" with the "total number of squares". Also, what exactly do you mean by ignoring symmetries? – Metal Maniac Mar 17 at 6:52
• nobody is squaring anything. They are simply raising the number of possible states of each square to the number of squares. – Roddy MacPhee Mar 17 at 15:04

Here's how people get their formulae, with an example,the following is a set of things:

$$\{a,b,c,d,e\}$$

Lets use exponents to represent the value of the state a given element is in (two states in your example for each, lets do the same for mine using 0 and 1), we then have the following combinations: $$\begin{equation*}a^0b^0c^0d^0e^0\\a^0b^0c^0d^0e^1\\a^0b^0c^0d^1e^0\\a^0b^0c^0d^1e^1\\a^0b^0c^1d^0e^0\\a^0b^0c^1d^0e^1\\a^0b^0c^1d^1e^0\\a^0b^0c^1d^1e^1\\a^0b^1c^0d^0e^0\\a^0b^1c^0d^0e^1\\a^0b^1c^0d^1e^0\\a^0b^1c^0d^1e^1\\a^0b^1c^1d^0e^0\\a^0b^1c^1d^0e^1\\a^0b^1c^1d^1e^0\\a^0b^1c^1d^1e^1\\a^1b^0c^0d^0e^0\\a^1b^0c^0d^0e^1\\a^1b^0c^0d^1e^0\\a^1b^0c^0d^1e^1\\a^1b^0c^1d^0e^0\\a^1b^0c^1d^0e^1\\a^1b^0c^1d^1e^0\\a^1b^0c^1d^1e^1\\a^1b^1c^0d^0e^0\\a^1b^1c^0d^0e^1\\a^1b^1c^0d^1e^0\\a^1b^1c^0d^1e^1\\a^1b^1c^1d^0e^0\\a^1b^1c^1d^0e^1\\a^1b^1c^1d^1e^0\\a^1b^1c^1d^1e^1\end{equation*}$$

Which has $$32=2^5$$ states in your case you have $$2^{25}=33,554,432$$ states, assuming rotations, reflections, and translations aren't considered duplicates.

• So if each variable had three different possible states, then the answer would be 3^25? – Metal Maniac Mar 20 at 14:24
• yes, and in the general case $n^{25}$ for n possible states. This doesn't account for rotations reflection etc. in higher dimensions. – Roddy MacPhee Mar 20 at 14:27
• That's why the ignoring symmetries was in a comment. – Roddy MacPhee Mar 20 at 14:30