转化法
这是一天做算法题的时候偶然发现的(在题目明示的情况下。。。),在这里记下来
0.111111...
=
1
9
0.121212...
=
12
99
0.123123123...
=
123
999
0.123412341234...
=
1234
9999
0.123451234512345...
=
12345
99999
0.
a
b
c
d
e
f
.
.
.
=
a
b
c
d
e
f
999999
.
.
.
0.111111... = \frac{1}{9}\\ ~\\ 0.121212... = \frac{12}{99}\\ ~\\ 0.123123123... = \frac{123}{999}\\ ~\\ 0.123412341234... = \frac{1234}{9999}\\ ~\\ 0.123451234512345... = \frac{12345}{99999}\\ ~\\ 0.abcdef...= \frac{abcdef}{999999}\\ ~\\ ...
0.111111...=91 0.121212...=9912 0.123123123...=999123 0.123412341234...=99991234 0.123451234512345...=9999912345 0.abcdef...=999999abcdef ...
不是数学专业的,不是严谨的推导
推导1
为编辑方便,以0.121212为例:
12
=
0.12
×
99
+
0.12
(
1
)
0.12
=
0.0012
×
99
+
0.0012
(
2
)
0.0012
=
0.000012
×
99
+
0.000012
(
3
)
.
.
.
12=0.12×99+0.12 \qquad(1) \\ ~\\ 0.12=0.0012×99+0.0012 \qquad(2)\\ ~\\ 0.0012=0.000012×99+0.000012 \qquad(3)\\ ~\\ ...\\
12=0.12×99+0.12(1) 0.12=0.0012×99+0.0012(2) 0.0012=0.000012×99+0.000012(3) ...
那么:
从(2)开始不断地代入(1):
12
=
0.12
×
99
+
(
0.0012
×
99
+
0.0012
)
=
0.12
×
99
+
(
0.0012
×
99
+
0.000012
×
99
+
0.000012
)
=
0.12
×
99
+
0.0012
×
99
+
0.000012
×
99
+
(
0.00000012
×
99
+
.
.
.
)
12=0.12×99+(0.0012×99+0.0012)\\ ~\\ =0.12×99+(0.0012×99+0.000012×99+0.000012)\\ ~\\ =0.12×99+0.0012×99+0.000012×99+(0.00000012×99+...)
12=0.12×99+(0.0012×99+0.0012) =0.12×99+(0.0012×99+0.000012×99+0.000012) =0.12×99+0.0012×99+0.000012×99+(0.00000012×99+...)
注意到右边都有99,把它提到左边:
12
99
=
0.12
+
0.0012
+
0.000012
+
0.00000012
+
.
.
.
\frac{12}{99}=0.12+0.0012+0.000012+0.00000012+...
9912=0.12+0.0012+0.000012+0.00000012+...
即:
12
99
=
0.121212...
\frac{12}{99} = 0.121212...\\
9912=0.121212...
得证!
其他类推即可。
这是自己想出来的,还是复杂了点,后来看到别人有更简便的证法,记录在推导2中:
推导2
来自于:一种将无限循环小数快速转换为分数的方法
令
a
=
0.121121121...
a=0.121121121...
a=0.121121121...
则
1000
a
=
121.121121121...
1000a=121.121121121...
1000a=121.121121121...
1000
a
−
a
=
121.121121...
−
0.121121...
=
121
=
999
a
1000a-a\\ ~\\ =121.121121... - 0.121121...\\ ~\\=121=999a\\
1000a−a =121.121121...−0.121121... =121=999a
则:
a
=
121
/
999
a=121/999
a=121/999
果然带佬就是带佬,简便多了。。。