By Bayes' rule, where the prior probability P (S) can be viewed as uniform, and the P (Q) is constant across all sentences.
selecting a sentence to maximize P (S|Q) is equivalent to selecting a sentence that maximizes P (Q|S).