[Math] the probability that $x^4-y^4$ is divisible by 5

combinatoricselementary-number-theoryprobability

Two numbers $x$ and $y$ are chosen at random without replacement from the set $\{1,2,3…,5n\}$.

What is the probability that $x^4-y^4$ is divisible by $5$?

I divided the numbers into groups of 5 $(1,2,3,4,5),(6,7,8,9,10),…$.The probability in the first group would itself be the answer.But how to find that?

Best Answer

Hint: If $x \equiv 0\pmod{5}$, then $x^4 \equiv 0\pmod{5}$. If $x \not\equiv 0\pmod{5}$, then $x^4 \equiv 1\pmod{5}$ by Fermat's Little Theorem.

Alternatively, if you don't know modular arithmetic, you can do the following to get the same result.

If $x = 5q+r$ for some integers $q$ and $r$ with $0 \le r \le 4$, then we have $x^4 = (5q+r)^4$ $= 625q^4+500q^3r+150q^2r^2+20qr^3+r^4$ $= 5(125q^4+100q^3r+30q^2r^2+4qr^3)+r^4$ where $r^4$ is one of $\{0, 1, 16, 81, 256\}$. Thus, if $x$ is divisible by $5$, then so is $x^4$, and if $x$ is not divisible by $5$, then $x^4$ is one more than a multiple of $5$.

Hence, $x^4-y^4$ is divisible by $5$ iff $x$ and $y$ are both divisible by $5$ or both not divisible by $5$.

Here is how to finish the problem in case you are still stuck:

There are $5n(5n-1)$ total ways to choose $x$ and $y$ without replacement. There are $n(n-1)$ ways to choose $x$ and $y$ without replacement such that both are divisible by $5$, and there are $4n(4n-1)$ ways to choose $x$ and $y$ without replacement such that both are not divisible by $5$. Hence, the probability that $x^4-y^4$ is divisible by $5$ is $\dfrac{n(n-1)+4n(4n-1)}{5n(5n-1)} = \dfrac{17n-5}{25n-5}$.