We consider discrete time Brownian ratchet models: Parrondo's games. Using the Fourier transform, we calculate the exact probability distribution functions for both the capital dependent and history dependent Parrondo's games. We find that in some cases there are oscillations near the maximum of the probability distribution, and after many rounds there are two limiting distributions, for the odd and even total number of rounds of gambling. We assume that the solution of the aforementioned models can be applied to portfolio optimization.The Parrondo's games [1]- [8], related to the Brownian ratchets [9]-[15] are interesting phenomena at the intersection of game theory, econophysics and statistical physics, see [8] for the inter-disiplinary applications. In case of Brownian ratchets the particle moves in a potential, which randomly changes between 2 versions. For each there is a detailed balance condition. On average there is a motion due to the random switches between two potentials. The phenomenon is certainly related to portfolio optimization [16], [17]. In the related situation in economics, one is using the "volatility pumping" strategy in portfolio optimization, for two asset portfolios, keeping one half of the capital in the first asset, the other half in the second asset with high volatility [18].J. M. R. Parrondo invented his game following Brownian ratchets for the discrete time case [1], to model gambling. An agent uses two biased coins for the gambling, and both strategies are loosing. In some cases a random combination of two loosing games is a winning game. It is interesting that the opposite situation is also possible, a random combination of two winning games can give a loosing game.Parrondo's games have been considered either on the one dimensional axis with some periodic potential, or by looking at the time dependent version of the game parameters.For the first case the state of the system is characterized by the current value of the money X, and the choice of the strategy. There is a period M defining the rules, how capital X can move up or down. The rules of the game depend on Mod(X, M ), where M is the period of the "potential". Originally M = 3 games were considered, then M = 2 versions of Parrondo's games were constructed [7], [19]. For the history dependent versions of the game the current rules of the game depend on the past, whether there was a growth of capital in the previous rounds or not.Later many modifications of the games were invented, * Electronic address: saakian@yerphi.am i.e. different integers M for both games [20], the Allison mixture [21], where the random mixing of two random sequences creates some autocorrelation [22], and two envelope game problems [23]. Especially intriguing is the recent finding of a Parrondo's effect-like phenomenon in a Bayesian approach to the modelling of the work of a jury [24]: the unanimous decision of its members has a low confidence. All the mentioned works consider the situation with random walks, when there are random choices between differ...