<s> '''<STR_LIT>''' <EOL> from bayesian . bbn import * <EOL> '''<STR_LIT>''' <EOL> def f_prize_door ( prize_door ) : <EOL> return <NUM_LIT:1.0> / <NUM_LIT:3> <EOL> def f_guest_door ( guest_door ) : <EOL> return <NUM_LIT:1.0> / <NUM_LIT:3> <EOL> def f_monty_door ( prize_door , guest_door , monty_door ) : <EOL> if prize_door == guest_door : <EOL> if prize_door == monty_door : <EOL> return <NUM_LIT:0> <EOL> else : <EOL> return <NUM_LIT:0.5> <EOL> elif prize_door == monty_door : <EOL> return <NUM_LIT:0> <EOL> elif guest_door == monty_door : <EOL> return <NUM_LIT:0> <EOL> return <NUM_LIT:1> <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> g = build_bbn ( <EOL> f_prize_door , <EOL> f_guest_door , <EOL> f_monty_door , <EOL> domains = dict ( <EOL> prize_door = [ '<STR_LIT:A>' , '<STR_LIT:B>' , '<STR_LIT:C>' ] , <EOL> guest_door = [ '<STR_LIT:A>' , '<STR_LIT:B>' , '<STR_LIT:C>' ] , <EOL> monty_door = [ '<STR_LIT:A>' , '<STR_LIT:B>' , '<STR_LIT:C>' ] ) ) <EOL> print '<STR_LIT>' <EOL> g . q ( ) </s>
