Don't Cross A Corner!

On an n × n n \times n square grid, two vertices are chosen at random and a segment is drawn connecting them. As n , n\rightarrow \infty, what is the probability that the segment does not cross any vertices of this graph besides the two chosen ones?


The answer is 0.60792710185.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Jason S
Oct 2, 2017

Relevant wiki: Basel Problem

For the segment not to cross any other vertices it means that the difference in x x and y y coordinates of the two vertices are coprime. Therefore, we are looking for the probability that two natural numbers chosen at random are coprime, i.e. they don't have prime factors in common. By notting that 1 in 2 numbers has 2 as a factor, 1 in 3 numbers has 3 as a factor, 1 in 5 numbers has 5 as a factor, etc... we can write the probability as

P { a , b coprime } = ( 1 1 2 2 ) ( 1 1 3 2 ) ( 1 1 5 2 ) = p prime ( 1 1 p 2 ) \displaystyle P\{a,b \text{ coprime} \}= \left(1-\frac{1}{2^2}\right)\left(1-\frac{1}{3^2}\right)\left(1-\frac{1}{5^2}\right) \cdot \ldots = \prod_{p \text{ prime}} \left(1 - \frac{1}{p^2} \right)

But the right hand size is just 1 ζ ( 2 ) = 6 π 2 0.60792 \frac{1}{\zeta(2)} = \frac{6}{\pi^2} \approx 0.60792 by the Euler product formula for the Riemann zeta function.

There is no probability that two numbers are coprime, just as there is no probability that a randomly chosen number is even. There are countably many even integers, exactly the same as the number of all integers, and there is no meaning to trying to divide infinity by itself.

Looked at another way, your argument implies that all integers are equally likely to be chosen, and hence that there is a uniform distribution on the set of integers. This cannot exist: if each integer had the same probability p p of occurring, the sum of an infinite number of copies of p p would have to be equal to 1 1 , which is not possible.

What you can say is that the limit as N N tends to infinity of the probability that a number randomly and uniformly chosen from N -N to N N is even is 1 2 \tfrac12 . Similarly, and this is what the question seeks, you can say that the limit as x x tends to infinity of the probability that two numbers chosen independently and uniformly from x -x to x x are coprime is 6 π 2 \tfrac{6}{\pi^2} . This last number is not, however, a probability.

Mark Hennings - 3 years, 8 months ago

Log in to reply

Well, it is the limit of a probability, though

Agnishom Chattopadhyay - 3 years, 8 months ago

Log in to reply

Yes, of course. That is what the question asked for. The fact that the answer is not itself a probability does make it a little difficult to write down the infinite product as justified here.

Mark Hennings - 3 years, 8 months ago

I don't get it. If n -> ∞, then one of the vertices can always be used as the origin (0, 0) & we have a line Y = (b/a)X, where b/a is the slope (w/ both a & b being integers). So the question becomes: for equation aY = bX, are there integer solutions of X & Y (besides X = a; Y = b)? The answer: there are infinitely many such solutions. So the prob that the line doesn't cross any vertices is ZERO.

weiming zheng - 3 years, 8 months ago

Log in to reply

You need to look for finite line segments that have no integer coordinates except at their endpoints. You are thinking of infinite lines...

Mark Hennings - 3 years, 8 months ago

Log in to reply

Oops. Yeah, it's about segments, not lines. Thank!

weiming zheng - 3 years, 8 months ago

Well, no. In at least one case, where the terminus is in the adjacent line, the connecting line cannot cross any vertices since there are none between two adjacent lines. Hence the probability that the line doesn’t cross any vertices must be nonzero since there is at least one case. Similarly, where the terminus is at the furthest from the origin (x or y = n) the connecting line will intersect every vertices and there is at least one case where the probability is 1. Since every other terminus will be less than n, their probability must be less than one and the probability of an intersection between randomly selected points is less than 1. A good, if rough approximation of the probability of intersecting a vertices between any two randomly selected points is sine (45) or 1/sqrt(2) or about 0.7.

Donald Zacherl - 3 years, 6 months ago
Mark Hennings
Sep 26, 2017

Relevant wiki: Euler's Totient Function

Since m x ϕ ( m ) = m x d m μ ( d ) m d = d x μ ( d ) m x d m = d x μ ( d ) ( x 2 2 d 2 + O ( x d ) ) = 1 2 x 2 d x μ ( d ) d 2 + O ( x ln x ) = 1 2 x 2 d = 1 μ ( d ) d 2 1 2 x 2 d > x μ ( d ) d 2 + O ( x ln x ) = x 2 2 ζ ( 2 ) + O ( x ln x ) \begin{aligned} \sum_{m \le x} \phi(m) & = \; \sum_{m \le x} \sum_{d|m} \mu(d) \tfrac{m}{d} \; = \; \sum_{d \le x} \mu(d)\sum_{m \le \frac{x}{d}} m \; = \; \sum_{d \le x} \mu(d)\left(\tfrac{x^2}{2d^2} + O\big(\tfrac{x}{d}\big) \right) \\ & = \; \tfrac12x^2 \sum_{d \le x} \frac{\mu(d)}{d^2} + O(x \ln x) \; = \; \tfrac12x^2 \sum_{d=1}^\infty \frac{\mu(d)}{d^2} - \tfrac12x^2 \sum_{d > x}\frac{\mu(d)}{d^2} + O(x\ln x) \\ & = \; \frac{x^2}{2\zeta(2)} + O(x\ln x) \end{aligned} as x x \to \infty , the probability that two randomly chosen integers in 1 , 2 , 3 , . . . , x 1,2,3,...,x are coprime is 2 x 2 m x ϕ ( x ) = 1 ζ ( 2 ) + O ( ln x x ) x \tfrac{2}{x^2}\sum_{m \le x}\phi(x) \; = \; \tfrac{1}{\zeta(2)} + O\big(\tfrac{\ln x}{x}\big) \hspace{2cm} x \to \infty Since nonzero a , b a,b in x , x + 1 , . . . , x 1 , x -x,-x+1,...,x-1,x are coprime if and only if a , b |a|, |b| in 1 , 2 , . . . , x 1,2,...,x are coprime, and a , b a,b are never coprime if either a a or b b is zero, this is also (at least asymptotically as x x \to \infty ) the probability that two randomly chosen integers in x , x + 1 , . . . , x 1 , x -x,-x+1,...,x-1,x are coprime. Thus the desired limit is ζ ( 2 ) 1 = 6 π 2 \zeta(2)^{-1} = \boxed{\tfrac{6}{\pi^2}} .

Gopal Narayanan
Oct 4, 2017

We need to find 2 integers which are relatively prime.

Boi (보이)
Oct 1, 2017

Relevant wiki: Euler's Totient Function

I didn't know anything about how to solve Euler function's sum, so I just

and divided by 10000 0 2 2 \dfrac{100000^2}{2}

:D

wolframalpha is great!

Krishna Deb - 3 years, 8 months ago

Log in to reply

I know, right? x'D

Boi (보이) - 3 years, 8 months ago

I finally realised that I needed lim (sum phi ( j) / j divided by n) but didn't know how to proceed, so I used hand calculator for n=20 and got .6236, for which Brilliant generously gave me credit. Jason and Mark's answers are much better. Great problem!

John Winkelman - 3 years, 8 months ago

What would be the formula for n instead of n approaching infinity?

Tomasz Bukowy - 3 years, 8 months ago

Log in to reply

I dunno, I only thought about n n approaching infinity, so...

Boi (보이) - 3 years, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...