学習環境
新装版 数学読本2 (松坂 和夫(著)、岩波書店)の第7章(急速・緩慢に変化する関係 - 指数関数・対数関数)、7.2(指数関数と対数関数)、指数関数の性質の問11の解答を求めてみる。
(1.4)2=1.96(1.42)2=2.01641.4<√2<1.42
21.4<2√2<21.42
4√27=334913=32323<34913<4√27
√0.5=(0.5)124√0.125=4√(0.5)4=0.53√0.25=3√(0.5)2=(0.5)234√0.125<3√0.25<√0.5
4√1128=4√127=2(-74)(74)2=4916>3√3<74-√3>-744√1128<2-√3
コード
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()
入出力結果(Bash、cmd.exe(コマンドプロンプト)、Terminal、Jupyter(IPython))
C:\Users\...>py sample11.py
11.
.
----------------------------------------------------------------------
Ran 1 test in 0.013s
OK
C:\Users\...>
0 コメント:
コメントを投稿