This paper is concerned with solutions to a one dimensional linear diffusion
equation and their relation to some problems in stochastic control theory. A
stochastic variational formula is obtained for the logarithm of the solution to
the diffusion equation, with terminal data which is the characteristic function
of a set. In this case the terminal data for the control problem is singular,
and hence standard theory does not apply.