Module Expr Str ImportFrom alias Expr Str FunctionDef arguments args NameParam defaults body Return BinOpDiv Num Num decorator_list FunctionDef arguments args NameParam defaults body Return BinOpDiv Num Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq NameLoad NameLoad body If CompareEq NameLoad NameLoad body Return Num orelse Return Num orelse If CompareEq NameLoad NameLoad body Return Num orelse If CompareEq NameLoad NameLoad body Return Num Return Num decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad keyword Call NameLoad keyword ListLoad Str Str Str keyword ListLoad Str Str Str keyword ListLoad Str Str Str Print Str Expr Call AttributeLoad NameLoad attr
N/A N/A The Monty Hall Problem Modelled as a Bayesian Belief Network bayesian.bbn * N/A 
As BBN:


         GuestDoor     ActualDoor
               \         /
                MontyDoor
                p(M|G,A)


As Factor Graph:

        fGuestDoor               fActualDoor
             |                        |
         GuestDoor                ActualDoor
             |                        |
             +------fMontyDoor--------+
                         |
                     MontyDoor

Now Query: Given Guest chooses door A
and Monty chooses door B, should guest
switch to C or stay with A?

 f_prize_door N/A N/A prize_door N/A N/A N/A N/A 1.0 3 N/A f_guest_door N/A N/A guest_door N/A N/A N/A N/A 1.0 3 N/A f_monty_door N/A N/A prize_door guest_door monty_door N/A N/A N/A N/A prize_door guest_door N/A N/A N/A prize_door monty_door N/A N/A 0 N/A N/A 0.5 N/A N/A N/A prize_door monty_door N/A N/A 0 N/A N/A N/A guest_door monty_door N/A N/A 0 N/A 1 N/A N/A N/A __name__ __main__ N/A N/A g N/A build_bbn f_prize_door f_guest_door f_monty_door domains N/A dict prize_door N/A A B C guest_door N/A A B C monty_door N/A A B C N/A Initial Marginal Probabilities: N/A N/A N/A g q