# Math Help - Matrix / Numerical Grids

1. ## Matrix / Numerical Grids

Hi everyone,

Firstly, apologies if this is in the wrong section (or forum!). I had a look around and this seemed the likeliest place to put my question, though I'm not so much "pre-Algebra" as "severely post-Uni, recreational mathematician".

I have a few questions which come from years of playing matrix-based games like Sudoku and whatnot; bear with me as I try to word them properly. This is where I started:

Assume a 2 x 2 grid of unknown values as follows:

$\begin{matrix}a & b \\ c & d \end{matrix}$

Also assume you've been given the values for the total of each column, each row, and the two diagonals:

$a + b = R_1\\\indent c + d = R_2\\\indent a + c = C_1\\\indent b + d = C_2\\\indent a + d = D_1\\\indent b + d = D_2\\$

Pretty basic so far, right? Good. To find the value of a:

$((a + c) + (a + d) - (c + d)) = C_1 + D_1 - R_2\\\indent 2a + c + d - (c + d) = C_1 + D_1 - R_2\\\indent 2a = C_1 + D_1 - R_2\\\indent a = \frac{1}{2}(C_1 + D_1 - R_2)$

Given a, we can now solve for b, c and d. I've tried this a few times on paper (and on my computer), and it seems to hold true. So far, so good.

So then I decided to take it up a level: a 3 x 3 grid

$\begin{matrix}a&b&c \\ d&e&f \\ g&h&i \end{matrix}$

I won't write out all the equations; suffice it to say, you have values R1, R2, R3, C1, C2, C3, and the sums of the two diagonals, D1 and D2, to work with.
Using what little I remembered of my University mathematics classes, I tried to "solve" this grid with an 8 x 9 matrix and ended up, almost by accident, finding the value of e...

$e = \frac{1}{3} (R_2 + D_1 + D_2 - C_1 - C_3)$

...which, again, has held true when I've tested it on paper and on my computer. Somewhere along the way I also managed to solve for a, but I can't seem to find that particular set of equations.

So, my questions are:

1. Is it possible to solve for *any* value in the grid? In the 3 x 3 example, having solved for both a and e, I could solve for i, but what of the others?
2. Are these solutions applicable to larger grids? I stopped at 3x3 (it gave me a headache). What about, for example, a regular Sudoku-sized 9x9 square?
3. Is there a formula (or a set of formulae) for solving these sorts of grids, or maybe a website or Wiki article on the topic?

Hopefully this makes sense to someone... thanks in advance for any help or information you might have.

Cheers

2. ## Re: Matrix / Numerical Grids

Originally Posted by antivisor
Hi everyone,

Firstly, apologies if this is in the wrong section (or forum!). I had a look around and this seemed the likeliest place to put my question, though I'm not so much "pre-Algebra" as "severely post-Uni, recreational mathematician".

I have a few questions which come from years of playing matrix-based games like Sudoku and whatnot; bear with me as I try to word them properly. This is where I started:

Assume a 2 x 2 grid of unknown values as follows:

$\begin{matrix}a & b \\ c & d \end{matrix}$

Also assume you've been given the values for the total of each column, each row, and the two diagonals:

$a + b = R_1\\\indent c + d = R_2\\\indent a + c = C_1\\\indent b + d = C_2\\\indent a + d = D_1\\\indent b + d = D_2\\$

Pretty basic so far, right? Good. To find the value of a:

$((a + c) + (a + d) - (c + d)) = C_1 + D_1 - R_2\\\indent 2a + c + d - (c + d) = C_1 + D_1 - R_2\\\indent 2a = C_1 + D_1 - R_2\\\indent a = \frac{1}{2}(C_1 + D_1 - R_2)$

Given a, we can now solve for b, c and d. I've tried this a few times on paper (and on my computer), and it seems to hold true. So far, so good.

So then I decided to take it up a level: a 3 x 3 grid

$\begin{matrix}a&b&c \\ d&e&f \\ g&h&i \end{matrix}$

I won't write out all the equations; suffice it to say, you have values R1, R2, R3, C1, C2, C3, and the sums of the two diagonals, D1 and D2, to work with.
Using what little I remembered of my University mathematics classes, I tried to "solve" this grid with an 8 x 9 matrix and ended up, almost by accident, finding the value of e...

$e = \frac{1}{3} (R_2 + D_1 + D_2 - C_1 - C_3)$

...which, again, has held true when I've tested it on paper and on my computer. Somewhere along the way I also managed to solve for a, but I can't seem to find that particular set of equations.

So, my questions are:

1. Is it possible to solve for *any* value in the grid? In the 3 x 3 example, having solved for both a and e, I could solve for i, but what of the others?
2. Are these solutions applicable to larger grids? I stopped at 3x3 (it gave me a headache). What about, for example, a regular Sudoku-sized 9x9 square?
3. Is there a formula (or a set of formulae) for solving these sorts of grids, or maybe a website or Wiki article on the topic?

Hopefully this makes sense to someone... thanks in advance for any help or information you might have.

Cheers
Hi antivisor,

In the 2 x 2 case you have four unknowns (a,b,c and d) and six equations. So you can obtain values for the four unknowns. But in the 3 x 3 case you have nine unknowns and only eight equations. So you cannot obtain values for all the unknowns, a,b,c,d,e,f,g,h and i. Similarly I hope you can think about the 9 x 9 case.