Exa math var 1

E1.

Describe all values \(x\) within or indlucding the distance of \(2/3\) from the number \(-5\). Use 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 = 3\). \[f(x) = \sqrt{x} + x^2, \quad g(x) = \sqrt{x - 6}, \quad h(x) = x^3 - 5\]


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) = \sqrt{e^{x^3+x}}\]


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) + \log(x - 4) = \frac{\log(x^2)}{2}\\ 2^4 3^4 - (e^x)^4 = 0\]


E6.

For an integer random variable \(X\) with Geometric distribution \(Geom(\mu)\) the pmf is \[p(x) = (1 - \frac{1}{\mu})^{x-1} \, \frac{1}{\mu} \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 (1 - \frac{1}{\mu})^{x_i-1} \, \frac{1}{\mu}\] 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) = 5x^2 - 3x + 2\]


E8.

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

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

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


E9.

In the following exercise each vector \(\mathbf{x_i} \in \mathbb{R}^2\) and scalar \(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?