3.6 Practice Problems
- What is \(24/3 + 5^2 - (8 -4)\)?
 - What is \(\sum_{i = 1}^5 (i*3)\)?
 - Take the derivative of \(f(x) =v(4x^2 + 6)^2\) with respect to \(x\).
 - Take the derivative of \(f(x) = e^{2x + 3}\) with respect to \(x\).
 - Take the derivative of \(f(x) = log (x + 3)^2\) with respect to \(x\).
 
Given \(X\) is an \(n\) x \(k\) matrix,
- \((X^{T}X)^{-1}X^{T}X\) can be simplified to?
 - \(((X^{T}X)^{-1}X^{T})^{T} =\) ?
 - If \(\nu\) is a constant, how does \((X^{T}X)^{-1}X^{T} \nu X(X^{T}X)^{-1}\) simplify?
 - If a matrix \(P\) is idempotent, \(PP =\) ?
 
3.6.1 Practice Problem Solutions
- What is \(24/3 + 5^2 - (8 -4)\)?
 
24/3 + 5^2 - (8 -4)[1] 29
- What is \(\sum_{i = 1}^5 (i*3)\)?
- By hand: \(1 \times 3 + 2 \times 3 + 3 \times 3 + 4 \times 3 + 5 \times 3\)
 
 
## sol 1
1*3 + 2*3 + 3*3 + 4*3 + 5*3[1] 45
## sol 2
i <- 1:5
sum(i*3)[1] 45
- Take the derivative of \(f(x) =v(4x^2 + 6)^2\) with respect to \(x\).
- We can treat \(v\) as a number.
 
 
\[\begin{align*} f'(x) &= 2* v(4x^2 + 6) * 8x\\ &= 16vx(4x^2 + 6) \end{align*}\]
- Take the derivative of \(f(x) = e^{2x + 3}\) with respect to \(x\).
 
\[\begin{align*} f'(x) &= 2* e^{2x + 3}\\ &= 2e^{2x + 3} \end{align*}\]
- Take the derivative of \(f(x) = log (x + 3)^2\) with respect to \(x\).
- Note we can re-write this as \(2 * log (x + 3)\).
 
 
\[\begin{align*} f'(x) &= 2 * \frac{1}{(x + 3)} * 1\\ &= \frac{2}{(x + 3)} \end{align*}\] If we didn’t take that simplifying step, we can still solve:
\[\begin{align*} f'(x) &= \frac{1}{(x + 3)^2} * 2 * (x + 3) *1\\ &= \frac{2}{(x + 3)} \end{align*}\]
Given \(X\) is an \(n\) x \(k\) matrix,
- \((X^{T}X)^{-1}X^{T}X\) can be simplified to?
- \(I_k\) the identity matrix
 
 - \(((X^{T}X)^{-1}X^{T})^{T} =\) ?
- Recall our rule \((AB)^T = B^TA^T\)
 - \(X(X^TX)^{-1}\)
 
 - If \(\nu\) is a constant, how does \((X^{T}X)^{-1}X^{T} \nu X(X^{T}X)^{-1}\) simplify?
- We can pull it out front.
 
 
\[\begin{align*} &= \nu(X^{T}X)^{-1}X^{T}X(X^{T}X)^{-1} \\ &= \nu (X^{T}X)^{-1} \end{align*}\]
- If a matrix \(P\) is idempotent, \(PP =\) ?
- \(P\) from section 3.5.2