球の場合(最小球か否かは考慮せず)の10万回シミュレーションの平均値

library(nleqslv)
Abs <- function(x) sqrt(sum(x^2))
sphere <- function(CR){ # CR:Center,Radius
C=CR[1:3]
R=CR[4]
v4=replicate(4,vertices())
c(
Abs(v4[,1]-C),Abs(v4[,2]-C),Abs(v4[,3]-C),Abs(v4[,4]-C)
)-R
}
sphere(1:4/10) # example

sim2 <- function(){
r=nleqslv(1:4/10,sphere)$fvec[4] # 初期値 1:4/10 c(0.1,0.2,0.3,0.4)
4/3*pi*r^3
}
sim2()
k=1e5
re=replicate(k,sim2())
mean(re)

> mean(re)
[1] 1.8112