Skip main navigation

Logic operators

Watch this slideshow that gives some examples of logic operators
0
Logical operators. Operators can act on sentences. When a logical operator acts on a sentence, or perhaps on a couple of sentences,
9.3
the result is always one of the following statements: The sentence is true, The sentence is false, or we don’t know whether the sentence is true or false, we call this “unknown”.
19.5
Let’s take a look at the binary logical operator: the word AND. It acts on two sentences.
26
Let’s take two sentences for an example: if both sentences are true then the result will be TRUE when we act with the operator on these sentences. Otherwise, the result is false. An example will make this very clear. Let’s take one sentence which is a true sentence “Venus is the name of a planet”.
47.6
And let’s take another sentence: “A cucumber is green”. This is also a true sentence. Now, let’s operate on the two sentences with the logical operator AND. The result is TRUE!
62
Because the sentence: “Venus is the name of a planet and a cucumber is green” is TRUE. It is made up of two true sentences.
72
However, if we take one sentence that is false, “The moon is a planet”, and another sentence which is true, for example: “Stars are visible at night”, and operate with the AND
85
we get the sentence: “The moon is a planet and stars are visible at night”. and this sentence, this whole sentence, which is made up of a true sentence and a false sentence is false according to the rules of the AND operator. Let’s take a look at another logical operator. This time it is also a binary operator, It is the operator OR and it acts on two sentences but this time, if both sentences are false, the result is false, otherwise, the result is true, so we only really need one of the two sentences to be true so that the whole sentence
123.7
will be true, for instance:
126.5
Let’s take a true sentence: “Venus is the name of a planet”, and another true sentence: “A cucumber is green”. When we act
137.3
with the OR operator we get the sentence: “Venus is the name of a planet or a cucumber is green” and the result of acting with this operator on the two sentences is true because they are both true.
150
However, if one is true: “The moon is… ….
154.6
well, one is false: “The moon is a planet” and one is true: “Stars are visible at night”,
160.8
then, the whole sentence: “the moon is a planet or stars are visible at night” is still true! even though, one part of this whole sentence is false, because, These are the rules of the OR operator, it doesn’t have to be logical or seem like it’s funny! These are mathematical consequences of this logical operator. So the whole sentence is true.
183.3
Now let’s take two false sentences: “The moon is a planet” “Cucumbers are seedless”. Both sentences are false. In this case, and only in this case, if we act upon these two sentences with the OR operator,
197.4
we get the sentence: “The moon is a planet or cucumbers are seedless” and the result in this case only is false. because both sentences are false. Let’s take a look at a unary logical operator, the NOT operator. It’s also called ‘negation’ and because it’s a unary operator, it acts on one sentence. If the sentence is true, the result is false, and if the sentence is false, the result is true, exactly the opposite. So, the negation or the NOT operator reverses the logical meaning of the sentence.
234.2
If we take a true sentence: “ Venus is the name of a planet” and operate upon it with a NOT
243
We’ll get a sentence: “Venus is not the name of a planet” and this of course is false, because Venus, of course, is the name of a planet. Now let’s look at the opposite.
258.2
The false sentence: “The moon is a planet”. The moon is not a planet, it is the satellite of Earth… and we operator with the NOT operator on this sentence
268.6
we get the sentence: “The moon is not a planet” and this of course is a true sentence. And that’s a bit about logical operators.

Logic is one of the most interesting branches of math. It is a very broad discipline of which we will learn only a small part here: matters of “true and false”.

Simple statements are facts that can be said to be either true or false. Note: questions, wishes or exclamations are not considered logical statements since they can’t be regarded as true or false (“Where is the school?” is not true nor false!).

An example of a true statement is: The sun shines during the day.
An example of a false statement is: The sun shines at night.

There are cases where it is impossible to determine if a statement is true or false:

  • This can happen if some details are missing, for example: My friend went to the movies last night.
  • The statement is semantically problematic, for example: I am lying. Is he telling the truth or lying?!

In addition to the concepts of true and false, logic also deals with negation. This concept may be explained by means of the following example: “It does not rain in November” is a statement that negates the statement “It rains in November”. The negation of a statement is false whenever the original statement is true, and vice versa.
This definition is also appropriate when we don’t know if the statement is true or false. If it is false, its negation is true, and vice versa.

The negation operation is an operator applied to a statement! There are other logic operators as well.

The operator and (conjunction): Suppose that a is one statement and b is another statement. Statement a and b is true when both a and b are true statements. In other words, when a statement is made up of two statements connected by the word and:

  • When both statements are true, the whole statement is true.
  • When at least one of the statements is false, the whole statement is false.

For example: If statement a is “There are clouds in the sky when it rains” (a true statement), and statement b is “Puddles are formed when it rains on the road” (a true statement), then the statement a and b: “There are clouds in the sky when it rains and puddles are formed when it rains on the road” is a true statement.

The operator or (disjunction): Suppose that a is one statement and b is another statement. Statement a or b is true when at least one of the two statements: a ,b, is true.

For example: If statement a is “There are clouds in the sky when it rains” (a true statement), and statement b is “A cat usually has three legs” (a false statement), then the statement a or b, “There are clouds in the sky when it rains or a cat usually has three legs” is a true statement.

Another example : Statement a: “Daniel went to school” (a true statement) Statement b: “Hannah went to school” (a true statement) “Daniel went to school or Hannah went to school” (a true statement).

Note that there is a semantic difference between “or” in the language and or in logic. In spoken language when we say “or” we usually mean that only one of the two options is true, and in logic it means that at least one of the two options is true.

Watch this video to see a slideshow summarising logic operators.

This article is from the free online

Maths Puzzles: Cryptarithms, Symbologies and Secret Codes

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education