Source: https://sites.math.northwestern.edu/~mlerma/courses/cs310-04w/notes/dm-relations.pdf