Hyper-intriguing Ornament II

Geometry Level pending

Consider a hyper-ball x 2 + y 2 + z 2 + w 2 25 x^2 + y^2 + z^2 + w^2 \leq 25 and a concentric hyper-cube [ 3 , 3 ] 4 \left[-3,3 \right]^4 . What percentage of the (hyper) volume of the hyper-ball resides within the hyper-cube? Round your answer to the nearest integer.

Here is Hyper-intriguing Ornament I .


The answer is 42.

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.

3 solutions

Another brute force:

NIntegrate [ Boole [ w 2 + x 2 + y 2 + z 2 25 ] , { x , 3 , 3 } , { y , 3 , 3 } , { z , 3 , 3 } , { w , 3 , 3 } ] \text{NIntegrate}\left[\text{Boole}\left[w^2+x^2+y^2+z^2\leq 25\right],\{x,-3,3\},\{y,-3,3\},\{z,-3,3\},\{w,-3,3\}\right] is 1280.94538849 1280.94538849 .

π d / 2 r d Γ ( d 2 + 1 ) \frac{\pi ^{d/2} r^d}{\Gamma \left(\frac{d}{2}+1\right)} is 625 π 2 2 \frac{625 \pi ^2}{2} is 3084.251375340424 3084.251375340424 . The result of the division is 0.415318089418 0.415318089418 .

Steven Chase
Dec 29, 2018

I will post a solution based on Monte Carlo integration, because it is wonderfully simple conceptually, albeit computationally intensive. Here is the process:

1) Populate many points (like ten million) randomly and uniformly within the hyperball. I actually do this by populating them within a circumscribing hypercube of side length 10, and taking the subset which falls within the hyperball. Keep count of the number of points in the hyperball.

2) Keep another count of the points that are both within the hyperball AND within the hypercube.

3) Since the points are populated uniformly as a function of hypervolume, the ratio of the counts gives the ratio of the volumes. The beauty of this approach is that it transforms integration into a counting exercise. The percentage comes out to about 42.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import math
import random

N = 10**7

numsphere = 0
numcube = 0

for j in range(0,N):

    x = -5.0 + 10.0 * random.uniform(0.0,1.0)
    y = -5.0 + 10.0 * random.uniform(0.0,1.0)
    z = -5.0 + 10.0 * random.uniform(0.0,1.0)
    w = -5.0 + 10.0 * random.uniform(0.0,1.0)

    if x**2.0 + y**2.0 + z**2.0 + w**2.0 <= 25.0:

        numsphere = numsphere + 1

        if math.fabs(x) < 3.0 and math.fabs(y) < 3.0 and math.fabs(z) < 3.0 and math.fabs(w) < 3.0:

            numcube = numcube + 1


print 100.0 * float(numcube) / float(numsphere)

Thanks, Steven. This is also how I did it.

Huan Bui - 2 years, 5 months ago
Otto Bretscher
Dec 29, 2018

Since my time is very limited, I resorted to "brute force," the way a busy engineer might. The portion of the hypervolume in the first hexadecant (?) is V = 0 3 0 3 0 min ( 3 , 25 x 2 y 2 ) min ( 3 , 25 x 2 y 2 z 2 ) d z d y d x 80.059 V=\int_{0}^{3}\int_0^3\int_{0}^{\min(3,\sqrt{25-x^2-y^2})}\min\left(3,\sqrt{25-x^2-y^2-z^2}\right)\ dz\ dy\ dx\approx 80.059 The proportion we seek is 16 V V t o t a l 0.4153 42 % \frac{16V}{V_{total}}\approx 0.4153\approx \boxed{42}\text{\%} where V t o t a l = 625 π 2 2 V_{total}=\frac{625\pi^2}{2} as we found in an earlier problem . I look forward to seeing more conceptual solutions, but the problem does appear to be a bit "messy."

Thanks, Otto, for yet another elegant solution!

Huan Bui - 2 years, 5 months ago

Log in to reply

elegant?! yeah right, Comrade!

Otto Bretscher - 2 years, 5 months ago

Log in to reply

Well... I guess it's a matter of taste.

Huan Bui - 2 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...