probability-0.2.5.2: Probabilistic Functional Programming

Numeric.Probability.Example.MontyHall

Synopsis

# Documentation

data Door Source #

Constructors

 A B C
Instances
 Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall Methods(==) :: Door -> Door -> Bool #(/=) :: Door -> Door -> Bool # Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall Methodscompare :: Door -> Door -> Ordering #(<) :: Door -> Door -> Bool #(<=) :: Door -> Door -> Bool #(>) :: Door -> Door -> Bool #(>=) :: Door -> Door -> Bool #max :: Door -> Door -> Door #min :: Door -> Door -> Door # Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall MethodsshowsPrec :: Int -> Door -> ShowS #show :: Door -> String #showList :: [Door] -> ShowS #

data State Source #

Constructors

 Doors Fieldsprize :: Door chosen :: Door opened :: Door
Instances
 Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall Methods(==) :: State -> State -> Bool #(/=) :: State -> State -> Bool # Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall Methods(<) :: State -> State -> Bool #(<=) :: State -> State -> Bool #(>) :: State -> State -> Bool #(>=) :: State -> State -> Bool #max :: State -> State -> State #min :: State -> State -> State # Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall MethodsshowsPrec :: Int -> State -> ShowS #show :: State -> String #showList :: [State] -> ShowS #

initial configuration of the game status

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
Instances
 Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall Methods(==) :: Outcome -> Outcome -> Bool #(/=) :: Outcome -> Outcome -> Bool # Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall Methods(<) :: Outcome -> Outcome -> Bool #(<=) :: Outcome -> Outcome -> Bool #(>) :: Outcome -> Outcome -> Bool #(>=) :: Outcome -> Outcome -> Bool # Source # Instance detailsDefined in Numeric.Probability.Example.MontyHall MethodsshowList :: [Outcome] -> ShowS #