Skip to content

Set

A set records distinct members. Use security screens to understand membership, union, intersection, difference, subsets and empty results without confusing eligibility with weights.

A set is a well-defined collection of distinct objects, called its elements or members. In quant finance, those objects might be securities that pass a screen, dates on a trading calendar, or possible market outcomes. Membership answers a yes-or-no question: does this object belong?

Write x∈Sx\in S when xx belongs to set SS, and x∉Sx\notin S when it does not. Curly braces list members. For example, E={A,B,C}E=\{A,B,C\} contains three hypothetical securities. Order and repeated entries do not change a set:

{A,B,C}={C,A,B}={A,A,B,C}.\{A,B,C\}=\{C,A,B\}=\{A,A,B,C\}.

This matters when combining security lists: seeing the same security in two input files does not create two distinct securities. A transaction ledger, where repeated trades matter, needs more information than a set of security identifiers.

Screening a universe

Suppose a research process starts with the fixed universe U={A,B,C,D}U=\{A,B,C,D\}. Its eligibility screen accepts E={A,B,C}E=\{A,B,C\}, while a separate borrow-availability snapshot lists L={B,C,D}L=\{B,C,D\}. The capital letters inside braces are security labels; EE and LL name the two sets.

If a candidate must pass both tests, use intersection. If it may pass either test, including both, use union. If the question is which eligible securities lack borrow availability, use set difference.
OperationResultMeaning in this snapshot
Intersection E∩LE\cap L{B,C}\{B,C\}Eligible and borrowable
Union E∪LE\cup L{A,B,C,D}\{A,B,C,D\}Eligible or borrowable, including both
Difference E∖LE\setminus L{A}\{A\}Eligible but not borrowable
Reverse difference L∖EL\setminus E{D}\{D\}Borrowable but not eligible
Difference is directional: reversing its inputs changes the question. The complement of EE relative to UU is U∖E={D}U\setminus E=\{D\}. Always state the universe: “not eligible” here means among these four securities, not among every security in existence.
Membership matrix for hypothetical securities A, B, C and D: eligibility contains A, B and C; borrow availability contains B, C and D; intersection contains B and C; union contains all four; eligibility minus borrow availability contains A. Counts are 3, 3, 2, 4 and 1.
Membership matrix for hypothetical securities A, B, C and D: eligibility contains A, B and C; borrow availability contains B, C and D; intersection contains B and C; union contains all four; eligibility minus borrow availability contains A. Counts are 3, 3, 2, 4 and 1.
Original fixed-snapshot example. Each mark denotes membership; the columns are security identifiers, not an ordered ranking. Borrow availability is stipulated for illustration and does not establish executable borrowing terms or a trade recommendation.
The cardinality of a finite set is its number of distinct elements, written ∣S∣\lvert S\rvert. Here,
∣E∪L∣=∣E∣+∣L∣−∣E∩L∣=3+3−2=4.\lvert E\cup L\rvert =\lvert E\rvert+\lvert L\rvert-\lvert E\cap L\rvert =3+3-2=4.

Subtracting the intersection corrects the double counting of B and C. Simply adding the two list sizes would overstate the combined universe.

Containment and an empty result

A set SS is a subset of TT, written S⊆TS\subseteq T, if every member of SS belongs to TT. Equality is allowed. A strict subset, written S⊊TS\subsetneq T, additionally requires S≠TS\ne T. Thus E∩L⊊EE\cap L\subsetneq E: both survivors are eligible, while A is eligible but does not survive both tests. Every set is a subset of itself, but never a strict subset of itself.

Do not confuse membership with containment: A∈EA\in E says security A is a member; {A}⊆E\{A\}\subseteq E says the one-security set is contained in EE.

The empty set, ∅={}\emptyset=\{\}, has no members. If no securities pass a screen, its result is empty and its count is zero: ∣∅∣=0\lvert\emptyset\rvert=0. That is different from the numerical singleton {0}\{0\}, which has one member, the number zero. An empty screen also conveys a different fact from a zero portfolio weight assigned to an eligible security. Intersecting any set with the empty set returns the empty set; the empty set is a subset of every set.

Membership comes before weights

Eligibility does not specify how much capital to allocate. Holding B and C equally, holding them unequally, or leaving both unheld requires a separate portfolio decision. A membership indicator function can encode “in” as one and “out” as zero, but those values are flags, not allocation weights.
Sets also provide the language of probability: a sample space collects possible outcomes, and an event collects outcomes satisfying a condition. A probability law adds likelihoods. Neither a set of securities nor its size supplies those likelihoods automatically.
For that next step, Probability Fundamentals develops events, complements and the probability addition rule. The full lesson is free with a signed-in account; the public link provides a preview.

Sources

Last updated
  • sets
  • membership
  • screening
  • set operations
  • mathematical foundations
← Back to the glossaryBack to top ↑