Random MAX SAT, random MAX CUT, and their phase transitions