I have problems using De Morgan Law ... Feedback?

Every time one of these questions arises in my assignments, I am mistaken ... can someone help me understand? Or the teacher’s key? (I don’t know how they don’t give me the right answer, it only lets me know that my mistake is.)

Suppose x = 7 and y = 5 . Applying De Morgan's law, select the logical expression below, which is equivalent to the following logical expression !(x>5)||!(y>7)

(a) !(x>5)&&!(y>7)

(b) !((x>5)||(y>7))

(c) !(x>5)&&(y>7)

(d) (x>5)||!(y>7)

(e) None of the above

I would choose B as the answer, but since I still do not understand them all, I am afraid to continue without any help.

As I understand it, you can combine the two ! into one, putting it in front of the whole expression, changing:

!(a)||!(b)

to

!((a)||(b))

+4
source share
6 answers

According to Wikipedia , Morgan's Law (which for me was just what I knew)

NOT (P AND Q) = (NOT P) OR (NOT Q)

In your question, P will map to (x>5) and Q to (y>7) . Therefore !((x>5)&&(y>7)) is your answer. But you do not have one on the list. (Your teacher is sloppy if this is your real question, since only one suggested answer has double parentheses, which is a huge key - you can exclude b because it still uses || and excludes others due to the lack of a double round of the parenthesis going straight to e.)

If you really cannot make these things stand still, use the values ​​of the samples that the question asks. (If necessary, do a little.) x>5 true for x = 7. y>7 is not true for y = 5. so you have !true || !false !true || !false , which is false || true false || true , which is true . Evaluate each of the possible expressions and exclude those that do not answer the same answer. If you are still lost, select different sample values ​​and retry. One of the possible answers will contain a match, or none of them will allow you to go to "none of the above." This will earn you a mark, even if you really don't understand why.

As to why, it is because of the opposite behavior of && and || . The only way to get true value from && is with truth from both sides. The only way to get a lie from || - with a lie on both sides. If you flip the options with ! , you can flip the operator and get the opposite result.

+6
source

Here, check out De Morgan Law: up http://en.wikipedia.org/wiki/De_Morgan 's_laws! This is not how you described, but

 NOT (P AND Q) = (NOT P) OR (NOT Q) NOT (P OR Q) = (NOT P) AND (NOT Q) 

Note that AND becomes OR. Just like OR, it becomes AND. Negation (NOT) goes into arguments.

Therefore, for !(x>5) || !(y>7) !(x>5) || !(y>7) first rule is applied in the same way as the right side with P as (x>5) and Q as (y>7) . First change the operator from || (OR) to && (AND), and then ! (NOT) in front. The result is

 !(x>5) || !(y>7) = !((x>5) && (y>7)) 

which looks the same as c if there are parentheses or just b if there is && instead of ||. It is with these answer options that e responds.

+3
source

No, the conversion that works !(a)||!(b)!(a && b) is "and" instead of "or" in the converted version.

Your expression

 !(x>5)||!(y>7) == (x <= 5) || (y <= 7) 

which, I think, does not correspond to any of them. I would go for E.

+2
source

De Morgan Laws say:

  • ¬ (A or B) = ¬A and ¬B
  • ¬ (A and B) = ¬A or ¬B

note that you must also pair the operator.

This example can help clarify the thought process.

If I want something that is not red or a ball, then what I follow is neither red nor a ball. However, if I want something that is not red, but a ball, then I am looking for an object that is either not red or not a ball.

So, the expression processing will be

!

((x> 5) && (y> 7))

What is not indicated (e).

However, if x = 7 and y = 5, then (x> 5), but! (y> 7), therefore the expression! (x> 5) ||! (y> 7) is true. For instance. I want something that is not red (x> 5) or a ball (y> 7), and I am assigned a red bucket (false || true).

[EDIT] I am typing too slowly.

+1
source

The application of De Morgan's laws (there are two of them, but there are symmetrical ones) will change:

! (x> 7) ||! (Y> 5)

in

! ((x> 7) & (y> 5))

I assume that variant c should be, but as you wrote it, there are no external brackets. You have almost everything right, you just forgot that the operator is also changing.

Here is the easiest way I know to handle De Morgan's rules. Suppose you have something like this: ((A) OP (B)) where OP is "either" or "and". Make sure you write down all the brackets, even if the outer ones are redundant. Now we reset all the brackets and switch the operator "or" becomes "and" and vice versa. So what do you get:! (! (A) OTHER_OP! (B)) Now you usually get a double negative result that can be deleted. But the key is identifying the correct structure (three brackets and a matching operator).

+1
source

You can think of DeMorgan law as a switch.

Let P, Q be sentences and OP an element from {AND, NOT}. Then the following holds:

NOT (P OP Q) = (NOT P) (NOT OP) (NOT Q)

where "NOT AND" stands for OR and "NOT OR" stands for AND. DeMorgan's law simply toggles all truth values ​​and operators.

+1
source

Source: https://habr.com/ru/post/1345091/


All Articles