鬼斧神工:求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 ...
随机推荐
- Subway POJ - 2502 spfa
#include<cstdio> #include<cmath> #include<cstring> #include<cstring> #includ ...
- idea 添加 开发者信息
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse( ...
- python package install error and little code bugs
When you install packages using setup.py, the error: (py37) C:\Users\weda\Phd\python packages\visibi ...
- Vue快速认识
1.Vue入门初识 1.1 Vue.js是什么? 一位华裔前Google工程师(尤雨溪)开发的前端js库 作用: 动态构建用户界面 特点: 遵循MVVM模式 编码简洁, 体积小, 运行效率高, 移动/ ...
- Harris角点检测理论
这样想象一下,直线上的一个点在垂直于直线的方向上有最强的梯度.沿着直线的方向梯度较低,意思是直线上的像素点与它周围的像素点看起来相似.我们进行的角点检测是梯度强度明显高于其他像素的点,可能就是目标处 ...
- 自定义Nginx返回页面
1.403返回页面 #user nobody; worker_processes ; #error_log logs/error.log; #error_log logs/error.log noti ...
- IDEA配置tomcat日志乱码
第一步(tomcat7/8) tomcat:找到tomcat文件夹下的conf文件夹,去修改里面的logging.properties文件 两种修改方式(第一种方法不行再用第二种): 将文件中的5个U ...
- Vue之生命周期activated与created使用
created activated 触发顺序 组件创建最初始 created => mounted =>activated 触发次数 只在组件刚创建时创建 在使用keep-alive标 ...
- 使用Vue创建一个新项目
1.环境 保证已经安装好了node\npm\vue等工具,将路径设置为想要建立新项目的文件夹路径 2.关于npm与cnpm npm包管理器,是集成在node中的,node环境安装完成,npm包管理器也 ...
- oracle 锁表处理
1.查询 select object_name,machine,s.sid,s.serial#from v$locked_object l,dba_objects o ,v$session swher ...