noisy-or noisy-orfor boolean variable with boolean parents yk is parametrized by parameters pk where each <pi < the sematics is defined as though there are hidden variables zk where ( and (zi yi pi for > and where is true if and only if zk (where is "or"thus is false if all of the zi are false intuitivelyz is the probability of when all yi are false and each zi is noisy (probabilisticmeasure that yi makes trueand only needs one to make it true probfactors py -(continued class noisyor(cpd)def __init__(selfchildparentsweights)""" noisy representation of conditional probability variable is the boolean (or / child variable whose cpd is being defined parents is the list of boolean (or / parents weights is list of parameterssuch that weights[ + is the weight for parents[ ""assert len(weights= +len(parentscpd __init__(selfchildparentsself weights weights def get_value(self,assignment)assert self can_evaluate(assignmentprobfalse ( -self weights[ ])*math prod( -self weights[ + for in range(len(self parents)if assignment[self parents[ ]]if assignment[self child]return -probfalse elsereturn probfalse tabular factors tabular factor is factor that represents each assignment of values to variables separately it is represented by python array (or python dictif the variables are vk the value of ( vk vk is stored in [ ][ [vk if the domain of vi is [ ni this can be represented as an array otherwise we can use dictionary python is nice in that it doesn' carewhether an array or dict is used except when enumerating the valuesenumerating dict gives the keys (the variablesbut enumerating an array gives the values so we have to be careful not to do this probfactors py -(continuedversion june