0
$\begingroup$

Its a program that check a sudoku solution if it is correct.

It checks

Rows,collums,3x3 grids if sum is 45 (1+2+3...+9=45)
Rows,collums,3x3 grids numbers in square if sum is 285 (1^2+2^2+3^2+...+9^2 = 285)

Is any way to fool that program with not a valid sudoku solution and make it think that is valid.

  • 0
    There are various vectors with duplicate digits from $1$ to $9$, such that the sum is $45$ and the sum of the squares is $285$, for example $[9,3,6,1,4,9,4,3,6]$. This is no proof that the program can fail, but at least a clear indication2017-01-31

1 Answers 1

2

Using Peters example of a vector that satifies the conditions we can easily construct a "Sudoko" that fools your algorithm

\begin{matrix} 9& 3& 6& 1& 4& 9& 4& 3& 6 \\ 1& 4& 9& 4& 3& 6& 9& 3& 6\\ 4& 3& 6& 9& 3& 6& 1& 4& 9\\ 3& 6& 1& 4& 9& 4& 3& 6& 9\\ 4& 9& 4& 3& 6& 9& 3& 6& 1\\ 3& 6& 9& 3& 6& 1& 4& 9& 4\\ 6& 1& 4& 9& 4& 3& 6& 9& 3\\ 9& 4& 3& 6& 9& 3& 6& 1& 4\\ 6& 9& 3& 6& 1& 4& 9& 4& 3 \end{matrix}