Surface Area of Unit Sphere

Paradoxically, surface area first grows, and then starts to decrease as the number of dimensions goes over 7

unitarea := ((2  (Pi^(d/2)))/Gamma)[d/2]

Plot[unitarea, {d, 0, 15}, 
        AxesLabel -> {"dimension", "area"}];

Point of maximum surface area

FindRoot[D[area, d] == 0, {d, 5}]

Volume of Unit Sphere

<< Graphics`ContourPlot3D`

ContourPlot3D[
      Cos[Sqrt[x^2 + y^2 + z^2]], {x, -2, 2}, {y, -2, 2}, {z, -2, 
        2}, PlotPoints -> {5, 5}]

Similar thing happens with volume of unit sphere

volume = 
      Integrate[unitarea*(r^(d - 1)), {r, 0, 1}, 
        Assumptions -> {Re[d] > 0}]

Plot[volume, {d, 0, 15}, 
        AxesLabel -> {"dimension", "volume"}];

volume /. d -> 5 // N

Fraction in corners

As dimension grows, increasingly large fraction of mass is concentrated in the corners of unit cube (volume outside of the volume contained inside of an inscribed sphere)

corners = 
      1 - Integrate[unitarea*(r^(d - 1)), {r, 0, 1/2}, 
          Assumptions -> {Re[d] > 0}]

Plot[corners, {d, 1, 10}];

corners /. d -> 7 // N

Visualization of multidimensional cube

7 dimensional cube,most 96% of the mass is concentrated in"corners". For a d dimensional cube, square of the diagonal is d, so as the dimension increases, distance from the center of the cube, to the corners goes to infinity (whereas distance to any facet stays constant), so corners become long spikes

\(TraditionalForm\`E[‖X‖\^2]\ for\ standard\ Normal\)

For standard normal(identity covariance matrix, 0 mean), expected norm squared is just d (number of dimenions)

\(\(Plot[d, {d, 1, 10}, 
        AxesLabel -> {"dimensions", \*""E[\[LeftDoubleBracketingBar]X(\[RightDoubleBracketingBar]^2)""}];\)\)

\(This\ can\ be\ derived\ by\ expanding\ the\ sum\ inside\ the\ norm\^2\ so\ that\ integrals\ decouple\ and\ using\ integration\ by\ parts\ to\ individual\ integrals\)

E[‖X‖] for standard Normal

expdev = (Sqrt[2]) Gamma[(d/2) + (1/2)]/Gamma[(d/2)];

Plot[expdev, {d, 1, 100}, 
        AxesLabel -> {"dimensions", "E[\[LeftDoubleBracketingBar]X\
\[RightDoubleBracketingBar]]"}];

This can be derived by converting to hyperspherical coordinates, and then using integration by parts/setting up a recurrence to integrate (sin^i)x and (x^i)exp(-(x^2))

Using the duplication formula for Gamma function we can rewrite

expdev /. {Gamma[
            x_ + (1/2)] -> (((Sqrt[Pi]) d!)/((2^d) (d/2)!)), Gamma[x_] -> (x - 1)!}

Another simplification

% /. (-1 + x_)! -> x!/x

Now we can use Stirling's approximation

% /. x_! -> (x^x) Exp[-x] (Sqrt[2  π x])

\(Actually\ \(\@\(d - 1/2\)\) makes\ an\ even\ better\ approximation, \ 
    as\ can\ be\ seen\ from\ this\ graph\ \((dashed\ is\ the\ approximation)\)\)

Plot[{(Sqrt[d - 1/2]), expdev}, {d, 1, 10}, 
        PlotStyle -> {{Dashing[{0.1}], 
              Thickness[0.01]}, {Thickness[0.005]}}, 
        AxesLabel -> {"dimensions", "E[\[LeftDoubleBracketingBar]X\
\[RightDoubleBracketingBar]]"}];

Distribution of mass as function of radius for standard Normal

density := (1/(((2  Pi))^(d/2))) 
          Exp[-(1/2) (r^2)];

area = unitarea*(r^(d - 1));

density*area

For one dimension, just right half of the standard normal

Plot[density*area /. {d -> 1}, {r, 0, 6}];

For 4 and 16 dimensions, the mass starts to drift right

Plot[density*area /. {d -> 4}, {r, 0, 6}];

Plot[density*area /. {d -> 16}, {r, 0, 6}, 
        PlotRange -> {0, 0.6}];

As was found in previous section, 
    the mean of this distribution is about (Sqrt[d - 1/2])

We can use our expression for exact mean of the distribution of ‖X‖ to find the variance

d - (expdev^2)

Plot[%, {d, 1, 10}];

\(The\ variance\ of\ ‖X‖\ converges\ to\ \(1\/2\) . Through\ Chebyshev' 
      s\ inequality, \ 
    this\ means\ that\ at\ least\ 75  %\ of\ the\ mass\ falls\ in\ the\ band\ between\ \@\(d - 1/2\) - 1\ and\ \@\(d - 1/2\) + 1\)

Here's a numerical simulation to confirm this

band[dd_] := 
      Module[{ps}, 
        ps = Sequence @@ ({(area/(((2  Pi))^(d/2))) 
                    Exp[-(r^2)/2], {r, (Sqrt[d - 1/2]) - 1, (Sqrt[d - 1/2]) + 
                      1}} /. d -> dd); 
        NIntegrate[Evaluate[ps]]]

Plot[band[d], {d, 2, 100}, PlotRange -> {0, 1}];

band[1000000]

It seems to converge to a value larger than predicted by Chebychev bound (.75) but much smaller than predicted using normality assumption (.95)

\(So\ the\ conclusion\ is\ that\ most\ of\ the\ mass\ is\ neither\ concentrated\ around\ the\ mean, \ nor\ in\ the\ tails, \ 
    but\ rather\ in\ a\ shell\ of\ width\ 2\ located\ at\ distance\ \(\@d\) 
      from\ the\ mean, \ where\ d\ is\ the\ dimension\)