Solution (source code)

= Solution

Under the risk-neutral measure, $\log S_T=\log S_0+(r-\sigma^2/2)T+\sigma W_T^Q$. Therefore $\pi(\log S_T)=e^{-rT}[\log S_0+(r-\sigma^2/2)T]$.