鬼斧神工:求n维球的体积
原文地址:http://spaces.ac.cn/archives/3154/
原文作者:苏剑林
标准思路
简单来说,\(n\)维球体积就是如下\(n\)重积分
\[V_n(r)=\int_{x_1^2+x_2^2+\dots+x_n^2\leq r^2}\mathrm{d}x_1 \mathrm{d}x_2\dots \mathrm{d}x_n\]
用更加几何的思路,我们通过一组平行面(\(n−1\)维的平行面)分割,使得n维球分解为一系列近似小柱体,因此,可以得到递推公式
\[V_n (r)=\int_{-r}^r V_{n-1} \left(\sqrt{r^2-t^2}\right)\mathrm{d}t\]
设\(t=r\sin\theta_1\),就有
\[V_n (r)=r\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} V_{n-1} \left(r\cos\theta_1\right)\cos\theta_1 \mathrm{d}\theta_1\]
迭代一次就有
\[V_n (r)=r^2\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} V_{n-2} \left(r\cos\theta_1\cos\theta_2\right)\cos\theta_1\cos^2\theta_2 \mathrm{d}\theta_1 \mathrm{d}\theta_2\]
迭代\(n−1\)次
\[\begin{align*}V_n (r)=&r^{n-1}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\dots\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} V_1\left(r\cos\theta_1\cos\theta_2\dots \cos\theta_{n-1}\right)\times\\
&\cos\theta_1\cos^2\theta_2\dots\cos^{n-1}\theta_{n-1} \mathrm{d}\theta_1 \mathrm{d}\theta_2\dots \mathrm{d}\theta_{n-1}\end{align*}\]
其中\(V_1(r)=2r\),即两倍半径长的线段。从而
\[V_n (r)=2r^{n}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\dots\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos^2\theta_1\cos^3\theta_2\dots\cos^{n}\theta_{n-1} \mathrm{d}\theta_1 \mathrm{d}\theta_2\dots \mathrm{d}\theta_{n-1}\]
完成这个积分,最终就得到n维球体积的公式,这个积分自然是可以求出来的(只是\(n−1\)个一维积分的乘积)。但是这样的步骤太不容易了,为了将其跟伽马函数联系起来,还要做很多工作。总的来说,这是一个不容易记忆、也不怎么漂亮的标准方法。
绝妙思路
有一个利用高斯积分的绝妙技巧,能够帮助我们直接将球体积跟伽马函数联系起来,整个过程堪称鬼斧神工,而且给人“仅此一家,别无分号”的感觉。据说这个技巧为物理系学生所知晓,我是从百读文库看到的,原始来源则是《热力学与统计力学》顾莱纳(德),例5.2 理想气体的熵的统计计算。
这一绝妙的思路,始于我们用两种不同的思路计算高斯积分
\[\begin{align*}
G(n)=\int_{-\infty}^{+\infty}\dots\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty} \exp\left(-x_1^2-x_2^2-\dots-x_n^2\right)\mathrm{d}x_1 \mathrm{d}x_2 \dots \mathrm{d}x_n\tag{1}
\end{align*}\]
一方面,将\((1)\)当作\(n\)次累次积分,因为我们已经算得
\[\int_{-\infty}^{+\infty}\exp(-t^2)\mathrm{d}t=\sqrt{\pi}\]
而\((1)\)只不过是这样的\(n\)个积分的乘积,因此
\[\begin{align*}
G(n)=\pi^{n/2}\tag{2}
\end{align*}\]
另一方面,将\((1)\)当作\(n\)重积分,由于积分变量只是跟径向长度\(r=\sqrt{x_1^2+x_2^2+\dots+x_n^2}\)有关的变量,因此很容易联想到球坐标,在\(n\)维空间中,可以称为“超球坐标”,不需要将超球坐标完整写出来,只需要注意到,球内的积分,可以化为先对“球壳”进行积分,然后再对球半径进行积分。
\[\begin{align*}
G(n)=\int_{0}^{+\infty}\mathrm{d}r\int_{S_n(r)}\exp\left(-r^2\right)\mathrm{d}S_n\tag{3}
\end{align*}\]
这里的\(S_n(r)\)是半径为\(r\)的\(n\)维球体表面(以及表面积,在不至于混淆的情况下,这里不作区分)。但是注意到,被积函数只跟\(r\)有关,因此对球表面进行积分,等价于原函数乘以球的表面积而已,因此\((2)\)式的结果为
\[\begin{align*}
G(n)=\int_{0}^{+\infty}\mathrm{d}r\exp\left(-r^2\right)S_n(r)\tag{4}
\end{align*}\]
虽然我们不知道\(n\)维球的体积和表面积公式,但是我们可以肯定,\(n\)维球的体积一定正比于\(r^n\),即有
\[V_n (r)=V_n(1)r^n\]
球的表面积,就是球体积的一阶导数(考虑球壳分割),那么
\[S_n (r)=n V_n(1)r^{n-1}\]
代入\((4)\),得到
\[\begin{align*}G(n)=&n V_n(1)\int_{0}^{+\infty}r^{n-1}\exp\left(-r^2\right)\mathrm{d}r\\
=&\frac{1}{2}n V_n(1)\int_{0}^{+\infty}(r^2)^{n/2-1}\exp\left(-r^2\right)\mathrm{d}(r^2)\\
=&\frac{1}{2}n V_n(1)\int_{0}^{+\infty}z^{n/2-1}\exp\left(-z\right)\mathrm{d}z\quad\left(z=r^2\right)\\
=&\frac{1}{2}n V_n(1)\Gamma\left(\frac{n}{2}\right)\tag{5}\end{align*}\]
结合\((2)\)得
\[\pi^{n/2}=G(n)=\frac{1}{2}n V_n(1)\Gamma\left(\frac{n}{2}\right)\]
从而
\[V_n(1)=\frac{\pi^{n/2}}{\frac{1}{2}n\Gamma\left(\dfrac{n}{2}\right)}=\frac{\pi^{n/2}}{\Gamma\left(\dfrac{n}{2}+1\right)}\]
最后
\[\Large\boxed{\displaystyle V_n(r)=\frac{\pi^{n/2}}{\Gamma\left(\dfrac{n}{2}+1\right)}r^n}\]
就这样得到了\(n\)维球体积公式!!对\(r\)求导得到\(n\)维球表面积公式
\[\Large\boxed{\displaystyle S_n(r)=\frac{2\pi^{n/2}}{\Gamma\left(\dfrac{n}{2}\right)}r^{n-1}}\]
结合前后两个方法,就得到
\[\large\boxed{\displaystyle \color{red}{\frac{\pi^{n/2}}{\Gamma\left(\dfrac{n}{2}+1\right)}=2\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\dots\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos^2\theta_1\cos^3\theta_2\dots\cos^{n}\theta_{n-1} \mathrm{d}\theta_1 \mathrm{d}\theta_2\dots \mathrm{d}\theta_{n-1}}}\]
鬼斧神工:求n维球的体积的更多相关文章
- 关于Euler-Poisson积分的几种解法
来源:https://www.cnblogs.com/Renascence-5/p/5432211.html 方法1:因为积分值只与被积函数和积分域有关,与积分变量无关,所以\[I^{2}=\left ...
- POJ 2208 Pyramids(求四面体体积)
Description Recently in Farland, a country in Asia, a famous scientist Mr. Log Archeo has discovered ...
- hdu 3642 体积并
题意:求三个矩形体积的并 链接:点我 枚举z #include<stdio.h> #include<iostream> #include<stdlib.h> #in ...
- 瘋子C++笔记
瘋耔C++笔记 欢迎关注瘋耔新浪微博:http://weibo.com/cpjphone 参考:C++程序设计(谭浩强) 参考:http://c.biancheng.net/cpp/biancheng ...
- BZOJ-3225 立方体覆盖 线段树+扫描线+乱搞
看数据范围像是个暴力,而且理论复杂度似乎可行,然后被卡了两个点...然后来了个乱搞的线段树+扫描线.. 3225: [Sdoi2008]立方体覆盖 Time Limit: 2 Sec Memory L ...
- HDU4276 The Ghost Blows Light(树形DP+背包)
题目大概说一棵n个结点树,每个结点都有宝藏,走过每条边要花一定的时间,现在要在t时间内从结点1出发走到结点n,问能获得最多的宝藏是多少. 放了几天的题,今天拿出来集中精力去想,还是想出来了. 首先,树 ...
- [收藏夹整理]OpenCV部分
OpenCV中文论坛 OpenCV论坛 opencv视频教程目录(初级) OpenCV 教程 Opencv感想和一些分享 tornadomeet 超牛的大神 [数字图像处理]C++读取.旋转和保存bm ...
- ZOJ 3866 - Cylinder Candy
3866 - Cylinder Candy Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu ...
- 山东省第三届ACM省赛
Solved ID PID Title Accepted Submit A 2407 Impasse (+) 0 0 B 2415 Chess 0 0 C 2414 An interest ...
随机推荐
- 多项式乘法逆元 - NTT
递归求解即可 #include <bits/stdc++.h> using namespace std; #define int long long namespace NTT { #de ...
- How to do high impact research + 实事求是
1. develop a strong publications record early, so do what you can to make that happen. 2. 粗读:abstrac ...
- 添加右键新增.md文件
Windows下设置.md文件右键可新建 应用场景:Windows10, Typora(Markdown编辑器) 因为习惯用Markdown来写文档, 所以常常需要新建.md文档,但由于Windows ...
- RN开发-Linux开发环境搭建(Ubuntu 12.04)
1.首先安装JDK 2.安装Android开发环境 3.安装node.js 3.1 官网下载 : node-v6.9.1-linux-x64 3.2 添加环境变量 sudo vi /etc/profi ...
- rm -rf
inux反选删除文件 最简单的方法是 # shopt -s extglob (打开extglob模式) # rm -fr !(file1) 如果是多个要排除的,可以这样: # rm -rf ...
- docker镜像相关的常用操作
1.保存镜像 #docker save 镜像名称 -o 保存的完整地址和文件名 docker save zhoushiya/zhiboyuan -o d:/zhiboyuan.tar 2.载入镜像 # ...
- 【转】VS2017离线安装
[转自]https://www.cnblogs.com/feigao/p/8409606.html 第一步:下载离线安装包 https://www.visualstudio.com/zh-hans/d ...
- ubuntu18 + caffe+cpu+anaconda3
本记录只暂时只记录一些错误. 编译错误,opencv3.2与anaconda3下的libtiff不兼容,冲突. 问题查找(查找所有的TIFF库与编译错误提示匹配/usr/lib/x86_64-linu ...
- Grafana展示zabbix监控数据
一.安装步骤 (1)进入官网选择合适的操作系统版本下载Grafana:https://grafana.com/grafana/download?platform=linux [root@zabbix- ...
- 转载:android audio policy
Audio policy basic:https://www.cnblogs.com/CoderTian/p/5705742.html Set volume flow:https://blog.csd ...