The optimality of perception and cognition: the perception-cognition gap explored