Exa math v7

E1.

Describe the values \(x\) plotted in this graph using mathematical notation with inequalities and absolute value.


E2.

For the set of functions below find \((f \circ g \circ h)(x) = f(g(h(x))\) and evaluate the result at \(x = 1\). \[f(x) = x^2 + 2x + 6, \quad g(x) = (x - 6)^2, h(x) = \sqrt{x}\]


E3.

Find functions f(x), g(x) and h(x) so that the function \(y(x)\) can be expressed as \(y(x) = (f \circ g \circ h)(x)= f(g(h(x))\) (there is possibly more than one solution) \[y(x) = e^{\sqrt{3x+1}}\]


E4.

Write the slope-intercept \(y = mx+b\), point-slope \((y - y_1) = m(x-x_1)\) and standard form \(ax + by = c\) of the line in the graph.

E5.

Solve the equations below for x. Do not evaluate the logarithms and exponentials exactly in the final solutions, e.g. leave the solutions as \(x = log(4)\) instead of calculating the value of \(\log(4)=1.386\). \[\log(5) + \frac{\log(x)}{2} = \log(15)\\ \sqrt{e^{-8}} = \frac{1}{e^x e^3}\]


E6.

For a continous random variable \(X\) with Exponential distribution \(Exp(\lambda)\) the pdf is \[f(x) = \lambda e^{-\lambda x}, \quad x \geq 0 \enspace .\] For a random sample \(\mathbf{x}=(x_1, x_2, \ldots, x_n)\) of size \(n\) from this distribution the likelihood function is \[l(\mathbf{x}) = \prod_{i=1}^n \lambda e^{-\lambda x_i} \enspace .\] Find the log likelihood function \(\log l(\mathbf{x})\) and simplify it to a sum of terms without any exponents.


E7.

For the function \(f\) find \(\text{argmin } f(x)\) and \(\min f(x)\)

\[f(x) = (0.5x - 5)(2x-3)\]


E8.

Find the derivative of the function \[f(x) = \tanh( 3x^3 - x) \enspace ,\] where \(\tanh(x)\) is the hyperbolic tangent \(\tanh(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}}\) with derivative \(\tanh'(x) = 1 - (\tanh(x))^2\).

Evaluate the derivative at \(x = 1\).

Use the finite difference approximation of the derivative to verify your above result.


E9.

In the following exercise all vectors \(\mathbf{x_i} \in \mathbb{R}^2\) and scalars \(y_i \in \mathbb{R}\) are observations of data (konwn and fixed constants) and \(\mathbf{w} = (w_1, w_2)\) is a vector of parameters of the function \(f(\mathbf{w})\).

  1. Find the partial derivatives of the function \(f\) with respect to the elements of the vector \(\mathbf{w} = (w_1, w_2)\).

\[f(\mathbf{w}) = \sum_{i=1}^3 \max\big(0, 1 - y_i \, \mathbf{w}^T \mathbf{x}_i \big)\] (Note: \(\mathbf{w}^T \mathbf{x}_i\) is the inner product of the vectors \(\mathbf{w}\) (check your notes on linear algebra from the sister course!)) and \(\max(0,x)\) function has tha derivative \[ \max'(x) = \begin{cases} 0 & \text{ for } x \leq 0 \\ 1 & \text{ for } x > 0 \end{cases} \]

Find the partial derivatives for these specific values of observations \[\mathbf{x_1} = (1, 2), \quad y_1 = -1\\ \mathbf{x_1} = (0, 3), \quad y_2 = -1\\ \mathbf{x_1} = (-1, 0), \quad y_3 = 1\\\]

  1. Find the gradient \(\nabla f(\mathbf{w})\) of the function at the point \(\mathbf{w} = (0.5,0.2)\).

  2. Evaluate the function at the point \(\mathbf{w} = (0.5, 0.2)\) and the point \(\mathbf{w} - 0.1 \nabla f(\mathbf{w})\). Which of these is bigger?