Trying to solve a Boolean algebra expression which simplifies midway down to
$$(Q \lor (M \land \lnot N \land \lnot G)) \land (M \lor N \lor G)$$
It seems the final result of the distribution should be
$$(Q \land M) \lor (Q \land N) \lor (Q \land G) \lor (M \land \lnot N \land \lnot G)$$
However, Wolfram Alpha lists the result (shown here: https://www.wolframalpha.com/input/?i=%28Q+%7C%7C+%28~G+%26%26+M+%26%26+~N%29%29+%26%26+%28M+%7C%7C+N+%7C%7C+G%29) as
$$(Q \land N) \lor (Q \land G) \lor (M \land \lnot N \land \lnot G)$$
How did the $$Q \land M$$ term get cancelled out?
$Q \wedge M = (Q \wedge M \wedge N) \vee (Q \wedge M \wedge \lnot N)$ $= (Q \wedge M \wedge N) \vee (Q \wedge M \wedge \lnot N \wedge G) \vee (Q \wedge M \wedge \lnot N \wedge \lnot G)$
Now use $(Q \wedge M \wedge N) \vee (Q \wedge N) = Q \wedge N \wedge (1 \vee M) = Q \vee N$ and similar equations for the last two terms.
Of course nobody would actually try to minimize the expression in this way. There are systematic tools like Karnaugh maps or the Quine-McCluskey algorithm.