- Year not given
K-means on eight points into 3 clusters
Short answer
K-means with Euclidean distance, initial centroids A1(2,10), A4(5,8), A7(1,2). After 4 iterations: Cluster 1 = {A1,A4,A8} centroid (3.67,9); Cluster 2 = {A3,A5,A6} centroid (7,4.33); Cluster 3 = {A2,A7} centroid (1.5,3.5). Algorithm converged with no further assignment changes.
Use K-means algorithm and Euclidean distance to cluster the following 8 examples into 3 clusters: A1=(2, 10), A2=(2, 5), A3=(8, 4), A4=(5, 8), A5=(7, 5), A6=(6, 4), A7=(1, 2), A8=(4, 9)
K-means with Euclidean distance d = √[(x₂ − x₁)² + (y₂ − y₁)²], k = 3.
Assumption: the initial centroids are A1 = (2, 10), A4 = (5, 8) and A7 = (1, 2) (the choice is not given in the question).
Iteration 1 (C1 = (2, 10), C2 = (5, 8), C3 = (1, 2))
| Point | d to C1 | d to C2 | d to C3 | Cluster |
|---|---|---|---|---|
| A1 (2, 10) | 0.00 | 3.61 | 8.06 | C1 |
| A2 (2, 5) | 5.00 | 4.24 | 3.16 | C3 |
| A3 (8, 4) | 8.49 | 5.00 | 7.28 | C2 |
| A4 (5, 8) | 3.61 | 0.00 | 7.21 | C2 |
| A5 (7, 5) | 7.07 | 3.61 | 6.71 | C2 |
| A6 (6, 4) | 7.21 | 4.12 | 5.39 | C2 |
| A7 (1, 2) | 8.06 | 7.21 | 0.00 | C3 |
| A8 (4, 9) | 2.24 | 1.41 | 7.62 | C2 |
C1 = {A1}, C2 = {A3, A4, A5, A6, A8}, C3 = {A2, A7}. New centroids: C1 = (2, 10); C2 = ((8 + 5 + 7 + 6 + 4)/5, (4 + 8 + 5 + 4 + 9)/5) = (6, 6); C3 = ((2 + 1)/2, (5 + 2)/2) = (1.5, 3.5).
Iteration 2 (C1 = (2, 10), C2 = (6, 6), C3 = (1.5, 3.5))
| Point | d to C1 | d to C2 | d to C3 | Cluster |
|---|---|---|---|---|
| A1 | 0.00 | 5.66 | 6.52 | C1 |
| A2 | 5.00 | 4.12 | 1.58 | C3 |
| A3 | 8.49 | 2.83 | 6.52 | C2 |
| A4 | 3.61 | 2.24 | 5.70 | C2 |
| A5 | 7.07 | 1.41 | 5.70 | C2 |
| A6 | 7.21 | 2.00 | 4.53 | C2 |
| A7 | 8.06 | 6.40 | 1.58 | C3 |
| A8 | 2.24 | 3.61 | 6.04 | C1 |
C1 = {A1, A8}, C2 = {A3, A4, A5, A6}, C3 = {A2, A7}. New centroids: C1 = (3, 9.5); C2 = (6.5, 5.25); C3 = (1.5, 3.5).
Iteration 3 (C1 = (3, 9.5), C2 = (6.5, 5.25), C3 = (1.5, 3.5))
| Point | d to C1 | d to C2 | d to C3 | Cluster |
|---|---|---|---|---|
| A1 | 1.12 | 6.54 | 6.52 | C1 |
| A2 | 4.61 | 4.51 | 1.58 | C3 |
| A3 | 7.43 | 1.95 | 6.52 | C2 |
| A4 | 2.50 | 3.13 | 5.70 | C1 |
| A5 | 6.02 | 0.56 | 5.70 | C2 |
| A6 | 6.26 | 1.35 | 4.53 | C2 |
| A7 | 7.76 | 6.39 | 1.58 | C3 |
| A8 | 1.12 | 4.51 | 6.04 | C1 |
C1 = {A1, A4, A8}, C2 = {A3, A5, A6}, C3 = {A2, A7}. New centroids: C1 = (3.67, 9); C2 = (7, 4.33); C3 = (1.5, 3.5).
Iteration 4: with these centroids every point stays in the same cluster (e.g. A4: 1.67 to C1, 4.18 to C2; A2: 1.58 to C3), so the algorithm has converged.
Answer: Cluster 1 = {A1, A4, A8}, centroid (3.67, 9); Cluster 2 = {A3, A5, A6}, centroid (7, 4.33); Cluster 3 = {A2, A7}, centroid (1.5, 3.5).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Cluster analysis; K-means on height/width · Data Mining, chapter 5
- Cluster analysis applications; K-means · Data Mining, chapter 5
- Likelihood and distance; K-means drawbacks · Data Mining, chapter 3
- K-means on six 2-D instances (B65) · Data Mining, chapter 5
- Need of clustering; hierarchical vs partitioning; K-means · Data Mining, chapter 5
- K-means on six 2-D instances (K=2) · Data Mining, chapter 5
- Algorithm and flowchart: distance between points · Computer Programming, chapter 2
- Huffman code for symbols A0 to A4 · Data Communication, chapter 8
- Huffman and Shannon-Fano coding of A0–A4 · Communication Systems, chapter 6
- 8255 mode 1 keyboard and printer with decoding · Instrumentation II, chapter 2