Unsupervised Learning MCQs for NSCT
Unsupervised learning finds structure in data that has no target labels: groups of similar points (clustering) or a few directions that capture most of the variation (dimensionality reduction). It is topic 8 of the AI, Machine Learning & Data Analytics area, which carries 10% of the NSCT according to HEC's Areas of Competencies. Candidates averaged 50.8% accuracy in this area in 2026, per the HEC NSCT report and APP.
Expect calculations: a centroid update, a linkage distance or a variance ratio. The eigenvector maths behind PCA is in Mathematical Foundations.
K-means
K-means splits n points into k clusters, with k chosen in advance. It minimises the within-cluster sum of squares (WCSS, also called inertia): the total squared distance from each point to its cluster's centroid. Lloyd's algorithm repeats two steps until nothing changes:
- Assign each point to its nearest centroid.
- Update each centroid to the mean of its points.
Example: points (1,1), (2,1), (4,3), (5,4) with starting centroids (1,1) and (5,4). The first two points join (1,1) and the last two join (5,4), so the new centroids are (1.5, 1) and (4.5, 3.5), with WCSS = 0.25 + 0.25 + 0.5 + 0.5 = 1.5.
The result depends on the starting centroids, so k-means++ spreads them out and libraries run several restarts. To choose k, look for the elbow in WCSS against k, or use the silhouette s = (b - a)/max(a, b). Here a is the mean distance to the point's own cluster and b the mean distance to the nearest other cluster.
Exam angle: k-means draws straight boundaries between centroids, so it fails on rings or moon shapes, and unscaled features distort its distances.
Hierarchical clustering
Agglomerative (bottom-up) clustering starts with every point alone and repeatedly merges the closest pair of clusters. Divisive clustering works top-down. The merge history is drawn as a dendrogram, and cutting it at a chosen height gives the clusters, so k is not needed in advance.
| Linkage | Cluster distance | Tendency |
|---|---|---|
| Single | Minimum pairwise distance | Chaining, long thin clusters |
| Complete | Maximum pairwise distance | Compact clusters |
| Average | Mean pairwise distance | In between |
| Ward | Smallest increase in WCSS | Compact, similar-sized clusters |
Example: for A = {1, 2} and B = {6, 9}, the pairwise distances are 5, 8, 4 and 7. Single linkage gives 4, complete gives 8 and average gives 6.
Exam angle: naive agglomerative clustering needs an n x n distance matrix, so it does not scale to millions of points.
PCA
Principal component analysis centres the data (and usually standardises it), then finds the eigenvectors of the covariance matrix. Each eigenvector is a principal component, and its eigenvalue is the variance along it. The explained variance ratio of a component is its eigenvalue divided by the sum of all eigenvalues.
Example: covariance [[2, 1], [1, 2]] has eigenvalues 3 and 1, so PC1, along (1, 1)/sqrt 2, explains 3/4 = 75%. With eigenvalues 5, 3, 1, 0.6 and 0.4, the cumulative ratios are 50%, 80%, 90%, 96% and 100%, so 3 components keep 90%.
Exam angle: PCA ignores labels, so the highest-variance direction is not always the one that separates classes; linear discriminant analysis (LDA) is the supervised alternative.
Other methods you may see
DBSCAN grows clusters from core points, which have at least minPts neighbours within radius eps. It finds clusters of any shape and labels isolated points as noise. Association rules rank item sets by support, confidence and lift, where lift = confidence / support(consequent) and a value below 1 means negative association.
Common traps
- Mixing up k-means (k clusters, unsupervised) with k-NN (k neighbours, supervised).
- Picking the k with the lowest WCSS. WCSS always falls as k rises and reaches 0 when k = n.
- Swapping single and complete linkage: single is the minimum distance, complete the maximum.
- Running k-means or PCA on unscaled features, so the feature with the biggest range dominates.
- Quoting a component's own ratio when the question asks for the cumulative variance kept.
- Treating high rule confidence as proof of association without checking lift.
Worked examples
1. Understanding. Which linkage is most likely to produce long, chain-like clusters? Answer: single linkage. Merging on the minimum distance lets two clusters join through one close pair of points, even if the rest are far apart.
2. Application. One-dimensional k-means runs on 2, 4, 10, 12 with starting centroids 2 and 4. Where does it converge? Answer: 3 and 11. First pass: {2} and {4, 10, 12}, giving centroids 2 and 8.67. Second pass: 4 is now nearer 2, giving {2, 4} with mean 3 and {10, 12} with mean 11. A third pass changes nothing.
3. Analysis. PCA gives eigenvalues 6, 2, 1 and 1. A team needs at least 80% of the variance. How many components should it keep? Answer: 2. The total is 10, and the cumulative ratios are 60%, 80%, 90% and 100%. Two components reach exactly 80%; keeping three wastes a dimension for only 10% more.
Practise
The quiz below has 100 Unsupervised Learning questions, filterable by tier and difficulty.
Practise: 100 questions
FAQs
What is the difference between supervised and unsupervised learning?
Supervised learning trains on inputs paired with known targets and learns to predict them, as in regression and classification. Unsupervised learning has inputs only and looks for structure, such as clusters or low-dimensional directions. Clustering results are judged by internal measures such as silhouette, because there is no ground truth.
How do you choose k in k-means?
Plot WCSS against k and pick the elbow where the drop flattens, or choose the k with the highest average silhouette score. The gap statistic and domain needs, such as the number of customer segments a team can act on, are also common. Never pick the k with the lowest WCSS.
Is PCA a clustering algorithm?
No. PCA is dimensionality reduction: it replaces the original features with fewer uncorrelated components ordered by variance. It is often run before clustering, to remove noise or to plot data in two dimensions, but it never assigns points to groups.
When should I use DBSCAN instead of k-means?
Use DBSCAN when clusters have irregular shapes, when you do not know k, or when you want outliers labelled as noise. Stay with k-means for large datasets with roughly round clusters. DBSCAN struggles when cluster densities differ a lot, because one eps value must suit them all.
Next step
Continue with Model Evaluation & Validation MCQs, revisit Ensemble Learning, go back to the AI & ML MCQ hub, or try an NSCT mock test.