I have developed a stochastic dynamic programming model of the situation envisioned by the marginal value theorem, however I have treated prey encounter as a stochastic event, included a consideration of predation hazard and incorporated the use of a refuge. Unlike the marginal value theorem, in my model the forager's objective function is to avoid death, not to maximize its long term rate of energy gain. The model is solved numerically and the resulting optimal policy (strategy for utilizing patches) is than used in computer simulations to generate distributions of predicted patch-residence times. I solve the model to predict differences caused by changes in the parameter values. My model predicts that patch-residence times will increase with increased travel times. It also predicts that a change in predation hazard alone will not affect patch-residence times, but that foragers will increase their use of the refuge and thereby accept a lower final physiological conditions. When foragers are more efficient at searching for and handling their food, then patch-residence times should decrease. When patches are larger, such that there is more food available in each patch, foragers should stay longer in each patch. The predictions of the model are sensitive to the shape of the terminal reward function, but in a predictable manner. The qualitative results of this model bear a striking resemblance to the qualitative predictions of the marginal value theorem. This model demonstrates that it is possible to get "rate maximization like" results when many of the marginal value theorem's assumptions are violated, and in fact when the forager is not strictly maximizing its long term rate of energy gain. This model may provide a much needed, and useful alternative hypothesis to the marginal value theorem for field investigations of patch-use strategies.