Source: https://people.eecs.berkeley.edu/~keutzer/classes/244fa2005/lectures/12-1-BooleanFunctions.pdf