## 2019年9月24日火曜日

### 数学 - Python - 急速・緩慢に変化する関係 - 指数関数・対数関数 - 対数関数の性質 - 底の変換公式 - 異なる底の対数関数の積、差

1. $\begin{array}{l}{\mathrm{log}}_{a}b·{\mathrm{log}}_{b}c·{\mathrm{log}}_{c}a\\ =\frac{\mathrm{log}b}{\mathrm{log}a}·\frac{\mathrm{log}c}{\mathrm{log}b}·\frac{\mathrm{log}a}{\mathrm{log}c}\\ =1\end{array}$

2. $\begin{array}{l}{\mathrm{log}}_{2}6·{\mathrm{log}}_{3}6-{\mathrm{log}}_{2}3-{\mathrm{log}}_{3}2\\ =\left({\mathrm{log}}_{2}2+{\mathrm{log}}_{2}3\right)\left({\mathrm{log}}_{3}2+{\mathrm{log}}_{3}3\right)-{\mathrm{log}}_{2}3-{\mathrm{log}}_{3}2\\ =\left(1+{\mathrm{log}}_{2}3\right)\left({\mathrm{log}}_{3}2+1\right)-{\mathrm{log}}_{2}3-{\mathrm{log}}_{3}2\\ =1+{\mathrm{log}}_{2}3·{\mathrm{log}}_{3}2\\ =1+\frac{\mathrm{log}3}{\mathrm{log}2}·\frac{\mathrm{log}2}{\mathrm{log}3}\\ =2\end{array}$

3. $\begin{array}{l}{\mathrm{log}}_{8}10·{\mathrm{log}}_{10}12·{\mathrm{log}}_{12}14·{\mathrm{log}}_{14}16\\ =\frac{\mathrm{log}10·\mathrm{log}12·\mathrm{log}14·\mathrm{log}16}{\mathrm{log}8·\mathrm{log}10·\mathrm{log}12·16g14}\\ =\frac{\mathrm{log}{2}^{4}}{\mathrm{log}{2}^{3}}\\ =\frac{4}{3}\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, log, Rational
from unittest import TestCase, main

print('24.')

class MyTestCase(TestCase):
def setUp(self):
pass

def tearDown(self):
pass

def test(self):
a, b, c = symbols('a, b, c')
spam = [log(b, a) * log(c, b) * log(a, c),
log(6, 2) * log(6, 3) - log(3, 2) - log(2, 3),
log(10, 8) * log(12, 10) * log(14, 12) * log(16, 14)]
egg = [1, 2, Rational(4, 3)]
for s, t in zip(spam, egg):
self.assertEqual(s.simplify(), t)

if __name__ == '__main__':
main()


$./sample24.py 24. . ---------------------------------------------------------------------- Ran 1 test in 0.246s OK$