3 ms·
Nit, the relevant property you're looking for is associative (you can omit parantheses), not commutative (you can swap left and right); there are some operation
by n2d4 2y ago
Nit, the relevant property you're looking for is associative (you can omit parantheses), not commutative (you can swap left and right); there are some operations that are the latter but not the former, such as the average:
avg(a, b) = avg(b, a)
but
avg(avg(a, b), c) != avg(a, avg(b, c))
- wdutch 2y agoThat's a good example. My favorite has always been rock-paper-scissors. If `vs` is a binary operator which gives you the winner according to the game then rock vs paper = paper vs rock but (rock vs paper) vs scissors != rock vs (paper vs scissors)