High-Dimensional Ellipsoid (Monte Carlo)

In six-dimensional space, with spatial parameters ( A , B , C , D , E , F ) (A,B,C,D,E,F) , there is the following 6 D 6D ellipsoid:

A 2 1 2 + B 2 2 2 + C 2 3 2 + D 2 4 2 + E 2 5 2 + F 2 6 2 = 1 \large{\frac{A^2}{1^2} + \frac{B^2}{2^2} + \frac{C^2}{3^2} + \frac{D^2}{4^2} + \frac{E^2}{5^2} + \frac{F^2}{6^2} = 1}

What is the 6 D 6D volume enclosed by the ellipsoid?

Note: Even if you know of a formal solution, try the algorithmic approach to see how cool it is


The answer is 3720.753.

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.

1 solution

Actual volume: V = 6 ! π 3 6 V=\frac{6!\pi^3}{6}

Python3:

from random import random

Fact = 2 * 4 * 6 * 8 * 10 * 12  # volume of surrounding block
for n in range(1, 9):
    Tries = 10 ** n     # try increasing number of samples
    Count = 0           # number of samples inside ellipsoid
    for Try in range(Tries):
        A = random()
        B = random() * 2
        C = random() * 3
        D = random() * 4
        E = random() * 5
        F = random() * 6
        if A * A + B * B / 4 + C * C / 9 + D * D / 16 + E * E / 25 + F * F / 36 <= 1:
            Count += 1
    print(Tries, Count, Count / Tries * Fact)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...