{
  "schema": "ml-prep/item@1",
  "item": {
    "id": "original-ml-kmeans",
    "area": "machine-learning",
    "topic": "unsupervised-learning",
    "origin": "original",
    "title": "One k-means assignment and update",
    "skills": [
      "k-means",
      "clustering-objective"
    ],
    "priority": "core",
    "difficulty": "easy",
    "estimated_minutes": 7,
    "prerequisites": [
      "squared-distance"
    ],
    "prompt": "For one-dimensional points $\\{0,2,8,10\\}$ and initial centers $0$ and $10$, perform one assignment and center-update step. Give the new centers and the within-cluster sum of squared distances after the update.\n",
    "answer": "The clusters are $\\{0,2\\}$ and $\\{8,10\\}$; the new centers are $1$ and $9$. The objective is\n\n$$1+1+1+1=4.$$\n",
    "check": {
      "kind": "numeric",
      "id": "original-ml-kmeans",
      "values": [
        1,
        9,
        4
      ]
    }
  }
}