probability-0.2.2.1: Probabilistic Functional ProgrammingSource codeContentsIndex
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
type Score = Int
die :: Fractional prob => T prob Die
roll :: Fractional prob => T prob (Maybe Score)
continue :: Score -> Bool
strategy :: Fractional prob => T prob (Maybe Score)
game :: Fractional prob => T prob (Maybe Score)
walk :: Int -> IO (Trace (Maybe Score))
Documentation
type Score = IntSource
die :: Fractional prob => T prob DieSource
roll :: Fractional prob => T prob (Maybe Score)Source
continue :: Score -> BoolSource
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
walk :: Int -> IO (Trace (Maybe Score))Source
Produced by Haddock version 2.4.2