Contents    Page-10    Prev    Next    Page+10    Index   

Associative and Commutative

An operation ° is associative if a ° ( b ° c) = ( a ° b ) ° c.

An operation ° is commutative if a ° b = b ° a.

If an operation ° is both associative and commutative, then the arguments of the operation can be in any order, and the result will be the same. For example, the arguments of integer + can be in any order.

This gives great freedom to process the arguments of a function independently on multiple processors.

In many cases, parts of the operation (e.g. partial sums) can be done independently as well.