Let's say we had to evaluate the following string of multiplications $5 \times 6 \times 7 \times 8$ , we could, for instance, order it by doing the biggest multiplications first:
$$ 5 \times \left( 6 \times \left( 7 \times 8 \right) \right)$$
Or, we could do it the other way bracketting from the smallest:
$$\left( (5 \times 6) \times 7 \right) \times 8$$
In general, would it be possible to say which one would involve a more number of computational steps? If no general can be given, share insight on why?
I'll try to explain computational steps using examples. Consider the following product:
$$ \text{ }56 \\ \times 2$$
We'd have one step for multiplying $2$ by $6$ , and another for multiplying $2$ by $5$ and finally one step for adding over the carry over from $2$ by $6$ (which is 1). Hence total of three steps.
If we had the produce $11 \times 12$, we'd have four multiplication steps, which give us two numbers to add $22$ and $110$. Now for adding, we'd have three steps since we'd have to add ones place, tens place and hundreds place.
So, total seven steps.
Notes:
I consider multiplication between any two number less than or equal to size ten as one step.
Multiplication by a zero takes no steps. Eg:10x1 is 1 step, 110x2 is 2 step and so on.
In the addition step following a multiplication, the additions are considered till largest place value of the numbers resulted out of multiplication. For eg, in 11x12 , we consider it till hundreds due to 110
If the numbers and the product are all "small" (magnitude less than $2^{63}$); the order doesn't matter at all; the multiplication will take time linear in the number of factors as it simply requires one
IMULoperation per factor.If the numbers are large and you use the standard (elementary school) multiplication algorithm, the order also doesn't matter. The standard multiplication algorithm requires $O(d_1d_2)$ operations to multiply a $d_1$-digit number by a $d_2$-digit number, and the result will have $d_1+d_2$ digits. If you have three numbers $n_1, n_2, n_3$ with $d_1,d_2,d_3$ digits and multiply the first two together first, you will need $$O(d_1d_2) + O((d_1+d_2)d_3) = O(d_1 d_2 + d_1 d_3 + d_2 d_3)$$ operations, and by the symmetry of the resulting expression you can see that changing the order won't change the cost. You can prove using induction that in general, no matter how you associate the multiplications, multiplying together numbers with $d_1 + d_2 + \cdots + d_k$ digits will require $O\left(\left[\sum_{i=1}^k d_i\right]^2 - \sum_{i=1}^k d_i^2\right)$ operations.
For very large numbers, faster algorithms such as Strassen multiplication will be used. I don't know what order is optimal for these algorithms.