1
$\begingroup$

I could really use a talented mathematician's help on this.

In Image #1 I have a $5\times 5$ array with the totals calculated going diagonally. The totals are highlighted in orange and blue with corresponding colored lines showing where the values were obtained. The sums are interwoven - meaning changing one value produces a unique set of totals.

My question is if given only the totals as in Image #2 can the values within the array be recreated. Also this needs to be scaled for example to say a $10\times 10$ array or perhaps more. Without using brute force is there a formula which could accomplish this? Thank you so much in advance. As mentioned by Bram28 this method doesn't give back unique values so what if I constrained it with a third set of sums as in Image #3. Would that work?

Image #1

Image #2

Image #3

  • 1
    You are in the domain called "discrete tomography", a useful group of keywords... (https://en.wikipedia.org/wiki/Discrete_tomography)2017-01-29
  • 3
    The array has $5\cdot 5 = 25$ elements. However, you have only $2 \cdot (5 + 4) =18$ diagonal totals so, no, it is not possible to recreate the source array from just those.2017-01-29
  • 1
    Three comments: 1) As said by @dxiv 18 < 25 and a basic algebraic thumbrule is that you must have at least as many constraints that you have unknowns (in fact you need more because there is a natural redondancy) 2) Thus "reconstruction" cannot be unique but you can minimize the error according to different criteria 3) The fact that you are looking for integers in a small range has hopefuly to be taken into account.2017-01-29
  • 1
    @TonyC After the edit you still have only $23 \lt 25$ constraints, which is not enough to univocally determine $25$ unknowns. And the discrepancy gets worse with increased matrix sizes, for example a $10 \times 10$ has $100$ elements, but you'd only have $48$ constraints.2017-01-29

1 Answers 1

1

As pointed out in the comments, there can be many solutions to a given setup, even if you restrict yourself to digits 0-9. Just for a sanity check, here is another solution to the puzzle you provided:

\begin{array}{|c|c|c|c|c|} \hline 2&2&3&2&1\\ \hline 0&2&1&5&2\\ \hline 1&4&0&6&2\\ \hline 4&0&4&6&3\\ \hline 3&3&5&1&2\\ \hline \end{array}

EDIT

Even adding the sums for the horizontals and the verticals will not guarantee a unique solution (unless, again, we would restrict ourselves to a certain interval (e.g. digits 0-9) ... in that case we could have sums that force everything to be the maximum value, for example). Look at the following:

\begin{array}{|c|c|c|c|c|} \hline 0&1&0&-1&0\\ \hline -1&0&0&0&1\\ \hline 0&0&0&0&0\\ \hline 1&0&0&0&-1\\ \hline 0&-1&0&1&0\\ \hline \end{array}

Notice that if we add this matrix to any one solution, we will get another solution!

For example, if we take your original solution:

\begin{array}{|c|c|c|c|c|} \hline 2&1&2&3&1\\ \hline 1&2&5&4&1\\ \hline 2&1&1&4&4\\ \hline 2&0&5&5&2\\ \hline 3&5&4&2&2\\ \hline \end{array}

and we add the 'change' array to it, we get:

\begin{array}{|c|c|c|c|c|} \hline 2&2&2&2&1\\ \hline 0&2&5&4&2\\ \hline 2&1&1&4&4\\ \hline 3&0&5&5&1\\ \hline 3&4&4&3&2\\ \hline \end{array}

we get another solution with the exact same sums for the diagonals, verticals, and horizontals!

  • 0
    Thank you Bram28 you are correct i missed that. Look at the updated post. If I constrained it with a third set of sums would that work?2017-01-29
  • 0
    @TonyC. Look at dxiv's comment: you have 25 unknowns, so without any further restrictions on the kinds of values are legal, you would need 25 or more of these sums to guarantee a unique solution. With the 5 you added, you are still only at 23. And by the way, what are these red sums the sum of?2017-01-29
  • 0
    The red totals are the sums going down vertically. Even if not possible to recreate I would think using the 3 colored (red,orange and blue) sums would recreate only unique array? Am I wrong?2017-01-29
  • 0
    @TonyC. If we restrict ourselves to digits 0-9 only, maybe these 23 sums are enough to guarantee a unique solution ... I'd have to see. But again, in general you'd really need 25 or more sums. Why not add the sum of the horizontals in red on the right?2017-01-29
  • 0
    I could add them horizontally but it would still only be a third axis of sums2017-01-29
  • 0
    @TonyC. But you would have 28 sums, so that might be enough to guarantee a unique solution. In fact, I think it will.2017-01-29
  • 0
    @TonyC. No, I take that back. Even with the horizontals added you are not guaranteed a unique solution! See addendum to my Answer.2017-01-29
  • 0
    So you're saying there's a chance - lol ARGH!! Thank you all though for your time - it's been educational.2017-01-29