probability-0.2.5.2: Probabilistic Functional Programming

Safe HaskellSafe
LanguageHaskell98

Numeric.Probability.Example.DiceAccum

Description

We play the following game: We roll a die until we stop or we get three spots. In the first case we own all spots obtained so far, in the latter case we own nothing.

What is the strategy for maximizing the expected score?

Synopsis

Documentation

type Score = Int Source #

die :: Fractional prob => T prob Die Source #

roll :: Fractional prob => T prob (Maybe Score) Source #

strategy :: Fractional prob => T prob (Maybe Score) Source #

optimal strategy

game :: Fractional prob => T prob (Maybe Score) Source #

distribution of the scores that are achieved with the optimal strategy