9

Two natural numbers $x$ and $y$ are chosen at random. Find the probability that $x^2 + y^2$ is divisible by 10.

I could not understand how select two numbers from any natural number (infinite).

Eric
  • 623

4 Answers4

18

Your question seems to be more about the correctness of the problem in the first place.

The problem is incorrectly posed. There is no sample space and probability distribution that would make this problem "well posed".

Rather, without warning, what is happening here is different. These problems, without you being told, mean the following:

FIRST, take a very large $N$ and solve the problem for natural numbers picked from $0$ to $N$. Compute the probability, call it $p_N$. Then compute the limit of $p_N$ as $N \to \infty$.

You may be able to solve the problem for $N$ of the form $10k + 9$ (so the number of natural numbers from $0$ to $N-1$ is a multiple of $10$). In that case the answer may actually not depend on $N$. If you don't fuss about all the details, you may claim that that's the answer.

  • Can you please provide me the calculation – a25bedc5-3d09-41b8-82fb-ea6c353d75ae Dec 12 '16 at 03:54
  • @EricTowers I misread as "integers". I will edit accordingly. –  Dec 12 '16 at 15:01
  • While solving with a specific N, you can cut some corners by estimating the probability instead - assuming that any number from 10k to N does / does not produce 10-divisible number in the end eventually for upper / lower bounds. These bounds would converge with N going to infinity. For this particular task benefit is negligible, if any, but for similar tasks it may be more fruitful. – Daerdemandt Dec 12 '16 at 16:52
  • @Daerdemandt - that is what I meant about "if you don't fuss about all the details." It seemed to me the original question was about the meaning of the problem, rather than the exact solution once the precise meaning is clarified. Indeed, for $N-1$ divisible by $10$ the problem is easy to solve, and for $p_N$ for $N-1$ between successive multiples of $10$ you can find lower and upper bounds that converge to the same (constant) value found for $N-1$ multiple of $10$. Those are the "details" I had in mind. –  Dec 12 '16 at 17:12
16

