# What is the solution to this algebra problem?

There is a $$~10\times 11~$$ grid with real numbers, the number $$~N_{xy}~$$ is equal to the sum of all the numbers in the column $$~y~$$ multiplied by the sum of all the numbers in the row $$~x~$$, all numbers in the grid have the same condition than $$~N_{xy}~$$.

$$1-~$$ How much is the sum of all the numbers in the grid?

$$2-~$$ Give a grid with all the numbers being different.

I know the answer to the first question which is $$~1~$$, since a grid with all the numbers being $$~\frac{1}{110}~$$ will work.

I made a program in $$~C^{++}~$$ to give solutions to analogous $$~2\times 2~$$ grids by brute force but I don't see any pattern.

What is the answer to the second question?

I don't need $$~110~$$ numbers, just give a general solution to this kind of grids with all the numbers being different from each other.

• Your Nxy is not correct. Assuming there are $10$ rows of $11$ elements the row sum is $\frac 1{10}$, the column sum is$\frac 1{11}$, so $Nxy=\frac 1{110}$ – Ross Millikan Aug 8 '19 at 4:23
• Just to verify what you ask: You require $N_{xy} = (\sum_{i=1}^{10} N_{iy}) \cdot (\sum_{j=1}^{11} N_{xj})$? If so, assume that all $N_{xy} = a$. Then $a = 110a^2$ which results in the solutions $a = 0$ or $a = 1/110$. – Paul Frost Aug 8 '19 at 8:04
• Are you trying to find the numbers in the grid from the $N_{xy}$'s for 1? For 2, do you just want a set of numbers so that all the $N_{xy}$'s are different? – Ross Millikan Aug 8 '19 at 23:38
• i just want a set of numbers in the grid (Nxy's) that are all different – Sartem Cacartem Aug 9 '19 at 2:33

Let's consider, in general, a $$m\times n$$ grid. If $$x_{11}$$, $$x_{12}$$, $$\dots$$ $$x_{mn}$$ are the numbers in the grid, $$R_i=\sum_{j=1}^n x_{ij}$$ is the sum of numbers in $$i$$-th row and $$C_j=\sum_{i=1}^m x_{ij}$$ is the sum of numbers in $$j$$-th column, then the problem states that: $$\tag{*} x_{ij}=R_iC_j.$$ But $$R_i=\sum_{j=1}^n x_{ij}=\sum_{j=1}^n R_iC_j=R_i\sum_{j=1}^n C_j,$$ hence $$\sum_{j=1}^n C_j=1$$ and an analogous result holds for the rows: $$\sum_{i=1}^m R_i=1$$ (which also means that the sum of all numbers $$x_{ij}$$ is $$1$$).

On the other hand, if we can find $$m+n$$ real numbers $$R_1\dots R_m$$ and $$C_1\dots C_n$$ such that $$\sum_{i=1}^m R_i=1$$ and $$\sum_{j=1}^n C_j=1$$, then numbers $$x_{ij}$$ computed from $$(*)$$ will automatically satisfy all the conditions of the problem. If we want all $$x_{ij}$$ to be different among them, we must make sure that no two products $$R_iC_j$$ are the same.

Let's make an example with a $$3\times3$$ grid ($$m=n=3$$). We can take for instance: $$R_1={1\over7},\ R_2={2\over7},\ R_3={4\over7};\quad C_1={1\over5},\ C_2={3\over10},\ C_3={1\over2}.$$ The resulting grid is then $$\matrix {1/35 & 3/70 & 1/14 \\ 2/35 & 3/35 & 1/7 \\ 4/35 & 6/35 & 2/7 \\ }$$ and you may check that it works.

Another example with negative numbers: take $$7$$, $$5$$, $$-11$$ as row sums, and $$2$$, $$3$$, $$-4$$ as column sums to get: $$\begin{array}{r r r} 14 & 21 & -28 \\ 10 & 15 & -20 \\ -22 & -33 & 44 \\ \end{array}$$

Why couldn''t Nxy be $$110$$ with $$1$$ in every cell? There is no answer to the first question because if you have a solution with $$Nxy=z$$ you can multiply every cell by $$k$$ and have a new solution with $$Nxy=k^2z$$

For the second question, you can fill the first $$9 \times 10$$ part of the grid almost any way you want. Now pick a row sum and you can fill in the last element in each row to make it work. Assuming the $$10$$ is the number of rows, the column sum has to be $$\frac {10}{11}$$ times the row sum because adding all the rows has to equal adding all the columns. Given that column sum you can find all the remaining numbers. The only way this fails is if two numbers match. Perturb a number and try again.

• this answer supposes that Nxy is just one number, but all the numbers in the grid, are the sum of the numbers in their column, multiplied by the sum of the numbers in their row – Sartem Cacartem Aug 8 '19 at 21:26