✓ Official Syllabus VerifiedStandards & Rigor ↗
§

Practice set — Part 5 (Q33–Q40)

Fifty applied mathematics problems for AI & Data Science spanning high-dimensional vectors and cosine similarity, neural layer matrix transformations, multivariable calculus and gradient descent optimization, conditional probability and Bayes' theorem, probability distributions and maximum likelihood estimation (MLE), ordinary least squares linear regression, logistic regression and cross-entropy loss, and covariance matrices and Principal Component Analysis (PCA).

33
Consider a dataset where the number of defective items produced by a machine per hour, Y, follows a Poisson distribution with a rate parameter lambda = 3. The probability mass function (PMF) for a Poisson distribution is given by \(P(Y=k) = \frac{\lambda^k e^{-\lambda}}{k!}\) for \(k = 0, 1, 2, \dots\). What is the value of \(\lambda\) in this scenario?
Basic

The problem statement explicitly defines that the number of defective items, \(Y\), follows a Poisson distribution with a rate parameter \(\lambda = 3\). The rate parameter \(\lambda\) is a direct characteristic of the Poisson distribution that determines its mean and variance. Therefore, the value of \(\lambda\) is directly given as 3.

34
Consider a simple linear regression model where a dependent variable \(y\) is predicted from an independent variable \(x\). The model is given by the equation \(y = \beta_0 + \beta_1 x + \epsilon\), where \(\epsilon\) is the error term. Suppose we have estimated the regression line to be \(\hat{y} = 3 + 2x\). If we observe an independent variable value of \(x=4\), what is the predicted value \(\hat{y}\) for the dependent variable?
Basic

The problem asks for the predicted value \(\hat{y}\) given an independent variable value \(x=4\) and a linear regression equation \(\hat{y} = 3 + 2x\). We substitute the value of \(x\) into the equation:

\(\hat{y} = 3 + 2(4)\)
\(\hat{y} = 3 + 8\)
\(\hat{y} = 11\)

Therefore, the predicted value for the dependent variable is 11. Common errors might involve incorrectly multiplying 2 by 4 or incorrectly adding 3 to 8.

35
A centered feature matrix \(\mathbf{X}\) has shape \(N \times 22\). What is the size and symmetry property of the sample covariance matrix \(\mathbf{\Sigma} = \frac{1}{N-1}\mathbf{X}^T\mathbf{X}\)?
Advanced

Since \(\mathbf{X}\) has \(22\) columns, \(\mathbf{X}^T\) is \(22 \times N\) and \(\mathbf{X}^T\mathbf{X}\) is \(22 \times 22\). Furthermore, \((\mathbf{X}^T\mathbf{X})^T = \mathbf{X}^T(\mathbf{X}^T)^T = \mathbf{X}^T\mathbf{X}\), proving it is always symmetric.

36
Consider a linear layer with a weight matrix \(W\) and an input vector \(\mathbf{x}\). If \(W = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\) and \(\mathbf{x} = \begin{pmatrix} 5 \\ 6 \end{pmatrix}\), compute the output vector \(\mathbf{y} = W\mathbf{x}\).
Basic

The output vector \(\mathbf{y}\) is computed by multiplying the weight matrix \(W\) by the input vector \(\mathbf{x}\). This is a standard matrix-vector multiplication.

\(\mathbf{y} = W\mathbf{x} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 5 \\ 6 \end{pmatrix}\)

To compute the first element of \(\mathbf{y}\), we take the dot product of the first row of \(W\) with \(\mathbf{x}\): \((1)(5) + (2)(6) = 5 + 12 = 17\).

To compute the second element of \(\mathbf{y}\), we take the dot product of the second row of \(W\) with \(\mathbf{x}\): \((3)(5) + (4)(6) = 15 + 24 = 39\).

Therefore, the output vector is \(\mathbf{y} = \begin{pmatrix} 17 \\ 39 \end{pmatrix}\).

37
Consider two vectors, \(\mathbf{u} = \begin{pmatrix} 3 \\ -2 \end{pmatrix}\) and \(\mathbf{v} = \begin{pmatrix} -1 \\ 5 \end{pmatrix}\). What is the resultant vector \(\mathbf{w} = \mathbf{u} + \mathbf{v}\)?
Basic

To find the resultant vector \(\mathbf{w} = \mathbf{u} + \mathbf{v}\), we add the corresponding components of the two vectors. \(\mathbf{w} = \begin{pmatrix} 3 \\ -2 \end{pmatrix} + \begin{pmatrix} -1 \\ 5 \end{pmatrix} = \begin{pmatrix} 3 + (-1) \\ -2 + 5 \end{pmatrix} = \begin{pmatrix} 2 \\ 3 \end{pmatrix}\).

38
In training a language model token predictor, a binary token occurs \(k = 15\) times across \(n = 50\) independent trials. What is the Maximum Likelihood Estimate \(\hat{p}_{\text{MLE}}\) of the token probability?
Advanced

For a Bernoulli likelihood \(L(p) = p^k (1-p)^{n-k}\), the log-likelihood is \(\ln L = k\ln p + (n-k)\ln(1-p)\). Setting derivative to zero: \(\frac{k}{p} - \frac{n-k}{1-p} = 0 \implies \hat{p} = \frac{k}{n} = \frac{15}{50} = 0.300\).

39
Consider the following quadratic loss function for a regression problem: \(L(y, \hat{y}) = (y - \hat{y})^2\). If the predicted value \(\hat{y} = 5\) and the true value \(y = 3\), what is the value of the loss function?
Basic

The quadratic loss function is defined as \(L(y, \hat{y}) = (y - \hat{y})^2\). Given the true value \(y = 3\) and the predicted value \(\hat{y} = 5\), we substitute these values into the loss function:

\(L(3, 5) = (3 - 5)^2\)

\(L(3, 5) = (-2)^2\)

\(L(3, 5) = 4\)

Therefore, the value of the loss function is 4.

40
Consider a 2D data point \(\mathbf{v} = \begin{bmatrix} 3 \\ -4 \end{bmatrix}\). What is the squared Euclidean norm (or squared magnitude) of this vector?
Basic

The squared Euclidean norm of a vector \(\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \end{bmatrix}\) is given by \(\|\mathbf{v}\|^2 = v_1^2 + v_2^2\). For the given vector \(\mathbf{v} = \begin{bmatrix} 3 \\ -4 \end{bmatrix}\), the squared Euclidean norm is \((3)^2 + (-4)^2 = 9 + 16 = 25\).

AI-assisted, human-reviewed: Questions and walkthroughs are developed with AI assistance and reviewed by senior educators.Report an error here ↗