Deep Learning · MT2 · section

Drill 3 Natural log and probability

MT2 numerical practice from direct to mixed

Question

Question. Compute −ln(0.9),−ln(0.1), and e^{-\ln 2}LaTeX: e^{-\ln 2}.

Answer — step by step

Given

Probabilities: 0.9 and 0.1.

Exponential expression: exp(−ln 2).

To find

Find −ln(0.9), −ln(0.1) and exp(−ln 2).

Formula — which one and why

Natural logarithms. The natural logarithm reverses the exponential. A negative log turns a small correct-class probability into a larger positive loss.

ln uses base e ≈ 2.71828. exp(a) means e raised to the power a. Keep the minus outside ln when the question says −ln(p).

-\ln p=\ln\frac1pLaTeX: -\ln p=\ln\frac1p
e^{\ln a}=aLaTeX: e^{\ln a}=a
e^{-\ln a}=\frac1aLaTeX: e^{-\ln a}=\frac1a

Yaad rakhne ka cue: exp banata hai power; ln us power ko wapas nikaalta hai.

Solution — step by step

Meaning and formulas

The natural logarithm ln tells us the power of e needed to obtain a number. It reverses the exponential operation. A calculator evaluates ln; it is not ordinary division.

\ln(e^a)=a,\qquad e^{\ln a}=a\quad(a>0)LaTeX: \ln(e^a)=a,\qquad e^{\ln a}=a\quad(a>0)
e^{-a}=\frac1{e^a}LaTeX: e^{-a}=\frac1{e^a}

Step 1: calculate the first logarithm, then its minus sign

\ln(0.9)\approx-0.105360516LaTeX: \ln(0.9)\approx-0.105360516
-\ln(0.9)=-(-0.105360516)=0.105360516LaTeX: -\ln(0.9)=-(-0.105360516)=0.105360516

Step 2: calculate the second logarithm

\ln(0.1)\approx-2.302585093LaTeX: \ln(0.1)\approx-2.302585093
-\ln(0.1)=-(-2.302585093)=2.302585093LaTeX: -\ln(0.1)=-(-2.302585093)=2.302585093

When these are correct-class probabilities, 0.1 represents a worse prediction than 0.9, so its negative-log loss is larger.

Step 3: simplify the exponential using the inverse rule

e^{-\ln2}=\frac1{e^{\ln2}}=\frac12=0.5LaTeX: e^{-\ln2}=\frac1{e^{\ln2}}=\frac12=0.5

Final answers: 0.105360516, 2.302585093 and 0.5. Use the ln key; base-10 log gives different first and second answers.