Everyone who begins to study computer science is taughtbinary system of calculus. It is used to calculate logical operations. Let's consider below all the most elementary logical operations in computer science. After all, if you think about it, they are used when creating the logic of computers and devices.
Before we start to consider in detail specific examples, we list the main logical operations in computer science:
Also, before beginning to study logical operations, it is worthwhile to say that in computer science lie is designated "0", and the truth is "1".
For each action, as in ordinary mathematics, the following signs of logical operations in informatics are used: ¬, v, &, ->.
Each action can be described either by 1/0 digits, or simply by logical expressions. Let's start with mathematical logic with a simple operation that uses only one variable.
Logical negation is an inversion operation. The bottom line is that if the original expression is true, then the result of the inversion is false. Conversely, if the original expression is false, the result of the inversion will be true.
When writing this expression, the following notation is used: "¬A".
Here is a truth table - a diagram that shows all possible results of an operation for any input data.
That is, if our original expression is true (1), then its negation will be false (0). And if the original expression is false (0), then its negation is true (1).
The remaining operations require two variables. We denote one expression -
For brevity, create a truth table.
|E v H||x||x||x||about|
Having dealt with the operation of addition, go tomultiplication (conjunction). We use the same notation as above for addition. When writing, logical multiplication is indicated by the symbol "&" or the letter "AND".
|E & H||x||0||0||0|
The logical sequencing operation (implication) is one of the simplest in mathematical logic. It is based on a single axiom - the truth can not be followed by a lie.
To facilitate the implementation of mathematical actions, we also give a truth table.
|E -> H||x||about||x||x|
The last operation considered will belogical identity or equivalence. In the text, it can be designated as "... if and only if ...". Proceeding from this formulation, we will write examples for all the initial variants.
So, after considering the simplest logical operations ininformatics, we can begin to study some of their properties. Like in mathematics, logical operations have their own processing order. In large logical expressions, operations in brackets are performed first. After them, first of all, we calculate all the values of negation in the example. The next step is to calculate the conjunction, and then disjunction. Only after this we perform the operation of the investigation and, finally, the equivalence. Consider a small example for clarity.
A v B & ¬ B -> B ≡ A
The order of the action is as follows.
In order to solve this example, weyou will need to build an extended truth table. When you create it, remember that it's better to place the columns in the same order in which the actions will be performed.
B & (¬ B)
A v (B & (B))
(A v (B & (B)))) → B
((A v (B & (¬ B))) -> B) ≡ A
As we see, the result of the example solution is the last column. The truth table helped solve the problem with any possible initial data.
In this article, some concepts have been consideredmathematical logic, such as informatics, the properties of logical operations, and also - what are logical operations in themselves. Some simple examples were given for solving mathematical logic problems and truth tables necessary to simplify this process.</ p>