What number could replace SYMBOL
below?
FIRST OP SECOND = FAKE_SECOND OP FAKE_FIRST
ANSWER
With OP_WORD, the order of the two ADDENDS does not matter.
Evaluating the left side:
FIRST OP SECOND = RESULT
Re-ordering the ADDENDS and evaluating:
SECOND OP FIRST = RESULT
We see that re-ordering the ADDENDS did not affect the final result:
FIRST OP SECOND = SECOND OP FIRST
Comparing with the original equation, the symbol SYMBOL
could be replaced with the number ANSWER
.
This fact about OP_WORD is known as the commutative property.
What number could replace SYMBOL
below?
FIRST_OPENTERMS[ 0 ]
OPSECOND_OPENTERMS[ 1 ]FIRST_CLOSE
OPTERMS[ 2 ]SECOND_CLOSE =
SECOND_OPENFAKE_TERMS[ 0 ]
OPFIRST_OPENFAKE_TERMS[ 1 ]SECOND_CLOSE
OPFAKE_TERMS[ 2 ]FIRST_CLOSE
ANSWER
With OP_WORD, the parentheses around the ADDENDS do not affect the final result.
Evaluating the left side:
FIRST_OPENTERMS[ 0 ]
OPSECOND_OPENTERMS[ 1 ]FIRST_CLOSE
OPTERMS[ 2 ]SECOND_CLOSE = FIRST_OPEN === "(" ? FIRST_PAIR : TERMS[ 0 ] OP FIRST_OPEN === "(" ? TERMS[ 2 ] : SECOND_PAIR = FINAL_RESULT
Changing the grouping and evaluating:
SECOND_OPENTERMS[ 0 ]
OPFIRST_OPENTERMS[ 1 ]SECOND_CLOSE
OPTERMS[ 2 ]FIRST_CLOSE = SECOND_OPEN === "(" ? FIRST_PAIR : TERMS[ 0 ] OP SECOND_OPEN ==="(" ? TERMS[ 2 ] : SECOND_PAIR = FINAL_RESULT
We see that moving the parentheses did not affect the final result:
FIRST_OPENTERMS[ 0 ]
OPSECOND_OPENTERMS[ 1 ]FIRST_CLOSE
OPTERMS[ 2 ]SECOND_CLOSE = SECOND_OPENTERMS[ 0 ]
OPFIRST_OPENTERMS[ 1 ]SECOND_CLOSE
OPTERMS[ 2 ]FIRST_CLOSE
Comparing with the original equation, the symbol SYMBOL
could be replaced with the number ANSWER
.
This fact about OP_WORD is known as the associative property.