jlgdr wrote:
Hey there folks, sorry to bump on an old thread. Just wondering, is there a way to evaluate statement 3 faster?
I believe this questions takes around 2 minutes and evaluating statement 3 takes a lot of work and is prone to errors.
Just wondering if I'm doing this the correct/most efficient way
Thanks guys
Cheers!
J

In this problem we have been asked to check the commutative and associative property of the given function. These properties are defined as below:
Commutative: In mathematics, a binary operation is commutative if changing the order of the operands does not change the result.
Associative: Within an expression containing two or more occurrences in a row of the same associative operator, the order in which the operations are performed does not matter as long as the sequence of the operands is not changed. That is, rearranging the parentheses in such an expression will not change its value.
If you're wondering if commutativity implies associativity in mathematics then the answer is NO. However, for simple addition and multiplication functions commutativity does imply associativity and hence in such cases option 3 need not be tested if option 1 is true. However, the only way to solve such problems which involve functions other than simple addition and multiplication would be to solve the expression completely as stated above.