检查 E 的近似值

发布于 2024-10-13 00:19:52 字数 379 浏览 2 评论 0原文

MathWorld page 给出了 e 的简单数字公式,据称该公式对于第一个是正确的10^25 位数字。它指出 e 大约是

(1 + 9^-4^(7*6))^3^2^85

知道如何检查这个公式对于前 10 位数字是否正确吗? 这是右侧的另一种写法

Power[Plus[1, Power[9, Times[-1, Power[4, Times[7, 6]]]]], Power[3, Power[2, 85]]]

MathWorld page gives a simple numeric formula for e that's allegedly correct for first 10^25 digits. It states that e is approximately

(1 + 9^-4^(7*6))^3^2^85

Any idea how to check whether this formula is correct even for the first 10 digits?
Here's another way of writing the right hand side

Power[Plus[1, Power[9, Times[-1, Power[4, Times[7, 6]]]]], Power[3, Power[2, 85]]]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷雾森÷林ヴ 2024-10-20 00:19:53

重复获取日志是解决此类问题的一个很好的(通常)普遍适用的解决方案。这是解决此问题的更特殊情况的方法:回想一下 e = lim(n->无穷大, (1+1/n)^n)。因此,为了很好地近似 e,我们需要的只是 9^(4^(42))(小数部分的分母)足够接近 3^(2^85) 并且很大。

在这种情况下,它们是相同的,因此我们有 n=3^(2^85),并且它将是 e 的非常近似值。这些数字很大,但并非不可行:

>>> from mpmath import *
>>> iv.dps = 50 # let's use interval arithmetic, just for fun
>>> x = mpi(9)**(-(4**(42)))
>>> up = (mpi(3)**(2**85))
>>> x
mpi('1.4846305545498656772753385085652043615636250118238876e-18457734525360901453873570', 
'1.4846305545498656772753385085652043615636250118238899e-18457734525360901453873570')
>>> 1/x
mpi('6.7356824695231749871315222528985858700759934154677854e+18457734525360901453873569', 
'6.7356824695231749871315222528985858700759934154678156e+18457734525360901453873569')
>>> up
mpi('6.7356824695231749871315222528985858700759934154678005e+18457734525360901453873569', 
'6.7356824695231749871315222528985858700759934154678156e+18457734525360901453873569')
>>> 0 in (1/x-up)
True

计算出 e 上的精确误差范围留给读者作为练习;-) -- 提示:将 mathworld 页面声称的准确度位数与上述数字进行比较,并且问问为什么会这样,想想一系列近似值 (1+1/1)^1、(1+1/2)^2 等。

Repeatedly taking logs is a nice (usually) generally-applicable solution to problems of this sort. Here's a more special-case approach to this problem: recall that e = lim(n->infinity, (1+1/n)^n). So to be a good approximation to e, all we need is for 9^(4^(42)) (the denominator of the fractional part) to be sufficiently close to 3^(2^85) and big.

In this case, they're identical, so we have n=3^(2^85), and it's going to be a very good approximation to e. These are big numbers, but not unworkably so:

>>> from mpmath import *
>>> iv.dps = 50 # let's use interval arithmetic, just for fun
>>> x = mpi(9)**(-(4**(42)))
>>> up = (mpi(3)**(2**85))
>>> x
mpi('1.4846305545498656772753385085652043615636250118238876e-18457734525360901453873570', 
'1.4846305545498656772753385085652043615636250118238899e-18457734525360901453873570')
>>> 1/x
mpi('6.7356824695231749871315222528985858700759934154677854e+18457734525360901453873569', 
'6.7356824695231749871315222528985858700759934154678156e+18457734525360901453873569')
>>> up
mpi('6.7356824695231749871315222528985858700759934154678005e+18457734525360901453873569', 
'6.7356824695231749871315222528985858700759934154678156e+18457734525360901453873569')
>>> 0 in (1/x-up)
True

Working out the exact error bounds on e is left as an exercise for the reader ;-) -- hint: compare the number of digits of accuracy the mathworld page claims and the above numbers, and ask why that might be, thinking of the series of approximations (1+1/1)^1, (1+1/2)^2, etc.

ゃ人海孤独症 2024-10-20 00:19:52

这个问题根本不需要Mathematica。首先,很容易证明 9^(4^(7*6)) 完全等于 3^2^85,因为

 9^(4^(7*6)) = 3^(2*4^(7*6)) = 3^(2^(1+2*(7*6))) = 3^2^85

然后,我们知道表示e的方法是作为极限

e = lim (1+1/n)^n, n->infinity

唯一的问题是,考虑到n非常大但有限,误差是什么。给

(1+1/n)^n = e^log((1+1/n)^n) = e^(n*log(1+1/n)) = e^(1-1/(2n)+O(1/n^2)) = e + O(1/n),

n = 3^2^85,我们取 log(10,n) = 2^85 log(10,3) ~ 1.85 *10^25代码>,我们得到一个估计
与引用的类似

This problem does not need Mathematica at all. First, it is easy to show that 9^(4^(7*6)) is exactly equal to 3^2^85, since

 9^(4^(7*6)) = 3^(2*4^(7*6)) = 3^(2^(1+2*(7*6))) = 3^2^85

Then, we know that one of the ways to represent e is as a limit

e = lim (1+1/n)^n, n->infinity

The only question is what is the error given that n is very large but finite. We have

(1+1/n)^n = e^log((1+1/n)^n) = e^(n*log(1+1/n)) = e^(1-1/(2n)+O(1/n^2)) = e + O(1/n),

Given the n = 3^2^85, i we take the log(10,n) = 2^85 log(10,3) ~ 1.85 *10^25, we get an estimate
similar to the quoted one

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文