Do you understand what "concatenation", "associative", and "commutative" mean? Given two lists, say A= "abcd" and B= "1234" their "concatenation" is AB= "abcd1234".
An operation is "associative" if (AB)C= A(BC). The differences are that, on the left, we combine A and B first, then add C to that. On the right, we combine B and C first, then add A to that.
An operation is "commutative" if AB= BA. That is, it does not matter which we have on the left and right.
Suppose A= "abcd" and B= "1234". Then AB= "abcd1234" and BA= "1234abcd". Are those the same string? Is concatenation "commutative"?
Suppose A= "abcd", B= "1234", and C= "x5y9z". Then AB= "abcd1234" so (AB)C= "abcd1235x5y9z" while BC= "1234x5y9z" so A(BC)= "abcd1234x5y9z". Are those the same string? Is concatenation "associative"?
- - - Updated - - -
Do you understand what "concatenation", "associative", and "commutative" mean? Given two lists, say A= "abcd" and B= "1234" their "concatenation" is AB= "abcd1234".
An operation is "associative" if (AB)C= A(BC). The differences are that, on the left, we combine A and B first, then add C to that. On the right, we combine B and C first, then add A to that.
An operation is "commutative" if AB= BA. That is, it does not matter which we have on the left and right.
Suppose A= "abcd" and B= "1234". Then AB= "abcd1234" and BA= "1234abcd". Are those the same string? Is concatenation "commutative"?
Suppose A= "abcd", B= "1234", and C= "x5y9z". Then AB= "abcd1234" so (AB)C= "abcd1235x5y9z" while BC= "1234x5y9z" so A(BC)= "abcd1234x5y9z". Are those the same string? Is concatenation "associative"?
- - - Updated - - -
Do you understand what "concatenation", "associative", and "commutative" mean? Given two lists, say A= "abcd" and B= "1234" their "concatenation" is AB= "abcd1234".
An operation is "associative" if (AB)C= A(BC). The differences are that, on the left, we combine A and B first, then add C to that. On the right, we combine B and C first, then add A to that.
An operation is "commutative" if AB= BA. That is, it does not matter which we have on the left and right.
Suppose A= "abcd" and B= "1234". Then AB= "abcd1234" and BA= "1234abcd". Are those the same string? Is concatenation "commutative"?
Suppose A= "abcd", B= "1234", and C= "x5y9z". Then AB= "abcd1234" so (AB)C= "abcd1235x5y9z" while BC= "1234x5y9z" so A(BC)= "abcd1234x5y9z". Are those the same string? Is concatenation "associative"?