5. A student drew an empty $50 \times 50$ table and wrote a number above each column and to the left of each row. It turned out that all 100 written numbers are distinct, with 50 of them being rational and 50 being irrational. Then, in each cell of the table, he wrote the product of the numbers written next to its row and its column (as in a multiplication table). What is the maximum number of products in this table that could be rational numbers?
Solution. We will show that there are no fewer than 1225 irrational numbers in the table. Suppose that among the rational numbers there is zero, and it is written on the upper side of the table.

Let along the left side of the table there be $x$ irrational and $50-x$ rational numbers. Then along the upper side, there are $50-x$ irrational numbers and $x$ rational numbers, including 0. Note that the product of a non-zero rational and an irrational number is always irrational. Therefore, in the table, there are at least $x(x-1)+(50-x)^{2}$ irrational numbers. Consider the function $f(x)=x(x-1)+(50-x)^{2}=2 x^{2}-101 x+2500$. The vertex of the parabola $f(x)$ is at the point with abscissa $\frac{101}{4}=25.25$, so the minimum value of $f(x)$ at an integer point is achieved at $x=25$ and it is equal to $25 \cdot 24+25^{2}=1225$.

If we replace zero with a non-zero rational number, the number of irrational numbers will only increase. Therefore, in the table, there are at least 1225 irrational numbers in any case. This means that in the table there are no more than $2500-1225=1275$ rational numbers.

It remains to provide an example of a table with 1275 rational numbers. If along the left side we write the numbers $1,2, \ldots, 24,25, \sqrt{2}, 2 \sqrt{2}, \ldots, 24 \sqrt{2}, 25 \sqrt{2}$, and along the upper side we write the numbers $0,26,27, \ldots, 49,26 \sqrt{2}, 27 \sqrt{2}, \ldots, 50 \sqrt{2}$, then the only irrational numbers will be $25 \cdot 24+25^{2}=1225$ products of non-zero rational and irrational numbers. Answer: 1275.