For each of the arguments of a function , there are choices of image, independently. Thus there are functions. A binary relation is a subset of the ordered pairs in , giving relations.
Represent a binary relation by its incidence matrix, with row and column . Requiring some with means that column must be a nonempty subset of the possible rows. Each column therefore has choices, independently, giving
relations with no empty column.
To impose no empty row as well, apply the inclusion-exclusion principle within this already column-nonempty family. Let be the family whose row is empty. If a specified set of rows is empty, every column must be a nonempty subset of the remaining rows, giving possibilities. There are ways to choose those empty rows. Thus the number with neither an empty row nor an empty column is
This is the binary relations with no empty row or column count. It does not require symmetry or transitivity of the relation. If , there is one empty function and one empty relation, and all quantified nonempty-row/column requirements are vacuous; the formulas still hold with the combinatorial convention for an empty product.