Source: http://www.wright.edu/~nikolai.priezjev/papers/Lecture_4_Ch_1.5_binary_solutions.pdf