Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Two-valued logic: Operators


1. Two-valued logic: Operators

2. Relating values
Yin Yang orbitsRemember the following.

3. Operators
Here are two simple operators. These operators are relational operators as they relate quantities, as opposed to being logical operators (and, or, not, imply, etc.).

4. True expressions (formulas)
The following are true expressions.

5. False expressions (formulas)
The following are false expressions.

6. Logical operations
There are three primary logical operations. Some other common logical operations include the following.

7. Logical negation

8. Logical negation
Logical negation returns the opposite of the operand. Some other symbols for Not:

9. Sets and Venn diagram
Set complementLogical negation (i.e., "Not") is related to the complement operation of sets.

10. Complement
Here is a mathematical definition of complement.

Complement equation
Question: What is the opposite of not in?

11. Opposite of not in
The opposite of not in is in See how easy it is to get mixed up, if you are not careful.

12. Self-reference
Is the following sentence true or false? This is a self-referential statement since it refers to itself.

Self-referential statements can cause logical problems (i.e., paradoxes).

Is "no" your answer to this question? Answer either "yes" or "no".


13. Conjunction
The conjunction of two planets happens when the two planets are both inline with the sun.

Example: Conjunction of Venus and the Earth.

14. Logical conjunction
A logical conjuction is true of both operands are true. Some other symbols for And:

15. Natural language
Logical conjunction is the same as the natural language "and".

The natural language "and" is the same as the logical "and".

Example: To graduate, you must take and pass both CS201 and CS340 (and some others, ignored here)

That is, you must take both courses.

16. Sets and Venn diagram
Venn set for intersectionLogical conjunction (i.e., "And") is related to the intersection operation of sets.

17. Set intersection
Here is a mathematical definition of set intersection.

Math equation for set intersection

18. Logical disjunction
Logical disjunction is true if either or both operands are true. Some other symbols for Or:

19. Sets and Venn diagram
Venn diagram set unionLogical disjunction (i.e., "Or") is related to the intersection operation of sets.

20. Set union
Here is a mathematical definition of set union

Equation for set union

21. Natural language
Logical disjunction is not the same as the natural language "or", which is an exclusive "or" and not an inclusive "or".

Question: Would you like a piece of pie or a piece of cake?

22. Pie or cake
A logical answer is, "Yes", That is, I would like either a piece of pie, or a piece of cake, or both. I'll take both.

The natural language answer is to pick one of the two, but not both.

As a consequence, you must always be careful when using the word "or".

23. Exclusive or

24. Query
The query command is something like "find all pages that contain the specified text".

Search engines on the Internet allow logical operations to be used to limit the search criteria.

Question: When might we need more than two values for logical questions?


25. Multi-valued logic
In a modal dialog box, the user may need to decide between yes, no, and some other choices.

Modal dialog box with three choices
A program that requests a user response to a question. Very often, the valid responses are yes, no, and escape (gracefully avoid the question).

26. Multi-valued logic
Determining the sign of an integer, which can be positive, negative, or zero (neither positive nor negative).

How many choices were there for Paul Revere's famous ride?

27. End of page

28. Multiple choice questions for this page