Exa math v5

E1.

Graph on the real line the solution set of \(|x - \frac{1}{4}| > \frac{3}{4}\).


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) = x+2, \quad h(x) = \log(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) = \big(\log(x^2 + 3x) \big)^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) + \log(x^2 + x - 3) = 3\log(x)\\ (e^2)^3 = \sqrt[3]{e^x}\]


E6.

For a continous random variable \(X\) with Normal distribution \(N(\mu, \sigma^2)\) the pdf is \[f(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{(x-\mu)^2}{2\sigma^2}} \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 \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{(x_i-\mu)^2}{2\sigma^2}} \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{argmax } f(x)\) and \(\max f(x)\)

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


E8.

Find the derivative of the function \[f(x) = relu(\frac{e^x}{2} - 3x^2) \enspace ,\] where \[relu(x) = \max(0, x)\] is the relu funciton with derivative \[relu'(x) = \begin{cases} 0 & \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.


E8.

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 \log \big( 1 + e^{- 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}\) and \(\mathbf{x_i}\). Check your notes on linear algebra from the sister course!)

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

  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?