Exa math v4

E1.

Graph on the real line the solution set of \(|x + 1| \leq \frac{5}{2}\).


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) = \frac{x^2 + 2}{x-1}, \quad g(x) = \log(x), \quad h(x) = x+2\]


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


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


E6.

For a one-hot encoding \(\mathbf{X} = (X_1, X_2, \ldots, X_k)^T\) random variable such that exatly one of the \(X_i = 1\) (e.g. \(\mathbf{x} = (0,0,1,0, \ldots, 0)^T, \ \sum_i^k x_i = 1\)) with multinouilli distribution \(Mult(\mathbf{\mu})\) the pmf is \[p(\mathbf{x}) = \prod_{i=1}^k \mu_i^{x_i} \enspace .\] For a random sample of size \(n\) from this distribution the likelihood function is \[l(\mathbf{x}) = \prod_{j=1}^n \prod_{i=1}^k \mu_i^{x_{ji}} \enspace .\] Find the log likelihood function \(\log l(\mathbf{x})\) and simplify it to a sum of terms without any exponents.

Hint: First swap the order of the products and use the rule \(a^x a^y = a^{x+y}\) to move the product over \(j\) as a sum into the exponent. Then apply the log rules.


E7.

For the function \(f\) find \(\text{argmax } f(x)\) and \(\max f(x)\)

\[f(x) = (-3x + 3)(x-2)\]


E8.

Find the derivative of the function \[f(x) = Lrelu(\frac{x^2}{2} - 2x) \enspace ,\] where \[Lrelu(x) = \begin{cases} 0.001x & \text{ for } x<0 \\ x & \text{ for } x \geq 0 \\ \end{cases}\] is the leaky relu funciton with derivative \[Lrelu'(x) = \begin{cases} 0.001 & \text{ for } x<0 \\ 1 & \text{ for } x \geq 0 \\ \end{cases}\]

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

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


E9.

In the following exercise \(\mathbf{y} \in \mathbb{R}^3\) is a vector of observations of data (konwn and fixed constants) and \(\mathbf{s} \in \mathbb{R}^3\) is a vector of parameters of the function \(f(\mathbf{s})\).

  1. Find the partial derivatives of the function \(f\) with respect to the elements of the vector \(\mathbf{s}\).

\[f(\mathbf{s}) = - \sum_{i=1}^3 y_i \log(\sigma(s_i)) + (1- y_i) \log(1- \sigma(s_i))\] Note: \(\sigma(x)\) is the logistic sigmoid \(\sigma(x) = \frac{1}{1 + e^{-x}}\) with derivative \(\sigma'(x) = \sigma(x) (1 - \sigma(x))\).

Find the partial derivatives for these specific values of observations \[\mathbf{y} = (0, 1, 1)\]

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

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