Algorithms

Harold Nelson

3/4/2019

Definition

An algorithm is a finite sequence of precise instructions for performing a computation or for solving a problem.

Example: Matrix Multiplication

See https://code.fandom.com/wiki/Matrix_multiplication

Exercise:

Review the problem from the quiz. Count the addition and multiplication steps.

Example: Gauss-Jordan

See http://www.csun.edu/~panferov/math262/262_rref.pdf

Exercise

Use this algorithm to do the problem on last weeks quiz. Observe the amount of work (Add and Multiply).

Exercise

Create a 2 x 3 matrix and multiply it by a constant. How much work did you do? Generalize.

Exercise

Create a pair of 3 x 2 matrices and add them. How much work did you do? Generalize.

Exercise

Compute the sum of the first 7 integers. Count the work you did. Generalize.

Exercise

Evaluate the polynomial \[ 3x^5 +2x^4+5x^3+6x^2+10x+1\] at \(x=2\). Count the adds and multiplies. Generalize.

Exercise

Write an algorithm that would enable a person who understands only addition, multiplication, and array reference to evaluate a ploynomial.