Mathematical Foundations MCQs for NSCT
Mathematical Foundations is the second topic in the NSCT's AI, Machine Learning & Data Analytics area. It covers the four bits of maths every ML model rests on: linear algebra (vectors and matrices), probability, statistics and gradients. The whole area carries 10% of the test, according to HEC's Areas of Competencies.
Most questions here are short calculations, so they reward practice more than memory. The HEC NSCT report puts 2026 accuracy at 45.1% for application questions and 44.8% for analysis, lower than the 49.5% for understanding. Calculation questions like the ones on this page usually fall into those two harder tiers.
Linear algebra
A vector is an ordered list of numbers, such as one row of features. A matrix is a table of numbers, such as a whole dataset with one row per sample. The core operations:
- Dot product: multiply matching entries and add. [2, 0, 1] . [3, 4, 5] = 6 + 0 + 5 = 11. A neuron's weighted sum is a dot product.
- Matrix product: an (m x n) matrix times an (n x p) matrix gives (m x p). The inner sizes must match. Order matters: AB is usually not equal to BA, although (AB)C = A(BC).
- Transpose: rows become columns, so [[1, 2], [3, 4]] becomes [[1, 3], [2, 4]].
- Determinant and inverse: for [[a, b], [c, d]], det = ad - bc. If det = 0 the matrix is singular and has no inverse.
- Eigenvectors: non-zero vectors v with Av = lambda v. PCA uses the eigenvectors of the covariance matrix, and each eigenvalue is the variance along its direction.
Exam angle: shape questions are free marks. If X is (100 x 3) and w is (3 x 1), then Xw is (100 x 1) but wX is undefined.
Probability
Probability measures how likely an event is, from 0 to 1. The rules you need:
| Rule | Formula | Use |
|---|---|---|
| Addition | P(A or B) = P(A) + P(B) - P(A and B) | Either event |
| Independence | P(A and B) = P(A) P(B) | Unrelated events |
| Conditional | P(A given B) = P(A and B) / P(B) | Updating on information |
| Bayes' theorem | P(A given B) = P(B given A) P(A) / P(B) | Reversing a conditional |
Common distributions are Bernoulli (one yes/no trial), binomial (number of successes in n trials), uniform and normal. Naive Bayes classifiers apply Bayes' theorem directly.
Exam angle: mutually exclusive is not the same as independent. If two events with non-zero probability cannot happen together, knowing one happened tells you the other did not, so they are dependent.
Statistics
Statistics summarises data. Mean is the average, median the middle value after sorting and mode the most frequent value. The median resists outliers; the mean does not. Variance is the average squared distance from the mean, and standard deviation is its square root.
Watch the denominator. For 1, 3 and 5, the mean is 3 and the squared deviations add to 8. Population variance divides by n (8 / 3 = 2.67), while sample variance divides by n - 1 (8 / 2 = 4). Textbooks and libraries differ here: NumPy's np.var uses n by default, while pandas' .var() uses n - 1.
Other ideas that appear: the z-score (x - mean) / sd, the 68-95-99.7 rule for normal data, and Pearson correlation r, which measures only linear association, from -1 to +1.
Exam angle: in a right-skewed distribution, such as incomes, the mean is above the median.
Gradients
A derivative gives the rate of change of a function; a gradient is the vector of partial derivatives for a function of several variables. The gradient points in the direction of steepest increase, so gradient descent updates weights with w = w - learning rate x gradient.
Example: for f(w) = w^2 at w = 2 with learning rate 0.25, the gradient is 2w = 4, so the new w = 2 - 0.25 x 4 = 1. A learning rate that is too large overshoots and can diverge. Backpropagation uses the chain rule to pass gradients back through layers.
Exam angle: know the sigmoid derivative, s(z)(1 - s(z)), which peaks at 0.25 at z = 0. Multiplying many such small values causes vanishing gradients.
Common traps
- Multiplying matrices element-wise when the question asks for the matrix product.
- Assuming AB = BA. Check the order and the inner dimensions every time.
- Confusing P(positive given disease) with P(disease given positive). Low base rates make the second much smaller.
- Dividing by n when the question says "sample" standard deviation, or by n - 1 when it says "population".
- Reading correlation 0 as "no relationship". A perfect curve such as y = x^2 can still give r = 0.
- Adding the shift when scaling: if y = 3x + 5, the standard deviation triples, but the +5 does not change it.
Worked examples
1. Understanding. What can you say about a square matrix whose determinant is 0? Answer: it is singular. It has no inverse, its columns are linearly dependent and at least one eigenvalue is 0.
2. Application. Compute [[2, 1], [0, 3]] multiplied by the vector [1, 2]. Answer: [4, 6]. Row 1 gives 2x1 + 1x2 = 4, and row 2 gives 0x1 + 3x2 = 6.
3. Analysis. 20% of emails are spam. The word "prize" appears in 50% of spam and 5% of genuine emails. An email contains "prize". What is the probability it is spam? Answer: about 71%. By Bayes' theorem, P(spam given prize) = 0.2 x 0.5 / (0.2 x 0.5 + 0.8 x 0.05) = 0.10 / 0.14 = 0.714. The tempting answer, 50%, is P(prize given spam), the reverse conditional.
Practise
The quiz below has 99 questions on this topic, which you can filter by tier and difficulty.
Practise: 99 questions
FAQs
How much maths do I need for the NSCT AI and ML area?
You need working knowledge, not proofs. Be able to multiply small matrices, find a 2 x 2 determinant and inverse, use Bayes' theorem, compute mean, median, variance and standard deviation, and take simple derivatives for a gradient descent step. These skills also come up in later topics such as PCA, Naive Bayes and neural networks.
Why does PCA use eigenvectors?
PCA looks for directions in which the data varies most. The covariance matrix describes how features vary together, and its eigenvectors are exactly those directions. Each eigenvalue gives the variance along its eigenvector, so sorting eigenvalues from largest to smallest ranks the principal components. The share of variance a component explains is its eigenvalue divided by the sum of all eigenvalues.
What happens if the learning rate is too high or too low?
Too high, and each step overshoots the minimum, so the loss bounces around or grows without limit. Too low, and training moves in tiny steps and can take very long to converge. For f(w) = w^2, any learning rate above 1 makes the weights diverge, while very small rates converge slowly.
Next step
Continue with Python for AI & Data Analytics MCQs, the next official topic, or go back to the AI and ML MCQs hub. If you skipped the basics, start with Introduction to AI, ML & Data Analytics. Then check yourself in an NSCT mock test.