Sum of squares of two integers divisible by five

1k Views Asked by At

Supposing $x,y$ are natural numbers,

what is the probability that the sum of their squares are divisible by 5?

I am getting $1/3$ as squares can only end with $0,1,4,5,6,9$. So $36$ pairs are possible. And $12$ pairs { $(0,0),(1,4),(4,1),(4,6),...$} have sums which end in $...0$ or $...5$.

But the answer is given as $\frac{9}{25}$. Can anyone posit a solution?

3

There are 3 best solutions below

2
On BEST ANSWER

Your approach is nearly correct, the only issue that not all of $\{0, 1, 4, 5, 6, 9\}$ are equally likely: $0$ and $5$ only occur with probability $\frac{1}{10}$ each, the others with $\frac{1}{5}$ each. If you recount, now weighting all of the possible squares modulo $10$ by these probabilities (rather than uniformly by $\frac{1}{6}$, as in your original solution), you should get $\frac{9}{25}$ as desired.

0
On

Those ending digits are not equally probable. The end digit will be $0$ or $5$ only $1/10$ of the time, as there is only one ending digit that results in a square with each of those. End digits of $1,4,6,9$ can result from two different end digits, so they come up $2/10$ of the time. That skews the probabilities.

0
On

Given $x, y$, only the last digits are relevant in determining if $x^2 + y^2$ is divisible by $5$. The last digit can be $0, 1, \ldots, 9$ and all of them are equally likely. Taking the last two digits of $x, y$, we get a sample space of size $10 \times 10 = 100$, where each of them are equally likely.

Now, we count the number of last digit combinations that lead to $x^2 + y^2$ being divisible by 5. The unordered list of pairs is: $$\{ \{0, 0\}, \{0, 5\}, \{1, 2\}, \{1, 3\}, \{1, 7\}, \{1, 8\}, \{2, 4\}, \{2, 6\}, \{2, 9\}, \{3, 4\}, \{3, 6\}, \{3, 9\}, \{4, 7\}, \{4, 8\}, \{5,5 \}, \{6, 7\}, \{6,8\}, \{7, 9\}, \{8, 9\} \},$$ which is $19$ in all. This leads to $17*2 + 2 = 36$ ordered pairs.

Therefore, the probability is $\frac{36}{100} = \frac{9}{25}$.