We need to analyze how likely is it that $$ x^2+y^2\equiv0 \mod 10\hspace{2cm}(\star) $$ holds. First note that if it holds for some pair $(x,y)$ then it will hold for $(x+10k,y+10j)$, so we might restrict ourselves to the case $0\leq x,y<10$ and the probability we are looking for is $$ p=\frac{\#\{(x,y):(\star)\text{ and }0\leq x,y<10\}}{\#\{(x,y):0\leq x,y<10\}}. $$ The denominator is clearly $100$. To compute the quantity in the nominator note that $$ (0^2,1^2,2^2,3^2,4^2,5^2,6^2,7^2,8^2,9^2)\mod10=(0,1,4,9,6,5,6,9,4,1). $$ In how many ways can you add two entries of the RHS so that the resulting sum is $0$ or $10$? That is the number we are looking for. It might seem too tedious at first but notice that in order for $a+b$ to be even $a$ and $b$ must have the same parity. Having this into account you should easily find that there are $18$ such ways and so that $$ p=\frac{18}{100}=\frac{9}{50}. $$


Edit: [There seems to be some concerns about my answer as it doesn't explicitly address the well-posed issue of the question, so let's be more rigorous:]

As it has been noted by the OP, the first inconvenient one faces with this problem is that we don't know how to pick (with a uniform distribution) a random number in an infinite set like $\mathbb{N}$. The usual way to bypass this is to first solve the problem with the additional restrictions $x,y\in\{0,\ldots,n-1\}$ to get $$p_n=\frac{\#\{(x,y):(\star)\text{ and }0\leq x,y<n\}}{\#\{(x,y):0\leq x,y<n\}},$$ and then (if it exists) take $p_\infty:=\lim_{n\to\infty}p_n$ as the answer. Let's compute $p_n$ then:

It will suffice to compute $p_n$ for $n\geq 10$, so we can write $n=10d+r$ for some $d>0$ and some $0\leq r<10$. Calling $$ N_{j,k}=\#\{(x,y):(\star)\text{ and }10j\leq x<10(j+1),\,10k\leq y<10(k+1)\} $$ we have that $$ (\ast)\,\,\,\,n^2p_n=\underbrace{\#\{(x,y):(\star)\text{ and }\left[10d\leq x<n\text{ or }10d\leq y<n\right]\}}_{=:R}+\sum_{0\leq j,k<d}N_{j,k}. $$ Calculating $R$ explicitly promises to be really tedious, but we can easily bound it; $$ R\leq\sum_{l=0}^{d-1}N_{l,d}+N_{d,d}+\sum_{l=0}^{d-1}N_{d,l}. $$ Now the key point (as you had probably noticed already) is that, exactly by the same argument that the first version of this answer, we have $N_{j,k}=18$ for every pair of indexes $j,k$. Carrying this to $(\ast)$ we obtain $$ 0\leq p_n-\frac{18 d^2}{n^2}=\frac{R}{n^2}\leq\frac{18(2d+1)}{n^2}, $$ which writing $d$ as $d=\lfloor\frac{n}{10}\rfloor$ and taking limits as $n\to\infty$ lets us conclude $$p_\infty=\frac{18}{100}.$$

  • Can you please explain without the term mod – a25bedc5-3d09-41b8-82fb-ea6c353d75ae Dec 12 '16 at 03:52
  • 2
    $x\equiv y\mod m$ means that $x=y+mk$ for some $k\in\mathbb{Z}$. One could translate this answer using this so that the result does not use modular arithmetic, but honestly learning modular arithmetic would be a better use of your time (and quicker). –  Dec 12 '16 at 03:58
  • Just count them. You might separate the cases $x=0,1,2,\ldots,9$ and you'll find that there are $1$ way for $x=0,5$ and $2$ ways for the other values of $x$. –  Dec 12 '16 at 04:06
  • Your assumption on how numbers are picked seems to work fine with task author's but it should be noted that problem does not supply sufficient information to be solved. One could say 50% chance for 15 and 50% chance for 375 and get different result. – Daerdemandt Dec 12 '16 at 16:46
  • @chx This is a classic type of problem in probability so I was assuming what I thought was a obvious interpretation. I guess the OP accepted this answer because it was of more help to he/she. As an aside, you seem to be implying that, as opposed to mathguy's answer, mine is not correct just because I didn't make explicit the interpretation of the sample space or because I didn't argue that the result is actually the same that the one mathguy would have gotten if he would have finished the calculations... I can make mistakes like everybody, but you should think twice how you say some things... –  Dec 12 '16 at 18:14
  • Oh sorry. I will delete the comment. I didn't mean to offend you. Perhaps the two answers could / should be merged? – chx Dec 12 '16 at 19:03
  • @chx Sorry, maybe I got too carried away. I have just edited my answer, I hope It suffices to address your initial concerns, which I guess were not only yours.. –  Dec 12 '16 at 21:03
  • 1
    Fantastic, thanks. – chx Dec 12 '16 at 21:18
9

You are partially right, and partially wrong.

It is impossible to define a uniform probability distribution on the natural numbers (i.e. one where each number has an equal probability of selection).

It is, however, possible to define non-uniform probability distributions on the sample space of all natural numbers. For example, roll a die until you roll a 6, and count how many rolls it took.

For the purpose of this question, you have to kind of take the position of "if there was a uniform distribution over $\mathbb{N}$, and you selected two numbers at random from it, what would be the probability of this property?", which does have a meaningful interpretation - take the sequence of distributions $U_n \sim \mbox{Uniform}(n)$, i.e. where the probability that $U_n = k$ for $k \in \{1, \ldots, n\}$ is $\frac{1}{n}$. Then take two draws $x_n$ and $y_n$ from $U_n$, and consider the probability that $x_n^2 + y_n^2$ is divisible by 10.

Then, consider what happens in the limit as $n \rightarrow \infty$. Does that probability converge to some fixed value? In fact, can you cheat and do the calculation as if the uniform distribution over the naturals existed in the first place? As in, if you do the calculation with $Prob(U_\infty = k) = \frac{1}{\delta}$ for an infinitesimal $\delta$, do all the $\delta$s drop out to give you something vaguely meaningful in the end? The answer is yes, and it's what the other answers to this question are leading you to.

(It would not be guaranteed that the probability would be the same for an arbitrary probability distribution over the natural numbers, which is why you have to assume the somewhat degenerate distribution I described exists.)

ConMan
  • 24,300
3

Its simple logic. Count numbers on the basis of last digits whose sum of square makes 0.

So Favourable cases = {(0,0),(1,3),(1,7),(2,4),(2,6),(3,1),(3,9),(4,2),(4,8),(5,5),(6,2),(6,8),(7,1),(7,9),(8,4)(8,6),(9,3),(9,7)} = 18

Total cases = Value of x can be any digit from 0 to 9. Similarly for y.

$= 10 * 10 = 100$

$Probability = \frac{\text{No. of favourable cases}}{\text{Total no. of cases}}$

$= \frac{18}{100} = \frac{9}{50} $