## 2019年8月10日土曜日

### 数学 - Python - 解析学 - 級数 - 比による判定法 - 累乗、指数関数、階乗、極限、束収

1. $\begin{array}{l}\frac{{a}_{n+1}}{{a}_{n}}\\ =\frac{{\left(n+1\right)}^{n+1}}{\left(n+1\right)!{3}^{n+1}}·\frac{n!{3}^{n}}{{n}^{n}}\\ =\frac{{\left(n+1\right)}^{n+1}}{\left(n+1\right)3{n}^{n}}\\ =\frac{{\left(n+1\right)}^{n}}{3{n}^{n}}\\ =\frac{1}{3}{\left(1+\frac{1}{n}\right)}^{n}\\ <\frac{\epsilon }{3}\\ <1\end{array}$

よって、 問題の無限級数は収束する。

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, plot, summation, oo, exp, Limit, factorial
import matplotlib.pyplot as plt

print('18.')

n = symbols('n', integer=True)
s = summation(n ** n / (factorial(n) * 3 ** n), (n, 1, oo))
l = Limit((n + 1) ** (n + 1) / (factorial((n + 1)) * 3 ** (n + 1)) /
(n ** n / (factorial(n) * 3 ** n)), n, oo)

for o in [s, l, l.doit()]:
pprint(o)
print()

def f(n):
return sum([k ** k / (factorial(k) * 3 ** k) for k in range(2, n + 1)])

ns = range(1, 20)
plt.plot(ns, [f(n) for n in ns],
ns, [(n + 1) ** (n + 1) / (factorial((n + 1)) * 3 ** (n + 1)) /
(n ** n / (factorial(n) * 3 ** n))
for n in ns],
ns, [exp(1) / 3 for _ in ns])

plt.legend(['Σ n^n / n!3^n', 'a_(n+1) / a_n', exp(1) / 3])
plt.savefig('sample18.png')


C:\Users\...>py sample18.py
18.
∞
____
╲
╲    -n  n
╲  3  ⋅n
╱  ──────
╱     n!
╱
‾‾‾‾
n = 1

⎛ n  -n - 1  -n        n + 1   ⎞
⎜3 ⋅3      ⋅n  ⋅(n + 1)     ⋅n!⎟
lim ⎜──────────────────────────────⎟
n─→∞⎝           (n + 1)!           ⎠

ℯ
─
3

c:\Users\...>