**This is an old revision of the document!** ----
====== Math 445 lab 5: programming basics ====== **Problem 1:** Write a **for** loop that will print statements of the form <code> 1 times pi is 3.1416 2 times pi is 6.2832 </code> for the numbers 1 through 10. **Problem 2:** If $F$ is a temperature in Farenheit, then $C = \frac{5}{9}(F-32)$ is the same temperature in Celsius. Write a function ''farenheit2celsius'' that takes a Celsius temperature as input, converts it to Celsius, prints a statement of the form ''20 degrees Farenheit is -6.6667 Celsius.'', and returns the Celsius value as its output. **Problem 3:** Write a function ''average'' that takes an input vector $x$ and computes the average (mean) value of its components, according to the formula <latex> \text{average}(x) = \frac{1}{N} \sum_{i=0}^n x_i <\latex> **Problem 4:** The formula for matrix-vector multiplication $y = Ax$ is <latex> y_i = \sum_{j=1}^n A_{ij} x_j </latex> In this formula, $A$ is an $m \times n$ matrix, $x$ is an $n$-dimensional column vector, and $y$ is an $m$-dimesional column vector. Write a