Source: http://www.cs.cornell.edu/courses/cs2800/2015sp/lnotes/15_cardinality.pdf