# Do we have to expand the brackets before applying De Morgan's Laws?

If we have the example:

$$\overline{(A + B + C)D}$$

Then can we apply De Morgan's Law as is, or do we first need to expand out the brackets?

If I expand the terms first, I get:

$$original: \overline{(A + B + C)D}$$ $$expanded: \overline{AD + BD + CD}$$ $$applying De Morgan's: \overline{AD}.\overline{BD}.\overline{CD}$$ $$simplifying: \overline{A}\overline{B}\overline{C}\overline{D}$$

In contrast, if I don't expand the brackets, I get something like:

$$original: \overline{(A + B + C)D}$$ $$applying De Morgan's: \overline{(A + B + C)}+\overline{D}$$ $$applying De Morgan's: (\overline{A} . \overline{B + C})+\overline{D}$$ $$applying De Morgan's: (\overline{A} . \overline{B} . \overline{C})+\overline{D}$$ $$simplifying: \overline{A} . \overline{B} . \overline{C}+\overline{D}$$

So you can see, I'm getting different answers. I'm curious which method is correct - I think the first seems correct, but perhaps the 2nd is correct or both are wrong.

If anyone is able to explain why one particular method is wrong, I'd appreciate it too.

• MathJax tip: when writing text in mathematics code, use the \text{} command to get proper spacing and formatting. For example, $$\text{applying De Morgan's} : \overline{(A + B + C)} + \overline{D}$$ produces$$\text{applying De Morgan's} : \overline{(A + B + C)} + \overline{D}$$ Aug 22, 2021 at 0:54
• Thanks. Now I will do that in future :) Aug 22, 2021 at 5:58
• @RandomUser123 You can also do that now. Questions and answers can be edited, and indeed should be edited if they can be improved. Aug 22, 2021 at 8:45

Both lead to the same result; your error is in the first one when you simplify from $$\overline{AD}.\overline{BD}.\overline{CD}$$ to $$\overline{A}\overline{B}\overline{C}\overline{D}$$.
If you apply De Morgan's law to each pair, you get: $$(\overline{A}+\overline{D})(\overline{B}+\overline{D})(\overline{C}+\overline{D}).$$ From here, you can apply the distributive law to get what you got by the second method in the next to last line. The simplifcation there is also incorrect because you cannot simply drop the parenthesis; you must apply the distributive property.
• Makes sense. I was viewing it as $$\overline{ADBDCD}$$ then just cancelling removing the unneccessary duplicates. Because the NOTs were over multiple variables, I shouldn't be able to do that. I also tried myself, expanding out those 3 sets of brackets and surpisingly managed to simplify down that mess to the correct answer...seeing that all of the brackets contain D' and using your suggestion of using the distributive law is much easier though...I guess it's a good way to check...since I worry if I use these shortcuts, I will apply it incorrectly/in a situation that's invalid or something Aug 22, 2021 at 6:17