Today, together we will learn to simplify logical expressions, get acquainted with the basic laws and study the truth tables of the functions of logic.
Let's start with why this item is needed. Have you ever noticed how you talk? 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 be trapped, study the simple and understandable laws of logic. They will help you not only get a good evaluation in computer science or get more balls on a single state exam, but also act in life situations not at random.
In order to learn to simplify logical expressions, you need to know:
Now we will consider these issues in great detail. Let's start with operations. They are pretty easy to remember.
Be sure to remember that the operation is necessaryperform in a strict sequence: denial, multiplication, addition, consequence, equivalence. For operations "Sheffer's stroke" and "Pierce's arrow" there is no rule of priority. Therefore, they must be performed in the order in which they stand in a complex expression.
Simplify the logical expression and buildthe truth table for its further solution is impossible without knowledge of the tables of basic operations. Now we propose to get acquainted with them. Note that the values can take either a true or false value.
For a conjunction, the table looks like this:
Expression number 1 | Expression number 2 | The result |
False | False | False |
False | True | False |
True | False | False |
True | True | True |
Table for operation disjunction:
Expression number 1 | Expression number 2 | The result |
- | - | - |
- | + | + |
+ | - | + |
+ | + | + |
Negation:
Input value | The result |
The true expression | - |
False expression | + |
Consequence:
Expression number 1 | Expression number 2 | The result |
- | - | True |
- | + | True |
+ | - | False |
+ | + | True |
Equivalence:
Expression number 1 | Expression number 2 | The result |
False | False | + |
False | True | - |
True | False | - |
True | True | + |
Bar of Schiffer:
Expression number 1 | Expression number 2 | The result |
0 | 0 | True |
0 | 1 | True |
1 | 0 | True |
1 | 1 | False |
Pierce's Arrow:
Expression number 1 | Expression number 2 | The result |
- | - | + |
- | + | - |
+ | - | - |
+ | + | - |
On the question of how to simplify logical expressions in computer science, we will be helped to find answers to simple and understandable laws of logic.
Let's start with the simplest law of contradiction. If we multiply the opposite concepts (A and notA), then we get a lie. In the case of the addition of 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 notA), in which case we get the answer A. There are also two de Morgan laws:
Very often there is duplication, one and thatThe same value (A or B) is added or multiplied with each other. In this case, the law of repetition is valid (A * A = A or B + B = B). There are also laws of absorption:
There are two laws of gluing:
Simplifying logical expressions is easy ifknow the laws of Boolean algebra. All the laws listed in this section can be tested by experience. To do this, open the brackets according to the laws of mathematics.
We studied all the features of simplifying logicalexpressions, it is now necessary to consolidate their new knowledge into practice. We suggest that you analyze together three examples from the school curriculum and the uniform state examination tickets.
In the first example, we need to simplify the expression: (C * E) + (C * not E). First of all, we draw our attention to the fact that both the first and second brackets have the same variable C, we suggest that you take it out of brackets. After the manipulation, we get the expression: C * (E + notE). Earlier we considered the law of exclusion of the third, we apply it with respect to this expression. Following it, we can state that E + is not E = 1, so our expression takes the form: C * 1. We can simplify the resulting expression, knowing that C * 1 = C.
Our next task will be: what will the simplified logical expression be (C + not) + not (C + E) + C * E?
Please note, in this example there isdenial of complex expressions, it is worth it to get rid of, 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 a variable in two terms, we take it out of brackets: not C * (E + neE) + C * E. Again, we apply the exclusion law: notC * 1 + C * E. We recall that the expression "notC * 1" equals notC: notC + C * E. Next, we propose to apply the distribution law: (notC + C) * (notC + E). We apply the law of elimination of the third: not C + E.
You are convinced that it is actually very simple to simplify the logical expression. Example number 3 will be painted in less detail, try to make it yourself.
Simplify the expression: (D + E) * (D + 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.
</ p>