Propositional Logic and Boolean Functions
[36/100%]Prove that the number of -dimensional faces in an -dimensional cube equals . Find the total number of faces of an -dimensional cube.
Let and be two tuples (two points) of the -dimensional unit cube . The Hamming distance between and is the number . Prove that this distance satisfies the following properties:
nonnegativity: , with if and only if ;
symmetry: ;
the triangle inequality: .
Let be points of the -dimensional unit cube, . Prove that then
the shortest path along the edges of connecting and contains edges;
in total there are ! such distinct paths.
Let in the sequence of vectors
each next element be obtained from the previous one by replacing one of the zeros with a one. Prove that the system of equations , , has at most one solution in .
Find the vertices of the unit cube that are at the indicated distances from the vertices , respectively:
;
;
;
;
;
. ⊛
Which subsets of the vertices of correspond to the following Boolean functions:
;
;
;
or ?
Construct truth tables for the following Boolean functions:
;
the sum is even;
or ;
Let us call a flip-flop a Boolean function of several arguments for which holds for any . Write out all possible
flip-flops , for which the equalities and always hold;
flip-flops , for which the equalities and always hold.
For each of the following formulas determine its depth and construct the truth table of the function it defines:
;
;
;
;
.
Determine which of the following formulas of propositional logic are identically true:
;
;
.
The table shown in fig. 115 shows the encoding of the decimal digits from 0 to 9 by means of four propositional variables . Combinations of values of and not listed in the table are erroneous codes. Which of the following Boolean formulas define the set of all erroneous codes:
;
;
;
;
;
?
Fig. 3: Table from problem 115.
Using the code table from the previous problem and assuming that the code is not erroneous, construct a formula with four variables and that will have value 1 if and only if the encoded number
equals 6;
is divisible by 4;
is divisible by 3;
is prime;
is composite;
is a Fibonacci number.
The variables and encode the numbers and respectively (see problem 115). Assuming that neither code is erroneous, write a formula that will have value 1 if and only if
;
;
.
The variables and encode the numbers and respectively from the set (see problem 115). Write formulas and whose values encode the product of these numbers.
Which of the following conditions can be expressed by Boolean formulas in the variables , using only the logical connectives and ?
At least two of the variables have value 1.
Not all of the variables have value 0.
An odd number of the variables have value 1.
Let us call the tuples and adjacent if they occur in adjacent rows of the table for a function of variables, that is, they represent the binary representations of the numbers and , for which .
Find the number of functions in that on every pair of adjacent tuples take
identical values;
different values.
Find the number of -ary Boolean functions taking value 1 on exactly tuples.
Find the number of functions in that change their value whenever any argument is changed.
Find the number of functions in that are commutative in every pair of arguments, that is, whose value does not change under a permutation of arbitrary arguments.
Let us call the tuples and opposite if for every (in other words, if and only if ).
Find the number of functions in that take different values on every pair of opposite tuples.
Let . Let us call the tuple paired if for all , that is, for some tuple of size . Find the number of functions in that take the same value on all paired tuples.
Determine how many three-place Boolean functions in total can be constructed using at most one connective from tables 1 and 2 on p. 36, and moreover using it at most once.
Let be a finite set of Boolean functions, and a positive, arbitrarily small constant. Prove that for sufficiently large , formulas over with fewer than symbols can represent at most Boolean functions. Thus, almost all Boolean functions can only be represented by "long" formulas.
An argument of a Boolean function is called dummy (fictitious) if the value of never changes when the value of is changed. Find the number of -ary Boolean functions with no dummy arguments, for .
By induction on the construction of the formula , prove the inequality
Give an example where the inequality is strict.
A database administrator has discovered that one or more of three records in his database and is erroneous. He has established that
if record is correct, then is erroneous;
at least one record of the pair is correct and at least one record of the pair is correct;
if is erroneous, then at least one of the records or is correct (but not both together). Describe the administrator's knowledge as a formula of propositional logic. Can he conclude that record is erroneous? Can it be reliably asserted that the erroneous record is unique?
The programmer Peter used three integer variables in his C program. At a certain point in the program he placed the conditional statement: if ; else ; Having analyzed his program, Peter established that before this statement is executed the following conditions hold:
if , then or ;
or ;
if , then at least one of the variables or is negative, but not both together.
Describe Peter's knowledge as a formula of propositional logic. Can he optimize the program by replacing the given conditional statement with the assignment ; or with the assignment ;? If "yes", then with which one?
A committee consists of five members. Decisions are made by majority vote, however, if the chairman votes "against", the decision is not adopted. Construct a formula of propositional logic depending on five propositional variables ( means that the -th committee member votes "for", means that the chairman votes "for"), whose value equals 1 if and only if the decision is adopted as a result of the vote.
In each of the following texts identify the elementary statements, denote them by propositional variables, and write a formula of propositional logic reflecting the content of the text.
Misha decided to do a small renovation in his apartment and either put up new wallpaper or paint the floor. Along with the wallpaper he will need to renew the laminate flooring, replace the doors, and replace the double-glazed window. After painting the floor he needs to install a stretch ceiling, a new chandelier, and furniture. If the laminate flooring is renewed, then new furniture will also have to be bought. The old wallpaper cannot be left with the old furniture, nor can the old furniture be left with the old chandelier.
If there is frost, then it will be sunny, or if the weather is overcast it will snow, and if there is no frost, then it will be sunny, or if the weather is overcast it will rain. In case of rain or snow it will be damp, and in case of rain it will also be muddy. If it is sunny, then there will be neither dampness nor mud.
When Vova is at home, his cat eats or sleeps, and if Vova is not there, it also plays. If the cat eats, cat food needs to be bought. If the cat plays, new furniture or new wallpaper will have to be bought. For food one needs to go to the pet shop "Everything for Cats", and for furniture or wallpaper — to the hardware store "Everything for the Home". A taxi is needed to get to either shop. Vova will not take a taxi to the "Everything for the Home" store.
Detective Sh. Holmes suspects three persons of committing a crime: and . He has established that
if is the criminal, then is also the criminal;
someone from the pair is the criminal, but not both together;
if is not the criminal, then is not the criminal either.
Describe Sh. Holmes's knowledge as a formula of propositional logic and construct its truth table. Can he conclude that is the criminal? Can it be reliably asserted that the criminal acted alone?
Detective E. Poirot suspects three persons of committing a crime: and . They gave the following testimony: - : if is the criminal, then is innocent; - : if is guilty, then is also the criminal; - : is the criminal. E. Poirot has established that (а) if told the truth, then lied, and (б) 's testimony is false. Describe E. Poirot's knowledge as a formula of propositional logic and construct its truth table. Can he conclude that is the criminal? Could the criminal have been alone?
Suppose that in every zoo that has lions and rhinoceroses there are no giraffes; in every zoo that has rhinoceroses and no giraffes there are lions; finally, in every zoo that has lions and giraffes there are also rhinoceroses. Do you think there can exist a zoo in which there are lions but neither giraffes nor rhinoceroses?
Anna, Beatrice, and Vera once discovered that they were all wearing identical jeans. It is known that Anna has jeans with pockets, narrow jeans, and faded jeans without pockets; Beatrice has jeans without pockets and faded narrow jeans with pockets. And finally, Vera has flared jeans and blue narrow jeans with pockets. What do their identical jeans look like?
A student who knew English poorly went on an internship in England. He needed to get to Manchester. He hitchhiked on the highway and stopped a car in which there were a father, a mother, and a daughter, who answered his question about their trip. He translated each phrase they said in two different ways and could not decide what the phrase actually meant. Here is what they said (the second possible meaning is given in parentheses).
Father: we are heading to Manchester (we are coming from Newcastle). Mother: we are not heading to Manchester, and we are coming from Newcastle (we did not stop in Liverpool and we are coming from Newcastle).
Daughter: we are not coming from Newcastle (we stopped in Liverpool). Should the student get into this car?
Lewis Carroll, the author of the widely known book "Alice in Wonderland" (it is less well known that he was a mathematician), liked to pose the following puzzle consisting of four statements: "One of two things: either the culprit left in a carriage, or the witness was mistaken. If the culprit had an accomplice, then he left in a carriage. The culprit had neither an accomplice nor a key; or he had both an accomplice and a key. The culprit had a key." What conclusion can be drawn from this?
A professor of economics formulated three rules for the students:
if investments do not increase, then either government spending will increase or unemployment will arise;
if government spending does not increase, then taxes will decrease;
if taxes decrease and investments increase, then unemployment will not arise.
It turned out that at the present moment investments have not increased. Can the students conclude that government spending will increase?