Exa math v2

E1.

Describe all values \(x\) whos distance from the number \(4/5\) is at least \(3\). 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 = -1\). \[f(x) = x^2 + \log(x), \quad g(x) = \frac{1}{x}, \quad h(x) = x+3\]


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


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\). \[2\log(5) = \log(x^2 - 3x) - \log(x)\\ \frac{e^2}{e^{-x}} - 25 = 0\]


E6.

For an integer random variable \(X\) with Poisson distribution \(Poisson(\lambda)\) the pmf is \[p(x) = \frac{\lambda^x e^{-\lambda}}{x!} \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{\lambda^x_i 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.

Hint: You will need to write the factorial \(x!\) as a product and then use the log rules. Do not panic, there is nothing wrong with having \(x\) as the start or end value of the product or the sum.


E7.

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

\[f(x) = (15x - 8)(x-2)\]


E8.

Find the derivative of the function \[f(x) = \tanh( 4x^2 - 3x + 3 ) \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 \(\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?