probability-0.2.4.1: Probabilistic Functional Programming

Safe HaskellSafe-Inferred

Numeric.Probability.Example.MontyHall

Contents

Synopsis

Documentation

data Door Source

Constructors

A 
B 
C 

Instances

data State Source

Constructors

Doors 

Fields

prize :: Door
 
chosen :: Door
 
opened :: Door
 

Instances

start :: StateSource

initial configuration of the game status

hide :: Trans StateSource

Steps of the game:

  1. hide the prize
  2. choose a door
  3. open a non-open door, not revealing the prize
  4. apply strategy: switch or stay

Playing the game

data Outcome Source

Constructors

Win 
Lose 

Alternative modeling

Play the game the monadic way