  We study in this paper a control problem in a space of random variables. We
show that its Hamilton Jacobi Bellman equation is related to the Master
equation in Mean field theory. P.L. Lions in [14,15] introduced the Hilbert
space of square integrable random variables as a natural space for writing the
Master equation which appears in the mean field theory. W. Gangbo and A.
\'Swi\k{e}ch [10] considered this type of equation in the space of probability
measures equipped with the Wasserstein metric and use the concept of
Wasserstein gradient. We compare the two approaches and provide some extension
of the results of Gangbo and \'Swi\k{e}ch.
