## 2019年10月3日木曜日

### 数学 - Python - 急速・緩慢に変化する関係 - 指数関数・対数関数 - 対数関数の性質 - 常用対数 - 桁数、小数第何位か、不等式

1. $\begin{array}{l}{\mathrm{log}}_{10}{4}^{20}\\ =20{\mathrm{log}}_{10}4\\ \fallingdotseq 20·0.6021\\ =12.042\end{array}$

よって 13桁の整数。

2. $\begin{array}{l}{\mathrm{log}}_{10}2{0}^{20}\\ =20{\mathrm{log}}_{10}20\\ =20\left({\mathrm{log}}_{10}10+{\mathrm{log}}_{10}2\right)\\ \fallingdotseq 20\left(1+0.3010\right)\\ =20·1.3010\\ =26.020\end{array}$

よって27桁の整数。

3. $\begin{array}{l}{\mathrm{log}}_{10}{\left(\frac{2}{3}\right)}^{50}\\ =50\left({\mathrm{log}}_{10}2-{\mathrm{log}}_{10}3\right)\\ \fallingdotseq 50\left(0.3010-0.4771\right)\\ =50\left(-0.1761\right)\\ =-8.805\\ =-9+0.195\end{array}$

よって、 小数第9位に はじめて0でない数字が現れる

4. $\begin{array}{l}{\mathrm{log}}_{10}1.0{6}^{n}\\ =n{\mathrm{log}}_{10}1.06\\ =0.0253n\\ {\mathrm{log}}_{10}2\\ \fallingdotseq 0.3010\end{array}$

よって、

$0.0253n>0.3010$

を満たす正の整数 n を求めればいい。

ゆえに、

$n=12$

5. $\begin{array}{l}{\left(\frac{1}{2}\right)}^{n}<{3}^{-20}\\ -n{\mathrm{log}}_{10}2<-20{\mathrm{log}}_{10}3\\ n{\mathrm{log}}_{10}2>20{\mathrm{log}}_{10}3\\ n>20·\frac{{\mathrm{log}}_{10}3}{{\mathrm{log}}_{10}2}\\ \fallingdotseq 20·\frac{0.4771}{0.3010}\\ =31.\dots \end{array}$

よって、 求める最小の正の整数 n は、

$n=32$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, log, plot, Rational
from sympy.solvers.inequalities import reduce_inequalities

print('30.')

print('(1)')
n = 4 ** 20
t = 1
while n // 10 != 0:
t += 1
n //= 10
print(f'{t}桁')

print('(2)')
n = 20 ** 20
t = 1
while n // 10 != 0:
t += 1
n //= 10
print(f'{t}桁')

print('(3)')
print(float(Rational(2, 3) ** 50))

print('(4)')
n = symbols('n', positive=True, integer=True)
pprint(reduce_inequalities(1.06 ** n > 2, n))
print(float(17.1618111990764*log(2)))

print('(5)')

pprint(reduce_inequalities(Rational(1, 2) ** n < 3 ** -20))
print(float(21.9722457733622 / log(2)))


$./sample30.py 30. (1) 13桁 (2) 27桁 (3) 1.5683285454839587e-09 (4) 17.1618111990764⋅log(2) < n 11.895661045941901 (5) 21.9722457733622 ──────────────── < n log(2) 31.699250014423132$