Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to <a href="http://en.wikipedia.org/wiki/De_Morgan%27s_laws" rel="nofollow">Wikipedia</a>, de Morgan's Law (which to me was just a thing I knew) is </p> <p>NOT (P AND Q) = (NOT P) OR (NOT Q)</p> <p>In your question, P maps to <code>(x&gt;5)</code> and Q maps to <code>(y&gt;7)</code>. Therefore <code>!((x&gt;5)&amp;&amp;(y&gt;7))</code> is your answer. But you don't have such a one in your list. (Your teacher is sloppy if this is your real question, since only one proposed answer has double round brackets, which is a huge clue - you can rule out b because it still uses || and rule out the others for a lack of double round brackets, going straight to e.)</p> <p>If you really can't make these things stand still for you, use the sample values the question provides. (If neccessary, make some up.) <code>x&gt;5</code> is true for x=7. <code>y&gt;7</code> is false for y=5. so you have <code>!true || !false</code>, which is <code>false || true</code>, which is <code>true</code>. Evaluate each of the possible expressions and rule out the ones that don't come out to the same answer. If you're still lost, pick different sample values and repeat. One of the possible answers will keep matching, or none will so you'll go with "none of the above." That will earn you the mark even if you don't really understand why.</p> <p>As for why, it's because of the opposite behaviour of <code>&amp;&amp;</code> and <code>||</code>. The only way you get a true from <code>&amp;&amp;</code> is with true on both sides. The only way you get a false from <code>||</code> is with false on both sides. If you flip the parameters with <code>!</code>, you can flip the operator and get the opposite result.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload