## 2019年8月31日土曜日

### 数学 - Python - 急速・緩慢に変化する関係 - 指数関数・対数関数 - 指数の拡張 - 指数の拡張(1) - 指数法則、計算

1. $\begin{array}{l}\frac{4}{3}+\frac{1}{6}=\frac{9}{6}=\frac{3}{2}\\ {4}^{\frac{3}{2}}\\ ={2}^{3}\\ =8\end{array}$

2. $\begin{array}{l}\frac{1}{2}-\frac{1}{6}+\frac{2}{3}\\ =\frac{6}{6}\\ =1\\ 7\end{array}$

3. $\begin{array}{l}\frac{1}{6}\left(-\frac{3}{2}\right)=-\frac{1}{4}\\ 16={2}^{4}\\ \frac{1}{2}\end{array}$

4. $\begin{array}{l}\frac{125}{8}\\ =\frac{{5}^{3}}{{2}^{3}}\\ ={\left(\frac{5}{2}\right)}^{3}\\ {\left(\frac{5}{2}\right)}^{2}=\frac{25}{4}\end{array}$

5. $\begin{array}{l}{\left({4}^{\frac{1}{3}}\right)}^{12}\\ ={4}^{4}\\ =256\end{array}$

6. $\begin{array}{l}\left(\frac{9}{16}\right)={\left(\frac{3}{4}\right)}^{2}\\ 2·\frac{2}{3}\left(-\frac{3}{4}\right)\\ =-1\\ {\left(\frac{3}{4}\right)}^{-1}=\frac{4}{3}\end{array}$

7. $\begin{array}{l}\frac{1}{3}+\frac{2}{3}+\frac{4}{3}+\frac{8}{3}\\ =\frac{15}{3}\\ =5\\ {2}^{5}=32\end{array}$

8. $\begin{array}{l}{3}^{\frac{3}{2}}·{3}^{\frac{1}{3}}·{3}^{\frac{1}{6}}\\ \frac{3}{2}+\frac{1}{3}+\frac{1}{6}\\ =\frac{9+2+1}{6}\\ =2\\ {3}^{2}=9\end{array}$

コード

Python 3

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

print('9.')

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

def tearDown(self):
pass

def test(self):
spam = [4 ** Rational(4, 3) * 4 ** Rational(1, 6),
7 ** Rational(1, 2) / 7 ** Rational(1, 6) *
7 ** Rational(2, 3),
(16 ** Rational(1, 6)) ** -Rational(3, 2),
Rational(125, 8) ** Rational(2, 3),
root(4, 3) ** 12,
(Rational(9, 16) ** Rational(2, 3)) ** -Rational(3, 4),
2 ** Rational(1, 3) * 2 ** Rational(2, 3) *
2 ** Rational(4, 3) * 2 ** Rational(8, 3),
sqrt(27) * root(3, 3) * root(3, 6)]

egg = [8, 7, Rational(1, 2), Rational(25, 4), 256, Rational(4, 3), 32,
9]
for s, t in zip(spam, egg):
self.assertEqual(s.factor(), t)

if __name__ == '__main__':
main()


C:\Users\...>py sample9.py
9.
.
----------------------------------------------------------------------
Ran 1 test in 0.016s

OK

C:\Users\...>