A certain forest is a perfect square of 1 0 1 × 1 0 1 very thin trees in a square grid. Precisely at the center of the forest one tree is missing. If you stand exactly at that location, you can see many of the trees-- but not all, because trees in the exact same direction overlap.
How many trees can you see from this position?
Assumptions and hints
Regard the trees as infinitely thin. They either eclipse each other completely because they are in the exact same direction, or are visible as separate trees.
If the forest were 1 1 × 1 1 , you could see 80 trees, as shown in this sketch:
1 2 3 4 5 6 7 8 9 10 11 |
|
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.
Great solution!!! What if we extend this from 2D to 3D or higher dimensions? E.g: 1 0 1 × 1 0 1 × 1 0 1 trees? surrounding you in all directions (still in grid form).
Log in to reply
I ran my program for a 3-D forest of 101 x 101 x 101 and found 854,786 visible trees, or 82.96%.
I ran it again for 1001 x 1001 x 1001 trees and found 834,185,090 trees, or 83.17%.
My suspicion is of course that in n dimensions the fraction of visible trees will be P ( n ) = ζ ( n ) 1 , with ζ the Riemann zeta function. It works exactly for n = 2 , and my number comes very close to the known value of 1 / ζ ( 3 ) , the inverse of Apery's constant: ζ ( 3 ) 1 = 1 . 2 0 2 0 5 6 9 0 3 … 1 = 0 . 8 3 1 9 0 7 3 7 …
Indeed, the Wikipedia page about Apery's constant mentions as fact that 1 / ζ ( 3 ) is the probability that three integers are co-prime (which I assume to mean that they have gcd = 1; they need not be pairwise co-prime, e.g. (6, 10, 15) is considered co-prime).
Finally, I checked the four-dimensional case with 101 x 101 x 101 x 101 trees. Now there were 95,957,472 visible, or 92.21%. Compare this to ζ ( 4 ) 1 = π 4 9 0 = 0 . 9 2 3 9 .
Log in to reply
Yes, these limit formulas involving ζ ( k ) 1 are correct... I remember hearing a talk on this topic long ago, without recalling any details (interestingly, Comrade @Pi Han Goh , the proof involved the Mobius function and convolutions). I was looking for a closed formula for a given number of trees, as we have in the 2-D case, but there may not be such a thing since there is no analogue to Euler's totient function, as far as I know.
Good question indeed... I have no idea!
Interesting problem.
I plotted the lower right quadrant of the forest just for interest. I find it interesting how distinctive the prime number appear in this plot. It seams to me that there could likely be other problems that could be imagined with regard to the distribution of the numbers in the solution to this problem. I have considered posting a similar question. Sticking with the forest of trees description, One could stipulate some areas with no trees. perhaps a clear cut area with a given radius around the viewer, clear cut areas of different shapes placed somewhere in the forest, clear cut grid of roads removing entire columns or entire rows in the forest.
Let the center be ( 0 , 0 ) .
A tree ( x 1 , y 1 ) is hidden iff there exists another tree ( x 2 , y 2 ) such that x 1 = k x 2 , y 1 = k y 2 , where k ≥ 2 is a positive integer. In other words, a tree is visible iff the GCD of their coordinates is 1. Now it's straightforward:
1 2 |
|
This is generalized easily to higher dimensions: a lattice point is visible from the origin iff the GCD of all their coordinates is 1.
Call the central position ( 0 , 0 ) , then the forest corresponds to the set { ( x , y ) ∣ − 5 0 ≤ x , y ≤ 5 0 } , and you can see a tree precisely if the ratio x : y cannot be reduced to smaller terms, i.e. if gcd ( ∣ x ∣ , ∣ y ∣ ) = 1 . The implementation is straightforward:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Output:
1 |
|
Note : In this case 6 1 9 2 / 1 0 2 0 0 = 6 0 . 7 0 6 % of the trees are visible As the forest grows bigger, the fraction of visible trees approaches the odds that two arbitrarily chosen integers are coprime. This limiting probability is 6 / π 2 ≈ 6 0 . 7 9 3 % .
I love how Basel problems is relevant here! +1
just for the record, this is the sequence of coprime pairs, OEIS 137243, term 50.
Problem Loading...
Note Loading...
Set Loading...
Interesting problem!
The number of trees we see between due East and due North East (including) is equal to the number of distinct rational numbers on the interval ( 0 , 1 ] with denominator ≤ 5 0 , which is ∑ k = 1 5 0 ϕ ( k ) = 7 7 4 . Thus the total number will be 8 × 7 7 4 = 6 1 9 2 .