Source: https://cs.unc.edu/~carterjl/teaching/notes/7_Representation_Notes.pdf