SOLUTION: Can someone please help me to solve this problem, thank you. A. Program speed, or runtime, is an important concept in computer programming, and it is measured in terms of the nu

Algebra.Com
Question 522923: Can someone please help me to solve this problem, thank you.
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.
o 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.)
o Now, multiply the original (x + 3)(x – 3) polynomial (FOIL). In the new version of the expression (polynomial), how many operations are there?
B. The time it takes to multiply two matrices of size n is determined by the polynomial expression 2n3 – n2. For example, it takes 45 operations to multiply two 3x3 matrices. Compute the number of operations required to run a program that multiplies two matrices of size 20.

Found 2 solutions by oberobic, stanbon:
Answer by oberobic(2304)   (Show Source): You can put this solution on YOUR website!
(x+3)(x-3)
x+3 = 1 addition
x-3 = 1 subtraction
(x+3)*(x-3) = 1 multiplication
So, that is 3 operations
...
(x+3)(x-3) = x^2 -3x +3x -9 = x*x -3*x +3*x -9
x*x = 1 multiplication
-3*x = 1 subtraction and 1 multiplication
+3*x = 1 addition and 1 multiplication
-9 = 1 subtraction
So, that is 6 operations
...
2n^3 - n^2 is the number of operations.
n = 20
2(20)^3-20^2 = 15,600 operations

Answer by stanbon(75887)   (Show Source): You can put this solution on YOUR website!
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.
----------------------------------------------------------
o 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.)
Ans: one multiplication; one addition ; one subtraction
-----------------------------------------------------------

o Now, multiply the original (x + 3)(x – 3) polynomial (FOIL). In the new version of the expression (polynomial), how many operations are there?
FOIL gives: x*x-3*x+3*x-3*3
4 multiplications; 2 subtractions; one addition
----------------------------------------------------------
B. The time it takes to multiply two matrices of size n is determined by the polynomial expression 2n^3 – n^2. For example, it takes 45 operations to multiply two 3x3 matrices. Compute the number of operations required to run a program that multiplies two matrices of size 20.
---
2*20^3-20^2 = 15,600 operations
--------------------------------------
Cheers,
Stan H.
===========

RELATED QUESTIONS

Write an equation that can be used to solve the problem. Solve the equation and answer... (answered by lwsshak3)
Suppose you have the following sequence of runtime for an operation: 3, 6, 11, 18, 27,... (answered by rothauserc)
I need to know how to write a polynomial equation of least degree with roots -3i, 3i, i, (answered by scott8148)
Can someone please help me with this problem? I need to use the concept of slope to... (answered by funmath)
Can someone please help me solve this problem? What is the percentage increase from... (answered by stanbon,Edwin McCravy)
Someone PLEASE HELP me solve this inequality problem ! ~ Graph the inequality x + y is (answered by solver91311,MathLover1,lynnlo)
Hello! I was wondering if anybody could help me solve this equation. I really don't... (answered by ewatrrr,josmiceli)
Can someone please help me with this problem 5x+5y=-7 7x-3y=19 It says to solve the... (answered by Alan3354)
Can someone please help me solve this problem? 3-a-4/a+3=a^2-2/a+3 Thank... (answered by ankor@dixie-net.com)