A hyperbola with focus of a conic , directrix of a conic not containing , and eccentricity is the locus
Put and . For and , the defining equality becomes
Both sides are nonnegative, so squaring is reversible. Expanding and cancelling the linear terms gives
Thus the two matched focus of a conic and directrix of a conic choices, related by reflection, are
The signs in each pair must agree.
On the hyperbola, . As ,
Hence the perpendicular distance to one of the two straight lines tends to zero on each end of a branch. The asymptotes are therefore
Choose the first orthonormal basis vector to be . If is not parallel to , choose along ; otherwise choose any unit vector orthogonal to . Complete to an orthonormal basis with . The matrix with rows is an orthogonal matrix, and expressing the three unit vectors in this basis gives
The last two components of have polar coordinates of the displayed form; we may choose . If they vanish, is arbitrary.
An orthogonal transformation preserves dot products. Taking dot products with , and then using the unit Euclidean norms, gives
The remaining dot product gives
An orthogonal matrix has determinant , so it preserves the absolute scalar triple product. In the new coordinates this scalar triple product is . Consequently
Taking the nonnegative square root proves
No division by or was used, so the proof includes parallel vectors. Equivalently, the expression under the square root is the Gram determinant of the three unit vectors.
A real square matrix is an orthogonal matrix when
Here is the transpose and the identity matrix; equivalently, its columns form an orthonormal basis. If this holds, the squared Euclidean norm obeys
so the linear transformation preserves length.
Conversely, suppose for every vector . Put , a symmetric matrix. Then for every vector. Taking , the standard basis vectors, gives . Taking for gives . Thus , proving that the linear transformation preserves length if and only if is an orthogonal matrix.
The scalar product, also called the dot product, and the vector product, also called the cross product, are
For nonzero vectors, let be their angle. Their Euclidean norms satisfy
The cross product is orthogonal to both vectors, with its orientation determined by the right-hand rule. If either vector is zero, both products vanish, although the angle is undefined.
Sort the distinct observations as . For ordered centres , a point is closer to than to precisely when it lies to the left of their midpoint. Thus each Voronoi cell is an interval, with either choice allowed for an endpoint tie. Consequently, after assignment, each nonempty cluster is a contiguous block of the sorted observations.
The arithmetic means of disjoint ordered blocks are strictly ordered, so updating centres preserves this order. The empty-cluster repair in part (b) preserves contiguous blocks too: an observation farthest from its assigned centre lies at an endpoint of its block, and removing that endpoint makes a new singleton block. In one dimension with distinct observations, choosing distinct observations as initial centres makes the first assignment nonempty.
The one-dimensional K-means iteration bound now follows by counting block partitions. Choosing the gaps between consecutive nonempty blocks gives
possibilities. By the strict-decrease argument in part (b), no such partition can recur before algorithm termination. Counting a step as an assignment, any empty-cluster repairs, and a centre update, with the stability check performed after that update, gives
For , one update to the overall arithmetic mean suffices. Arbitrary changes between tied centres would invalidate the strict-decrease argument, which is why the stable tie convention in part (b) matters.
Write for row of the data matrix. The k-means clustering objective is the within-cluster sum of squared Euclidean distances:
The nonempty form a partition of a set of observation indices. For fixed clusters, part (a) shows that the best is their centroid.
Initialize distinct centres, for example by choosing distinct observations. Then repeat the following steps:
  • Assign each observation to a nearest centre in Euclidean distance. Keep its current assignment on an exact tie; for a previously unassigned observation use a fixed ordering to resolve ties.
  • If a cluster is empty, choose an observation from a cluster with at least two members and make it the empty cluster's sole member, placing its centre at that observation. A definite rule is to choose an eligible observation farthest from its currently assigned centre, breaking ties by observation index. Repeat until all clusters are nonempty.
  • Replace each centre by the arithmetic mean of its assigned observations.
  • After updating, check whether every observation is still assigned to a nearest updated centre, retaining its assignment on ties. If so, stop; otherwise repeat.
The empty-cluster repair is possible for and cannot increase : the transferred observation now has squared distance zero, while all other squared distances stay unchanged before the centre update.
Assignment cannot increase , and any changed assignment strictly decreases it under the tie rule. Updating centres cannot increase by the centroid sum-of-squares identity. After an update, the centres are determined by the partition of a set. There are only finitely many possible assignments. Unless this is the initial round, any nonterminal round starts with an assignment that strictly reduces ; repairing empty clusters and updating cannot undo that decrease. Thus a partition cannot recur, proving finite termination of K-means clustering. The final result need not be a global minimum; different initial centres can lead to different final clusterings.
Use the corrected decomposition
The hint's minus sign before is a typographical error. Squaring, summing, and using for each coordinate gives the centroid sum-of-squares identity
Since and , the final term is strictly positive. Hence
Thus the centroid uniquely minimizes the sum of squared Euclidean distances to the observations.
The log-likelihood function for the Laplace distribution is
Thus maximum likelihood estimation is equivalent to minimizing the sum of absolute values. Write and sort the data as . Between observations, if values lie to the left of , the derivative of is . It is negative before the middle observation and positive after it. The minimum occurs at the sample median:
This minimizer remains unique for odd even when some observations coincide, since fewer than half the observations can lie strictly on either side of the middle value.

Pinned article: Introduction to the OurBigBook Project

Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
We have two killer features:
  1. topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculus
    Articles of different users are sorted by upvote within each article page. This feature is a bit like:
    • a Wikipedia where each user can have their own version of each article
    • a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
    This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.
    Figure 1.
    Screenshot of the "Derivative" topic page
    . View it live at: ourbigbook.com/go/topic/derivative
  2. local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:
    This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
    Figure 5. . You can also edit articles on the Web editor without installing anything locally.
    Video 3.
    Edit locally and publish demo
    . Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.
  3. https://raw.githubusercontent.com/ourbigbook/ourbigbook-media/master/feature/x/hilbert-space-arrow.png
  4. Infinitely deep tables of contents:
    Figure 6.
    Dynamic article tree with infinitely deep table of contents
    .
    Descendant pages can also show up as toplevel e.g.: ourbigbook.com/cirosantilli/chordate-subclade
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact