ArticleslgStudy

mathematics

Linear separability

Linear separability is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Linear separability rather than just read about it. In short: In Euclidean geometry, linear separability is a property of two sets of points. This is most easily visualized in two dimensions (the Euclidean plane) by thinking of one set of points as being colored blue and the other set of points as being colored red.

Linear separability — main illustration
Linear separability — illustration

Key takeaways

  • Linear separability belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Linear separability to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Linear separability from memory before moving on to harder problems.

Reference excerpt

In Euclidean geometry, linear separability is a property of two sets of points. This is most easily visualized in two dimensions (the Euclidean plane) by thinking of one set of points as being colored blue and the other set of points as being colored red. These two sets are linearly separable if there exists at least one line in the plane with all of the blue points on one side of the line and all the red points on the other side. This idea immediately generalizes to higher-dimensional Euclidean spaces if the line is replaced by a hyperplane. The problem of determining if a pair of sets is linearly separable and finding a separating hyperplane if they are, arises in several areas. In statistics and machine learning, classifying certain types of data is a problem for which good algorithms exist that are based on this concept.

Mathematical definition Let X⊂ℝd be a set of m points and Y⊂ℝd be a set of n points in a d-dimensional Euclidean space. X and Y are linearly separable if they can be "separated" by a d-dimensional hyperplane such that every point in X lies on one side of the hyperplane and every point in Y lies on the other side. The separating hyperplane is composed of points {z∈ℝd:w⊤z+k=0}, where w∈ℝd is the normal vector to the hyperplane and k∈ℝ is a scalar offset. X and Y are linearly separable if there exists a normal vector w and a scalar offset k such that either every point x∈X satisfies w⊤x+k>0 and every point y∈Y satisfies w⊤y+k<0, or every point x∈X satisfies w⊤x+k<0 and every point y∈Y satisfies w⊤y+k>0. Equivalently, two sets are linearly separable precisely when their respective convex hulls are disjoint (colloquially, do not overlap).

Examples Three non-collinear points in two classes ('+' and '-') are always linearly separable in two dimensions. This is illustrated by the three examples in the following figure (the all '+' case is not shown, but is similar to the all '-' case):

However, not all sets of four points, no three collinear, are linearly separable in two dimensions. The following example would need two straight lines and thus is not linearly separable:

Notice that three points which are collinear and of the form "+ ⋅⋅⋅ — ⋅⋅⋅ +" are also not linearly separable.

Number of linear separations Let T(N,K) be the number of ways to linearly separate N points (in general position) in K dimensions, thenT(N,K)={2NK≥N2∑k=0K−1(N−1k)K<NWhen K is large, T(N,K)/2N is very close to one when N≤2K, but very close to zero when N>2K. In words, one perceptron unit can almost certainly memorize a random assignment of binary labels on N points when N≤2K, but almost certainly not when N>2K.

Linear separability of Boolean functions in n variables A Boolean function in n variables can be thought of as an assignment of 0 or 1 to each vertex of a Boolean hypercube in n dimensions. This gives a natural division of the vertices into two sets. The Boolean function is said to be linearly separable provided these two sets of points are linearly separable. The number of distinct Boolean functions is 22nwhere n is the number of variables passed into the function. Such functions are also called linear threshold logic, or perceptrons. The classical theory is summarized in, as Knuth claims. The number of Boolean functions which are linearly separable is only known exactly up to the n=9 case, but the order of magnitude is known quite exactly: it has upper bound 2n2−nlog2n+O(n) and lower bound 2n2−nlog2n−O(n). It is co-NP-complete to decide whether a Boolean function given in disjunctive or conjunctive normal form is linearly separable.

Threshold logic A linear threshold logic gate is a Boolean function defined by n weights w1,…,wn and a threshold θ. It takes n binary inputs x1,…,xn, and outputs 1 if ∑iwixi>θ, and otherwise outputs 0. For any fixed n, because there are only finitely many Boolean functions that can be computed by a threshold logic unit, it is possible to set all w1,…,wn,θ to be integers. Let W(n) be the smallest number W such that every possible real threshold function of n variables can be realized using integer weights of absolute value ≤W. It is known that12nlog⁡n−2n+o(n)≤log2W(n)≤12nlog⁡n−n+o(n)See for a literature review.

Support vector machines

Classifying data is a common task in machine learning. Suppose some data points, each belonging to one of two sets, are given and we wish to create a model that will decide which set a new data point will be in. In the case of support vector machines, a data point is viewed as a p-dimensional vector (a list of p numbers), and we want to know whether we can separate such points with a (p − 1)-dimensional hyperplane. This is called a linear classifier. There are many hyperplanes that might classify (separate) the data. One reasonable choice as the best hyperplane is the one that represents the largest separation, or margin, between the two sets. So we choose the hyperplane so that the distance from it to the nearest data point on each side is maximized. If such a hyperplane exists, it is known as the maximum-margin hyperplane and the linear classifier it defines is known as a maximum margin classifier. More formally, given some training data 𝒟, a set of n points of the form 𝒟={(𝐱i,yi)∣𝐱i∈ℝp,yi∈{−1,1}}i=1n where the yi is either 1 or −1, indicating the set to which the point 𝐱i belongs. Each 𝐱i is a p-dimensional real vector. We want to find the maximum-margin hyperplane that divides the points having yi=1 from those having yi=−1. Any hyperplane can be written as the set of points 𝐱 satisfying 𝐰⋅𝐱−b=0, where ⋅ denotes the dot product and 𝐰 the (not necessarily normalized) normal vector to the hyperplane. The parameter b‖𝐰‖ determines the offset of the hyperplane from the origin along the normal vector 𝐰. If the training data are linearly separable, we can select two hyperplanes in such a way that they separate the data and there are no points between them, and then try to maximize their distance.

See also Clustering (statistics) Hyperplane separation theorem Kirchberger's theorem Perceptron Vapnik–Chervonenkis dimension

References

Illustrations

Linear separability: The existence of a line separating the two types of points means that the data is linearly separable
The existence of a line separating the two types of points means that the data is linearly separable
Linear separability illustration
Linear separability illustration
Linear separability illustration
Linear separability illustration

Worked examples

Example 1 — a first encounter with Linear separability

Start with the simplest possible case. Write down what Linear separability claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Linear separability before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Linear separability ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Linear separability

In research
Linear separability appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Linear separability in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Linear separability is common in secondary-school and first-year university syllabi. It links to neighbouring topics Convex analysis, Geometry, Machine learning, so understanding it makes those chapters shorter.
In everyday life
Look for Linear separability outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Linear separability” →

How to study Linear separability in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Linear separability means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Linear separability out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Linear separability in simple terms?

In Euclidean geometry, linear separability is a property of two sets of points. This is most easily visualized in two dimensions (the Euclidean plane) by thinking of one set of points as being colored blue and the other set of points as being colored red.

Why does Linear separability matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Linear separability?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Linear separability.

Tags

  • Convex analysis
  • Geometry
  • Machine learning

Keep exploring