"Necessary and sufficient" for software engineers

The LSAT's big secret is that none of it is really all that hard. Some of the concepts might seem abstract at first, but once you see a few examples you'll usually realize that most of this stuff boils down to common sense. No matter what you studied in school, and no matter what you do for a living, you're already using these concepts every day... you just might not realize it. The email below is from a software engineer who realized that the LSAT terms "sufficient" and "necessary" were simply abstract descriptions of logical processes that he had already mastered. He wrote me to describe his thought process, in the hopes that it might help any other engineering types who are studying for the LSAT.

(Note: For my money, software engineering is a hell of a lot more difficult than the LSAT. If a little code frightens you, feel free to disregard this post. My point isn't that you need to understand this post in order to understand necessary and sufficient. My point is that there are a zillion different ways to understand this concept, depending where you're coming from.)

The letter is from George Yunaev, and it made me very happy. My nerd glee is off the charts right now. Thanks George!

Would like to share something with you which I created for myself regarding the difference between necessary and sufficient for software engineers. Software engineers might not have a good understanding of formal logic (if any at all), but they do have understanding of how the logical operators work in common programming languages.

Necessary condition means "logical AND". The condition based on A is represented as:

  if ( A && X )
      // the condition is true
   else
     // the condition is false

Here X is other conditions which value is unknown. What it means that:

 - If A is false, the result is guaranteed to be false (in fact the computer running this code won't even check X).   - However if A is true, the result isn't guaranteed to be true, because now it depends on other value (X) which is unknown. - Therefore based on the value of A we can be only certain when the condition is false, and never certain when it is true.

Sufficient condition means "logical OR". The condition based on A is represented as:

  if ( A || X )
      // the condition is true
   else
     // the condition is false

Same as above, X is other conditions which value is unknown. What it means now that:

 - If A is true, the result is guaranteed to be true (same way, the computer running this code won't even check X).   - However if A is false, the result isn't guaranteed to be false, because now it depends on other value (X) which is unknown. - Therefore based on the value of A we can be only certain when the condition is true, and never certain when it is false.

Everyone who knows C, Java, Perl, PHP or even Visual Basic should understand that.

I don't know any of those languages, or any computer language at all. But I do know that George is right. A sufficient condition means "if X is true, the argument wins... and the argument might be true even if X is false." A necessary condition means "if X is false, the argument loses... and the argument might lose even if X is true."

I love real life examples! Do you have something that worked for you? If so, please share it.