The ASME Y14.5.1 companion to the Geometric Dimensioning and Tolerancing (GD&T) standard gives an exhaustive tabulation of active and invariant degrees of freedom (DOF) for Datum Reference Frames (DRF). These DRFs are entity clusters of points, lines, and planes with different geometric relations to each other (coincident, parallel, perpendicular etc.). This paper investigates the systematic derivation of DRF & target clusters' DOFs and associates them with tolerance classes. A vector representation of geometric entities and Boolean operations are proposed. This algebra was validated by applying it to all cases in the Y14.5.1 tabulation; the results were identical to those in the standard. Only translational and rotational DOFs were considered since size dimensions are independent of this analysis. Of course, only a handful of DRF cases in the standard have practical use. Based on the algebraic calculation of DOF in each DRF cluster, the general rules regarding how target entities are constrained by diverse DRF clusters are discussed in this paper. Target entities are associated with specific DRF and tolerance or composite tolerances.