probability-0.1: Computations with discrete random variables

MontyHall

Documentation

data Door Source

Constructors

A
B
C

Instances

doors :: [Door]Source

data State Source

Constructors

Fields

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

Instances

start :: State Source

initial configuration of the game status

hide :: Trans State Source

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

choose :: Trans State Source

open :: Trans State Source

type Strategy = Trans State Source

switch :: Strategy Source

stay :: Strategy Source

game :: Strategy -> Trans State Source

Playing the game

data Outcome Source

Constructors

Win

Instances

result :: State -> Outcome Source

eval :: Strategy -> Dist Outcome Source

simEval :: Int -> Strategy -> RDist Outcome Source

Alternative modeling

firstChoice :: Dist Outcome Source

switch' :: Trans Outcome Source

AltStyle によって変換されたページ (->オリジナル) /