Note:
The set {x : x > 0}
is read aloud, "the set of all x such that x is
greater than 0." It is read aloud exactly the same way when
the colon : is replaced by the vertical line | as in {x | x > 0}.
General Form:
{formula for elements: restrictions} or
{formula for elements| restrictions}
Examples:
{x: x ≠ 3}
the set of all real numbers except 3
{x | x < 5}
the set of all real numbers less than 5
{x2 | x is a real number}
the set of all real numbers greater than or equal to 0
{2n + 1: n is an integer}
the set of all odd integers (e.g. ..., -3, -1, 1, 3, 5,...).
x = A variable representing a typical element of the set
∣ or : = Read as "such that"; separates the variable from the condition
condition = A rule or property that every element of the set must satisfy
Worked Example
Problem: Write the set of all real numbers between −2 and 6 (not including −2 and 6) in set-builder notation, then list five elements that belong to this set.
Step 1:Identify the variable and the condition. We need all real numbers x that are strictly greater than −2 and strictly less than 6.
−2<x<6
Step 2: Place the variable to the left of the vertical bar and the condition to the right, all inside curly braces.
{x∣−2<x<6}
Step 3:Read the notation aloud: "the set of all x such that x is greater than −2 and less than 6."
Step 4:Verify with sample elements. Numbers like −1,0,3,4.5,5 satisfy −2<x<6, so they belong to the set. Numbers like −2,6,10 do not satisfy the condition, so they are excluded.
Answer:{x∣−2<x<6}. Sample elements include −1,0,3,4.5, and 5.
Another Example
This example differs because it uses a formula (2n) to generate the elements rather than a simple inequality condition on x. It shows how set-builder notation can define a set by transforming a variable.
Problem: Write the set of all even integers in set-builder notation using a formula for the elements.
Step 1:Recognize that every even integer can be written as 2n where n is an integer. For example, n=0 gives 0; n=3 gives 6; n=−2 gives −4.
Step 2: Use the "formula | restriction" form. The formula for elements goes on the left of the bar, and the restriction on the variable goes on the right.
{2n∣n∈Z}
Step 3:Read this as: "the set of all 2n such that n is an integer." The resulting set is {…,−4,−2,0,2,4,6,…}.
Answer:{2n∣n∈Z}, which represents {…,−4,−2,0,2,4,…}.
Frequently Asked Questions
What is the difference between set-builder notation and roster notation?
Roster notation (also called list notation) explicitly lists every element inside curly braces, like {2,4,6,8}. Set-builder notation instead states a rule the elements must follow, like {2n∣1≤n≤4,n∈Z}. Roster notation works well for small, finite sets, while set-builder notation is essential for infinite sets or sets whose elements are easier to describe by a rule.
What does the vertical bar (|) or colon (:) mean in set-builder notation?
Both the vertical bar ∣ and the colon : mean exactly the same thing: "such that." They separate the variable (or formula) on the left from the condition on the right. You may use either symbol; the choice is a matter of style, and both are widely accepted in textbooks.
When do you use set-builder notation instead of interval notation?
Interval notation like (−2,6) works only for continuous subsets of the real number line — intervals with no gaps. Set-builder notation is more flexible: it can describe sets of integers, sets defined by formulas, sets with specific values removed (like {x∣x=3}), or any set whose membership is governed by a condition. If your set is a simple interval on the real line, either notation works, but set-builder notation handles more complex situations.
Set-Builder Notation vs. Interval Notation
Set-Builder Notation
Interval Notation
Form
{x∣condition}
(a,b), [a,b], [a,b), etc.
What it describes
Any set defined by a rule or property
A continuous interval of real numbers
Handles gaps / discrete sets
Yes — e.g., {x∣x=3} or {2n∣n∈Z}
No — only unbroken intervals (unions needed for gaps)
Typical use
Algebra, discrete math, proofs, defining domains
Precalculus, calculus, describing domains on the real line
Example: all reals > 0
{x∣x>0}
(0,∞)
Why It Matters
Set-builder notation appears constantly in algebra and precalculus when you state the domain or range of a function — for instance, writing {x∣x=0} for the domain of f(x)=1/x. It is also the standard language in discrete mathematics and proofs, where you define sets of integers, solutions, or other objects by their properties. Mastering this notation makes it far easier to read and communicate mathematical ideas precisely.
Common Mistakes
Mistake: Forgetting to specify the type of number the variable represents.
Correction:Writing {x∣x>0} usually assumes x is a real number, but if you intend only positive integers you must say so: {x∈Z∣x>0}. Always make the domain of the variable clear when it is not obvious from context.
Mistake: Confusing the formula side with the condition side.
Correction:In {2n+1∣n∈Z}, the expression 2n+1 is the formula that generates elements, and n∈Z is the restriction. Swapping these — writing {n∈Z∣2n+1} — is meaningless because 2n+1 is not a true-or-false condition.
Related Terms
Set — The broader concept set-builder notation describes
Interval Notation — An alternative notation for real-number intervals
Element of a Set — Individual objects that satisfy the set condition
Infinite — Set-builder notation often defines infinite sets
Real Numbers — The most common number set used as the domain
Integers — Frequently used to restrict the variable type
Cardinality — Describes the size of the set being defined