-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ const dirs = [ | |
"可视化搭建", | ||
"SQL", | ||
"机器学习", | ||
"数学之美", | ||
"生活", | ||
]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
这是数学专栏的第一篇文章,数学专栏会记录我对数学相关的心得。 | ||
|
||
为什么数学专栏的名字叫 “数学之美” 呢?因为数学拥有逻辑自洽的美,反之,如果体会不到美,就会觉得很枯燥。 | ||
|
||
这次要介绍的手动算根号就非常能体现数学之美。 | ||
|
||
## 研究问题 | ||
|
||
这次研究的问题是 “如何手动算根号”。 | ||
|
||
我们都知道,平方很好算,但算根号很难。虽然算根号可以通过计算器按出来,但数学上也有优雅的方法快速得到算根号的近似值,掌握了手动算根号的原理,你可以得到以下两个提升: | ||
|
||
1. 学会用心算方式算根号,不用再依赖计算器 | ||
2. 对数学之美的感受 +100 | ||
|
||
## 推导 | ||
|
||
### 平方展开式 | ||
|
||
首先,`a + b` 的平方展开式如下: | ||
|
||
<img width=230 src="https://github.com/user-attachments/assets/40e431e8-bc40-49e7-9c9d-1ee66e0a978e"> | ||
|
||
比如我们要对 82 算根号,假设: | ||
|
||
<img width=120 src="https://github.com/user-attachments/assets/7fed8240-0fd8-44db-a58a-e2fdaa31da18"> | ||
|
||
那么: | ||
|
||
<img width=125 src="https://github.com/user-attachments/assets/572ec02b-0395-4854-b7db-42e3913c0bfa"> | ||
|
||
带入 `a + b` 的平方展开式: | ||
|
||
<img width=175 src="https://github.com/user-attachments/assets/7a78f52b-4a63-4198-b985-abc08722f6c2"> | ||
|
||
等式左边的值已经得到,接下来如果通过某种办法求出了等式右边 `a` 和 `b`,那么根据假设的定义: | ||
|
||
<img width=120 src="https://github.com/user-attachments/assets/7fed8240-0fd8-44db-a58a-e2fdaa31da18"> | ||
|
||
根号 82 的值直接就可以通过 `a + b` 得到。 | ||
|
||
### 如何求出 a 和 b | ||
|
||
等式右边还是比较复杂,需要进一步简化。 | ||
|
||
假设我们只寻找 `a` 远大于 `b` 的组合,那么这个组合下,`2ab` 更加远大于 `b^2`,所以可以把 `b^2` 舍去,得到: | ||
|
||
<img width=130 src="https://github.com/user-attachments/assets/aeedd33f-0569-4f38-8483-aeadb1f08c82"> | ||
|
||
有突破口了,接下来思考,如果 `a` 特别大,比如等于 1 亿可以吗? | ||
|
||
假设 `a` 是特别大的正数,但 `a + b` 等于根号 82,必然导致 `b` 也是一个很大的负数,这样 `2ab` 就是负数,而 `b^2` 是一个很大的正数,就不满足 `2ab` 远大于 `b^2` 的前提条件了。 | ||
|
||
所以 `a` 必须是一个尽可能大,但又要保证 `b` 依然是正数的值。 | ||
|
||
根据 | ||
|
||
<img width=130 src="https://github.com/user-attachments/assets/aeedd33f-0569-4f38-8483-aeadb1f08c82"> | ||
|
||
我们只要找到一个数的平方接近 82,但不大于 82 的数字,作为 `a` 即可,那就是 9 的平方 81 嘛。 | ||
|
||
那么 `a` 等于 9 确定下来了,易得 `b=1/18`,所以: | ||
|
||
<img width=240 src="https://github.com/user-attachments/assets/e278c303-9ee6-4355-82be-3b4e6c04dabc"> | ||
|
||
按一下计算器会发现根号 82 的值是 `9.05538513814`,非常接近。 | ||
|
||
## 速记 | ||
|
||
根据推导结论,我们可以记住以下口诀: | ||
|
||
对于任意数字算根号,比如对数字 `n` 算根号,先找到一个数,这个数的平方最接近并小于根号内的数字,比如求根号 82,先找到 9 作为 `a`,接下来根据下面公式得到 `b`: | ||
|
||
<img width=230 src="https://github.com/user-attachments/assets/78e8891f-1106-4534-8603-2f75b281464b"> | ||
|
||
最后计算 `a + b` 得到的结果就是对 n 算根号的近似值。 | ||
|
||
## 无法找到较大的 a 怎么办 | ||
|
||
假设计算根号 2,只能把 `a` 拆成 1,但这不满足 `a` 远大于 `b`,此时可以把数字乘以 100,这样把得到的结果除以 10 即可。 | ||
|
||
比如计算根号 2,先计算根号 200。 | ||
|
||
200 可以把 `a` 设定为 14(平方是 196),那么 `b` 的值为: | ||
|
||
<img width=260 src="https://github.com/user-attachments/assets/48184e29-4c21-4863-b871-b51f8df47325"> | ||
|
||
那么根号 2 的值就是 `(14 + 0.142) / 10 = 1.4142` | ||
|
||
## 总结 | ||
|
||
在推导过程中,数学之美体现在以下几个点: | ||
|
||
**1. 利用平方展开式** | ||
|
||
这是最本质的问题,即遇到一个难以心算根号的数字时,如果将要求的值转化为已知值的计算,问题就迎刃而解。 | ||
|
||
对任意根号数字来说,其平方都很好算,以及找到最接近该数字的平方值也很好算,满足这些要素的就是平方展开式,所以利用平方展开式是最巧妙的一步。 | ||
|
||
**2. 假设 `a` 远大于 `b`** | ||
|
||
如果让 `a` 远大于 `b`,可以极大简化求 `b` 的过程,虽然这也是这个方案结果是近似值的原因,但总的来说是利大于弊的。 | ||
|
||
**3. 找不到极大的 `a`,就创造条件** | ||
|
||
当条件不满足拆出极大的 `a` 时,将数据乘以 100,不仅必然保证了极大 `a` 的出现,而且还利用了 100 的根号很容易计算的特性,巧妙的将人类不可解的问题转化为人类可解问题。 | ||
|
||
我们通过平方展开式学到了手动对任意正数开根号,如果哪天忘记公式了,也可以根据平方展开式重新推导一遍,这样就永远不会忘记啦。 | ||
|
||
|