I am a complete beginner to SageMath. I was wondering how I could recreate the maximum-minimum identity using it. Any idea?
Asked
Active
Viewed 63 times
I am a complete beginner to SageMath. I was wondering how I could recreate the maximum-minimum identity using it. Any idea?
def mymax(x): return sum([min(comb)*(-1)^(len(comb)+1) for comb in Combinations(x) if comb])anddef mymin(x): return sum([max(comb)*(-1)^(len(comb)+1) for comb in Combinations(x) if comb])? Or are you looking for a symbolic expansion? – rickhg12hs Jun 26 '20 at 12:35