1
$\begingroup$

Two natural numbers $x$ and $y$ are chosen at random with a uniform distribution.Then the question is to find out the probability that $x^2+y^2$ is divisible by $5$ and $7$.

I understand that divisible by $5$ and $7$ is the same thing as divisible by $35$.But I am a bit confused on how to calculate probability on an infinite set.Any help shall be highly appreciated.Thanks.

  • 3
    You need to specify a probability distribution you choose $x$ and $y$ with. Simply saying "at random" does not cut it.2017-02-20
  • 1
    What Henning said. For example, you can specify that $x$ and $y$ are independently chosen from the set of integers from $0$ to $34$, inclusive, **with a uniform distribution**. The catch is that the set of all natural numbers does not have a uniform distribution. Mind you, because we only need to know $x$ and $y$ modulo $35$ to decide whether $x^2+y^2$ is divisible by $35$ this is how I would try and make sense out of the question. But since we decided to insist on having a distribution on an infinite set, let's specify one!2017-02-20
  • 0
    What Henning said. You could get a number by working $\mod 35$ (perhaps working both $\mod 5$ and $\mod 7$ if you're doing calculations without a computer). But that would be a probability for chosing two numbers uniformly from $\mathbb{Z}/35\mathbb{Z}$, not choosing two numbers from $\mathbb{N}$ (which can't be done uniformly).2017-02-20
  • 0
    @lesnik Can you please share with us your method of getting the answer2017-02-21
  • 0
    Note that a number is a sum of two squares iff primes 3 mod 4 appear only to even powers in its prime factorisation. That tells you $x^2+y^2$ must be divisible by $49$, not just $7$.2017-02-21

3 Answers 3

2

First thing to note: you can not just take a "random number with a uniform distribution". My intuition "why not". Imagine you selected a random number. How big would it be? No way it will be less than a million: million is too small compared to infinity. And whatever upper bound you imagine the randomly selected number must be bigger than that. So there is some problem with "uniformly distributed integers". It's just an intuition, but hope it helps.

To fix the text of your problem it's necessary to set up an upper bound for selected numbers. Something like "Two natural numbers x and y are chosen at random with a uniform distribution in a range (0, N). Find the probability that $x^2+y^2$ is divisible by 35 for large N".

Probability that $x≡n \mod 35$ is 1/35. Probability that remainders of $x$ and $y$ when divided by 35 are $n$ and $m$ is $1/35^2$.

I had to write a short program that calculates $(x^2 + y^2) \mod 35$ (which is equal to $(n^2+m^2)\mod 35$) for all 35^2 possible pairs of $(n, m)$. It turned out that there are exactly 5 pairs such that $(n^2 + m^2)$ is divided by 35. So, the answer is $5/35^2$.

Takahiro's approach must be smarter, but I am too slow to follow it :)

1

If $x$ and $y$ are uniformly distributed mod $35$ then both of them are independently uniformly distributed mod $5$ and mod $7$, by the Chinese remainder theorem.

The quadratic residues mod $5$ are $\>0$, $\>1$, $\>-1$, $-1$, $\>1$. The probability that two independently selected of these sum to $0$ mod $5$ is ${1\over5}\cdot{1\over5}+{4\over5}\cdot{2\over5}={9\over25}$.

The quadratic residues mod $7$ are $\>0$, $\>1$, $-3$, $\>2$, $\>2$, $-3$, $\>1$. The probability that two independently selected of these sum to $0$ mod $7$ is ${1\over49}$.

It follows tht the probability in question is ${9\over 25\cdot 49}$.

0

$1^2≡1, 2^2≡4, 3^2≡2, 4^2≡2, 5^2≡4, 6^2≡1 \mod 7$.  Then $x,y$ are multiple of $7$. Since about one's place $1+7^2≡1+9,4^2+7^2≡6+9, 4^2+8^2≡6+4,1^2+8^2≡1+4≡0\pmod5$, these are multiple of 5. Therefore they are 9 patterns of $(0,0)(7,14)(7,21)(14,7)(14,28)(21,7)(21,28)(28,14)(28,21) \pmod{35}$$$\dfrac9{35^2}=0.735\%$$

  • 0
    I've got the same answer, but I do not understand how you get yours.2017-02-20
  • 0
    You cannot answer the question if you do not know how the numbers are randomly selected.2017-02-20
  • 0
    @A.G. I know. But text of the original problem can be easily fixed: just set some big upper bound N for numbers. Then if distribution is uniform the answer would be 1/245. (Well, strictly speaking it will depend from N but close to 1/245). But I do not understand Takahiro's explanation.2017-02-20
  • 0
    @lesnik Whatever you don't understand, I think this is some hint.2017-02-21
  • 0
    Can you please write a bit more explanation.I couldnot follow the answer.2017-02-21