title: How can "x & y" be false when both x and y are true?
body: <h2>Context:</h2>
  
  <p>I'm learning C# and have been messing about on the <a href="http://pexforfun.com/" rel="noreferrer">Pex for fun</a> site. The site challenges you to re-implement a secret algorithm, by typing code into the site and examining how the inputs and outputs differ between your implementation and the secret implementation.</p>
  
  <h2>Problem:</h2>
  
  <p>Anyway, I got stuck on a basic code duel called <a href="http://pexforfun.com/default.aspx?language=CSharp&amp;code=ZAGtT7sKwkAQ7O8rJo0oiPmAVCLYCQEbLfNY45F4G_72MFHy714SbcRSttjZmYGZjWPsGl3U2LoaKXURhOGIIFeCNq0XZKYEe%2fnAIBiI7UfjRVfe0qhO%2foJLipTyTpsKx94J3RLV_jwEoGgy55Barmx2w1MBb8FJJmHlzA1S%2f3g0tJxwt565fjW5AUvi7RjtKQnEoAYVx9Funq%2fQ_TrowrLji2zCZ5t9CKY72zpRfy%2fVYYH_R6vT1pTnFw%3d%3d" rel="noreferrer">XAndY</a>.</p>
  
  <p>From the name it seemed obvious that the answer was just:</p>
  
  <pre><code>public static bool Puzzle(bool x, bool y) 
  {
      return x &amp;&amp; y;
  }
  </code></pre>
  
  <p>However, this was incorrect and Pex informed me that the following inputs produced a different result than the secret implementation:</p>
  
  <blockquote>
    <p>Input:</p>
    
    <p>x:true     y:true (0x02)</p>
    
    <p>Output:</p>
    
    <p>my implementation: true (0x02)</p>
    
    <p>secret implementation: false</p>
    
    <p>Mismatch   Your puzzle method produced the wrong result.</p>
    
    <p>Code:
    Puzzle(true, PexSafeHelpers.ByteToBoolean((byte)2));</p>
  </blockquote>
  
  <p>After a lot of confusion trying to compare different types of true, I realised that the implementation that Pex was looking for was actually just using a bitwise AND:</p>
  
  <pre><code>return x &amp; y;
  </code></pre>
  
  <h2>Questions:</h2>
  
  <p>I thought that for both semantic and short-circuiting reasons you should use logical <code>&amp;&amp;</code> for comparing boolean values, but regardless:</p>
  
  <ol>
  <li>Does this mean that <code>x &amp; y</code> and <code>x &amp;&amp; y</code> definitively do <strong>not</strong> have the same outputs for all possible bool arguments? (or could it be something buggy in Pex?)</li>
  <li>Does this mean you can differentiate between different values of bool <code>true</code> in C#? If so, how?</li>
  </ol>