ユニット上の2つのランダムな点間の予想されるユークリッド距離の推定 $n$-半球

Nov 22 2020

Wolfram Mathematicaを使って、予想されるユークリッド距離を推定するための最良のアプローチは何ですか( $(n+1)$-次元空間)ユニット上でランダムに均一に選択された2点間の $n$-球体

私が考えているアプローチでは、長さがに比例する式を使用します $n$、よりシンプルでエレガントなアプローチが欲しいのですが。

回答

5 flinty Nov 22 2020 at 00:45

正規分布を使用して生成する $n$値とNormalize球上のポイントを取得します。を使用して、最後の座標が常に同じ符号を持つことを確認してくださいAbs。これらのポイントを数百万個生成し、ペア間の平均距離を推定します。

n = 3;
topt[p_] := MapAt[Abs, Normalize[p], -1]
points = topt /@ RandomVariate[NormalDistribution[0, 1], {1000000, n}];
distances = EuclideanDistance @@@ Partition[points, 2];
Histogram[distances]
Mean[distances]

(* 1.13137 *)
2 JoshuaSchrier Nov 23 2020 at 10:02

サンプリングを行う別の方法(組み込みのSphere関数とRandomPoint機能を利用する(球の表面からのサンプリングに関する同様の質問から変更)

distanceDistributionOnHalfSphere[dimensionality_, nSamples_:10^5] :=
  With[{
   (* take a few extra samples account for loss *)
   randomPointsOnSurfaceOfNSphere = RandomPoint[Sphere[dimensionality], {4*nSamples, 2}], 
   
   (* define an operator that deletes points when either last coordinate is negative *)
   upperHemisphere = DeleteCases[{{___, x_}, {___, y_}} /; (Negative[x] || Negative[y])]
   },
  
  (* apply operator to the list and compute list of distances *)
  EuclideanDistance @@@ upperHemisphere @ randomPointsOnSurfaceOfNSphere
  ]

(* Evaluate mean of the sample *)
MeanAround /@ distanceDistributionOnHalfSphere /@ Range[10]

$N=3$ 結果は@flintyの結果と一致しています*)