According to the Brans-Dicke theory, the value of the gravitational constant G which we measure at present is determined by the value of the Brans-Dicke scalar field phi at the end of inflation. However, because of quantum fluctuations of the scalar fields produced during inflation, the gravitational constant G(phi) may take different values in different exponentially large parts of the Universe. We investigate the probability distribution P(p) to find a domain of a given volume with a given value of the gravitational constant G at a given time. The investigation is performed for a wide class of effective potentials of the scalar field sigma which drives inflation, and with two different time parametrizations. Our work is based on the analytical study of the diffusion equations for P(p), as well as on the computer simulation of stochastic processes in the inflationary universe. We have found that in some inflationary models the probability distribution P(p) rapidly approaches a stationary regime. The shape of the distribution depends, however, on the choice of the time parametrization. In some other models the distribution P(p) is not stationary. An interpretation of our results and of all ambiguities involved is outlined, and a possible role of anthropic considerations in determination of the gravitational constant is discussed.