Skip to content

Stochastic Dynamic Programming in Java

Roberto Rossi edited this page Aug 2, 2016 · 48 revisions

We provide an example-driven short introduction to Stochastic Dynamic Programming in Java.

Key Java 8 features: lambda calculus, streams and MapReduce

Applications

Inventory control

Gambler's ruin

This problem is taken from W. L. Winston, Operations Research: Applications and Algorithms (7th Edition), Duxbury Press, 2003, chap. 19, example 3.

A gambler has initialWealth. She is allowed to play a game of chance over a given betHorizon, and her goal is to maximize her probability of ending up with a least targetWealth.

If the gambler bets $b on a play of the game, then with probability p, she wins the game and increases her capital position by $b; with probability (1-p), she loses the game and decreases her capital by $b.

On any play of the game, the gambler may not bet more money than she has available.

Determine a betting strategy that will maximize the gambler's probability of attaining a wealth of at least ${@code targetWealth} by the end of the betting horizon.

Clone this wiki locally