2019年9月5日木曜日

数学 - Python - 急速・緩慢に変化する関係 - 指数関数・対数関数 - 指数関数と対数関数 - 指数関数の性質 - 増加関数、減少関数、大小

1. $\begin{array}{l}{\left(1.4\right)}^{2}=1.96\\ {\left(1.42\right)}^{2}=2.0164\\ 1.4<\sqrt{2}<1.42\end{array}$

よって問題の組の数の大小は、

${2}^{1.4}<{2}^{\sqrt{2}}<{2}^{1.42}$

2. $\begin{array}{l}\sqrt[4]{27}\\ ={3}^{\frac{3}{4}}\\ {9}^{\frac{1}{3}}\\ ={3}^{\frac{2}{3}}\\ \frac{2}{3}<\frac{3}{4}\\ {9}^{\frac{1}{3}}<\sqrt[4]{27}\end{array}$

3. $\begin{array}{l}\sqrt{0.5}\\ ={\left(0.5\right)}^{\frac{1}{2}}\\ \sqrt[4]{0.125}\\ =\sqrt[4]{{\left(0.5\right)}^{4}}\\ =0.5\\ \sqrt[3]{0.25}\\ =\sqrt[3]{{\left(0.5\right)}^{2}}\\ ={\left(0.5\right)}^{\frac{2}{3}}\\ \sqrt[4]{0.125}<\sqrt[3]{0.25}<\sqrt{0.5}\end{array}$

4. $\begin{array}{l}\sqrt[4]{\frac{1}{128}}\\ =\sqrt[4]{\frac{1}{{2}^{7}}}\\ ={2}^{\left(-\frac{7}{4}\right)}\\ {\left(\frac{7}{4}\right)}^{2}=\frac{49}{16}>3\\ \sqrt{3}<\frac{7}{4}\\ -\sqrt{3}>-\frac{7}{4}\\ \sqrt[4]{\frac{1}{128}}<{2}^{-\sqrt{3}}\end{array}$

コード

Python 3

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

print('11.')

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

def tearDown(self):
pass

def test(self):
ineqs = [2 ** 1.4 < 2 ** sqrt(2) < 2 ** 1.42,
9 ** Rational(1, 3) < root(27, 4),
root(0.125, 4) < root(0.25, 3) < sqrt(0.5),
root(Rational(1, 128), 4) < 2 ** -sqrt(3)]
for ineq in ineqs:
self.assertTrue(ineq)

if __name__ == '__main__':
x = symbols('x')
p = plot(2 ** x, 3 ** x, 0.5 ** x,
(x, -5, 5),
ylim=(0, 10),
legend=True,
show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

for s, color in zip(p, colors):
s.line_color = color

p.show()
p.save('sample11.png')

main()


C:\Users\...>py sample11.py
11.
.
----------------------------------------------------------------------
Ran 1 test in 0.013s

OK

C:\Users\...>