How to simplify logical expressions: functions, laws, and examples

Today, we will learn to simplify logical expressions together, get acquainted with the basic laws, and study the truth tables of logic functions.

simplify logical expressions

Let's start with why this item is needed. Have you ever noticed how you are talking? Please note that our speech and actions are always subject to the laws of logic. In order to know the outcome of an event and not to get into a mess, study the simple and understandable laws of logic. They will help you not only get a good mark in computer science or score more points in a single state exam, but also act in random situations.

Operations

In order to learn how to simplify logical expressions, you need to know:

  • what functions are there in Boolean algebra;
  • laws of reduction and transformation of expressions;
  • order of operations.

what will be a simplified logical expression

Now we will consider these issues in great detail. Let's start with the operations. They are pretty easy to remember.

  1. First of all, we note the logical multiplication, in the literature it is called the conjunction operation. If the condition is written in the form of an expression, then the operation is indicated by an inverted check mark, a multiplication sign, or “&”.
  2. The next most commonly encountered function is logical addition or disjunction. It is marked with a tick or a plus sign.
  3. The negation or inversion function is very important. Remember how in Russian you selected the prefix. Graphically, the inversion is indicated by the prefix sign in front of the expression or the horizontal line above it.
  4. A logical consequence (or implication) is indicated by an arrow from value to effect. If we consider the operation from the point of view of the Russian language, then it corresponds to this type of construction of the sentence: "if ... then ...".
  5. Next comes the equivalent, which is indicated by a two-way arrow. In Russian, the operation has the form: "only then."
  6. Schaeffer stroke divides the two expressions with a vertical bar.
  7. Pierce's arrow, similar to Schaeffer's stroke, separates the expressions with a vertical arrow pointing down.

Be sure to remember that operations must be performed in strict sequence: denial, multiplication, addition, consequence, equivalence. For operations “Scheffer stroke” and “Pierce arrow” there is no priority rule. Therefore, they need to be performed in the sequence in which they stand in a complex expression.

Truth tables

Simplifying a logical expression and constructing a truth table for its further solution is impossible without knowledge of the tables of basic operations. Now we offer to get to know them. Note that values ​​can take either true or false value.

For conjunction, the table is as follows:

Expression No. 1

Expression No. 2

Total

False

False

False

False

True

False

True

False

False

True

True

True

Table for disjunction operation:

Expression No. 1

Expression No. 2

Total

-

-

-

-

+

+

+

-

+

+

+

+

Negation:

Input value

Total

True expression

-

False expression

+

The consequence:

Expression No. 1Expression No. 2Total
--True
-+True
+-False
++True

Equivalence:

Expression No. 1

Expression No. 2

Total

False

False

+

False

True

-

True

False

-

True

True

+

Schiffer Stroke:

Expression No. 1

Expression No. 2

Total

0

0

True

0

1

True

1

0

True

1

1

False

Pierce Arrow:

Expression No. 1

Expression No. 2

Total

-

-

+

-

+

-

+

-

-

+

+

-

Simplification laws

To the question of how to simplify logical expressions in computer science, simple and clear laws of logic will help us find answers.

simplify the logical expression and build a truth table

Let's start with the simplest law of contradiction. If we multiply the opposite concepts (A and nonA), then we get a lie. In the case of combining opposing concepts, we get the truth, this law is called "the law of the excluded third." Often in Boolean algebra there are expressions with double negation (not nonA), in which case we get the answer A. There are also two de Morgan laws:

  • if we have a denial of logical addition, then we get the multiplication of two expressions with inversion (not (A + B) = notA * notB);
  • the second law acts similarly, if we have a negation of the multiplication operation, then we get the addition of two values ​​with inversion.

Duplication is very common, the same value (A or B) is added or multiplied among themselves. In this case, the law of repetition applies (A * A = A or B + B = B). There are laws of absorption:

  • A + (A * B) = A;
  • A * (A + B) = A;
  • A * (not A + B) = A * B.

There are two laws of bonding:

  • (A * B) + (A * B) = A;
  • (A + B) * (A + B) = A.

Simplifying logical expressions is easy if you know the laws of Boolean algebra. All the laws listed in this section of the article can be verified empirically. To do this, open the brackets according to the laws of mathematics.

Example 1

We have studied all the features of simplifying logical expressions, now we need to consolidate our new knowledge in practice. We suggest that you take together three examples from the school curriculum and tickets for the unified state exam.

simplify boolean expression examples

In the first example, we need to simplify the expression: (C * E) + (C * notE). First of all, we draw our attention to the fact that in the first and second brackets there is the same variable C, we suggest that you put it outside the brackets. After the manipulation, we get the expression: C * (E + notE). Previously, we examined the law of exclusion of the third; we apply it with respect to this expression. Following him, we can argue that E + notE = 1, therefore, our expression takes the form: C * 1. We can simplify the resulting expression, knowing that C * 1 = C.

Example 2

Our next task will sound like this: what will the equally simplified logical expression not (C + nonE) + not (C + E) + C * E be?

Please note that in this example there is a denial of complex expressions, it is worth getting rid of it, guided by the laws of de Morgan. Applying them, we get the expression: not C * E + not C * not E + C * E. We again observe the repetition of the variable in two terms, we put it outside the brackets: not C * (E + not E) + C * E. Again we apply the law of exclusion: not C * 1 + C * E. We recall that the expression "not C * 1" equals not C: not C + C * E. Next, we propose to apply the distribution law: (not C + C) * (not C + E). We apply the law of exclusion of the third: not C + E.

Example 3

how to simplify logical expressions in computer science

You are convinced that it is actually very simple to simplify a logical expression. Example No. 3 will be described in less detail, try to do it yourself.

Simplify the expression: (D + E) * (D + F).

  1. D * D + D * F + E * D + E * F;
  2. D + D * F + E * D + E * F;
  3. D * (1 + F) + E * D + E * F;
  4. D + E * D + E * F;
  5. D * (1 + E) + E * F;
  6. D + E * F.

As you can see, if you know the laws of simplification of complex logical expressions, then this task will never cause you any difficulties.

Source: https://habr.com/ru/post/F18665/


All Articles