====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:spring-2016:math445:exam1sample [2016/03/01 12:31] gibson |
gibson:teaching:spring-2016:math445:exam1sample [2016/03/02 12:38] (current) gibson |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Math 445 exam 1 example questions ====== | ||
+ | |||
+ | |||
The exam will have around ten questions, some easy, some not so easy. For most questions, you will be asked to answer with Matlab code in correct syntax. E.g. | The exam will have around ten questions, some easy, some not so easy. For most questions, you will be asked to answer with Matlab code in correct syntax. E.g. | ||
Line 5: | Line 8: | ||
**Problem 2:** (slightly tricky) Given a matrix $A$, write one line of Matlab code that convert the $j$th column of $A$ into a row vector and assign it to the variable $x$. | **Problem 2:** (slightly tricky) Given a matrix $A$, write one line of Matlab code that convert the $j$th column of $A$ into a row vector and assign it to the variable $x$. | ||
- | **Problem 3:** (pretty straightforward) Given a vector $v$, write one or two lines of Matlab code that would return all the odd-numbered elements of $v$. | + | **Problem 3:** (pretty straightforward) Given a vector $v$, write one or two lines of Matlab code that would return all the odd-numbered elements of $v$. (By "odd-numbered elements", I mean the elements with odd indices, e.g. $v_1, v_3, \ldots$.) |
**Problem 4:** (moderate) Write Matlab code that defines a function named ''mysin'' that computes $\sin(x)$ using the truncated power series | **Problem 4:** (moderate) Write Matlab code that defines a function named ''mysin'' that computes $\sin(x)$ using the truncated power series | ||
\begin{equation*} | \begin{equation*} | ||
- | \sin(x) \doteq \sum_{n=0}^{10} -1^{2n+1} \frac{x^{2n+1}}{(2n+1)!} | + | \sin(x) \doteq \sum_{n=0}^{10} -1^n \frac{x^{2n+1}}{(2n+1)!} |
\end{equation*} | \end{equation*} | ||
+ | |||
+ | **Note: an earlier version of this problem had an error in the Taylor series of** $\sin x$. | ||
+ | |||
**Problem 5:** (straightforward) Write Matlab code that would solve the system of equations. | **Problem 5:** (straightforward) Write Matlab code that would solve the system of equations. | ||
- | \begin{align*} | + | \begin{eqnarray*} |
3x + y + 2z - 6 &= 0 \\ | 3x + y + 2z - 6 &= 0 \\ | ||
- | 9z - x - 8 &= 0 \\ | + | 9z - x - 8 &= 0 \\ |
5y - 4x - 1 &= 0 | 5y - 4x - 1 &= 0 | ||
- | \end{align*} | + | \end{eqnarray*} |
**Problem 6:** (straightforward) Write a Matlab function that computes the mean (i.e. average) of | **Problem 6:** (straightforward) Write a Matlab function that computes the mean (i.e. average) of | ||
the components of a vector $x$ according to the formula | the components of a vector $x$ according to the formula | ||
- | \begin{align*} | + | \begin{equation*} |
\text{mean}(x) = \frac{1}{N}\sum_{i=1}^{N} x_i | \text{mean}(x) = \frac{1}{N}\sum_{i=1}^{N} x_i | ||
- | \end{align*} | + | \end{equation*} |
where $N$ is the length of the vector. Your function should evaluate this | where $N$ is the length of the vector. Your function should evaluate this | ||
Line 38: | Line 44: | ||
**Problem 9:** Deduce the functional relationship $y(x)$ from this graph. | **Problem 9:** Deduce the functional relationship $y(x)$ from this graph. | ||
- | {{ :gibson:teaching:spring-2016:math445:exam1:semilogy.png?direct&400 |}} | + | {{:gibson:teaching:spring-2016:math445:exam1:semilogy.png?direct&400 |}} |