How to understand De Morgan Laws Boolean Expression

我们两清 提交于 2019-11-28 02:03:23
Vincent Ramdhanie

You can use a Truth table to see how the two expressions are equal. Like This:


!(P || Q) = !P && !Q 

_________________________________________________
   P   Q   P || Q   !(P||Q)   !P   !Q   !P && !Q
_________________________________________________
   1   1      1         0      0    0       0
   1   0      1         0      0    1       0
   0   1      1         0      1    0       0
   0   0      0         1      1    1       1
_________________________________________________

Note that the column labeled !(P||Q) is the same as the column labeled !P && !Q. You can work this from the left most column where we set the initial values for P and Q. Then work out each column towards the right.


!(P && Q) = !P || !Q 

_________________________________________________
   P   Q   P && Q   !(P&&Q)   !P   !Q   !P && !Q
_________________________________________________
   1   1      1         0      0    0       0
   1   0      0         1      0    1       1
   0   1      0         1      1    0       1
   0   0      0         1      1    1       1
_________________________________________________


Think of it in terms of the Red Toyota.

Let p = "The car is red"

Let q = "The car is a Toyota"

! ( p && q ) means "The car is not a red Toyota"

Which is the same as saying:

!p || !q "it's not red, or (inclusive) it's not a Toyota" , right?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!