Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a.Program speed, or runtime, is an important concept in computer programming, an

ID: 3105514 • Letter: A

Question

a.Program speed, or runtime, is an important concept in computer programming, and it is measured in terms of the number of mathematical operations made during one run of the program. For example, the expression x3 – 2x + 3 has five operations. If we write it as x*x*x – 2*x + 3, we see that there are three multiplications, one addition, and one subtraction.
?If you had to compute the polynomial (x + 3)(x – 3) for a certain value of x (the actual value of x does not matter), how many mathematical operations (addition, subtraction, multiplication, or division) would be made? (Count the number of each type of operation you see in the expression.)
?Now, multiply the original (x + 3)(x – 3) polynomial (FOIL). In the new version of the expression (polynomial), how many operations are there?

Explanation / Answer

All you need to do is count the number of operations.

In (x+3)(x-3), there is one addition, one subtraction, and one multiplication, therefore there are 3 operations.

Multiplying out you get x2+3x-3x-9, or rather x2-9. Rewriting as x*x-9, we see that there are only 2 operations: one multiplication and one subtraction.