Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Making function references solution in Clear category for Boolean Algebra by swagg010164
def conjunction(x, y):
if x == y == 1:
return 1
return 0
def disjunction(x, y):
if x == y == 0:
return 0
return 1
def implication(x, y):
if x == 1 and y == 0:
return 0
return 1
def exclusive(x, y):
if x == y:
return 0
return 1
def equivalence(x, y):
return not(exclusive(x, y))
OPERATION_NAMES = {"conjunction":conjunction, "disjunction":disjunction, \
"implication":implication, "exclusive":exclusive, "equivalence":equivalence}
def boolean(x, y, operation):
return OPERATION_NAMES[operation](x, y)
Nov. 18, 2018
Comments: