0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

対数の底変換(算数)

Posted at

対数の底変換.証明も概念も非常に簡単だが,なぜだかいつも底変換の方法を忘れてしまうので,備忘として.

python では $\ln x $ をよく使うので,自然対数を用いて,その他の底を取るときの対数を記す.

例えば,底が $a(>0)$ とする.
$\log _ab$ を $f(x) = \ln x$ を用いて表す.

$b = a^{\log _ab} = (e^{\ln a})^{\log _ab} = e^{\ln b}$

ということで,第3,4項に対して自然対数を取って,
$\ln a \times \log _ab = \ln b$
変形して,
$\log _ab = \frac{\ln b}{\ln a}$

まあ,自明ですね.

import numpy as np

x = np.array([...])

# convert the base of log into 0.1
np.log(x) / np.log(0.1)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?