Chapter 5

Additional Web Questions

Please answer the following true or false questions:

1. The word "boolean" means "true or false."

2. When using the AND operator, all conditions must be true for the result to be true.

3. "true OR false" is false.

4. The symbol for OR is &&.

5. Something is "NOT false" is true.

6. false && ((true || false) && (false || true)) is …

7. true ^ true is …

8. Expressions with parenthesis are evaluated left to right.

9. !(!(!(false))) is …

10. !(X && Y) is the same as (!X || !Y).

Answes:

1. true.

While it does have that meaning, "boolean" was derived from George Boole's name.

2. true.

This is the definition of the AND operator.

3. false.

"true OR false" is true, because either condition needs to be true, and one is!

4. false.

The symbol for OR is ||. The symbol for AND is &&.

5. true.

It's true in English, and it's true in Boolean math.

6. false.

You could evaluate the whole thing, or just remember that "false AND anything is false." Likewise, "true OR anything is true."

7. false.

true XOR true is false. Remember that ^ is the symbol for XOR.

8. false.

Expressions with parenthesis are evaluated inside out. Inner parenthesis first, working outwards. When expressions are otherwise equal, then the precedence is left to right.

9. true.

Again, you could work this out, or remember the "double negative" rule. Pairs of NOTs can be removed because they cancel each other out. Three NOTs is the same as 9 NOTs is the same as 1000001 NOTs is the same is one NOT.

10. true.

This is a Boolean theorem (maybe one of George's). Regardless of the values of X and Y, these two expressions are the same. A similar theorem says these are equal: !(X || Y) == (!X && !Y).