Chapter 3

Boolean Functions and Their Representations

[10/100%]
Show
LaTeX
Problem 55

Which subsets of the vertices of B4\mathbb {B}^{4} correspond to the following Boolean functions:

?
(a)

f1(x1,x2,x3,x4)=1⇔x1=0f_{1}\left(x_{1}, x_{2}, x_{3}, x_{4}\right)=1 \Leftrightarrow x_{1}=0;

(b)

f2(x1,x2,x3,x4)=1⇔x4=1f_{2}\left(x_{1}, x_{2}, x_{3}, x_{4}\right)=1 \Leftrightarrow x_{4}=1;

(c)

f3(x1,x2,x3,x4)=1⇔x1+x2⩾x3+x4f_{3}\left(x_{1}, x_{2}, x_{3}, x_{4}\right)=1 \Leftrightarrow x_{1}+x_{2} \geqslant x_{3}+x_{4};

(d)

f4(x1,x2,x3,x4)=1⇔x1x2=0f_{4}\left(x_{1}, x_{2}, x_{3}, x_{4}\right)=1 \Leftrightarrow x_{1} x_{2}=0 or x3x4=1x_{3} x_{4}=1?

Problem 56

Construct the truth tables for the following Boolean functions:

?
(a)

f1(x1,x2,x3)=1⇔x1+x3⩾x2f_{1}\left(x_{1}, x_{2}, x_{3}\right)=1 \Leftrightarrow x_{1}+x_{3} \geqslant x_{2};

(b)

f2(x1,x2,x3)=1⇔f_{2}\left(x_{1}, x_{2}, x_{3}\right)=1 \Leftrightarrow the sum x1+x2+x3x_{1}+x_{2}+x_{3} is even;

(c)

f3(x1,x2,x3)=0⇔(x1=x2 or x1=x3)f_{3}\left(x_{1}, x_{2}, x_{3}\right)=0 \Leftrightarrow \left(x_{1}=x_{2} \text{ or } x_{1}=x_{3}\right);

(d)

f4(x1,x2,x3)={x2, if x1=1;x3, otherwise. f_{4}\left(x_{1}, x_{2}, x_{3}\right)= \begin{cases} x_{2}, & \text{ if } x_{1}=1 ; \\ x_{3}, & \text{ otherwise. }\end{cases}

Problem 57

For each of the following formulas, determine its depth and construct the table of the function it defines:

?
(a)

Ψ1=((x1→¬x3)∨(x2⊕x3))\Psi_{1}=\left(\left(x_{1} \rightarrow \neg x_{3}\right) \vee \left(x_{2} \oplus x_{3}\right)\right);

(b)

Ψ2=(¬(x1↑x2)↔(¬x1∧x2))\Psi_{2}=\left(\neg \left(x_{1} \uparrow x_{2}\right) \leftrightarrow \left(\neg x_{1} \wedge x_{2}\right)\right);

(c)

Ψ3=((x2⊕¬x3)∧((x1∨x2)→(x1↔¬x3)))\Psi_{3}=\left(\left(x_{2} \oplus \neg x_{3}\right) \wedge \left(\left(x_{1} \vee x_{2}\right) \rightarrow \left(x_{1} \leftrightarrow \neg x_{3}\right)\right)\right);

(d)

Ψ4=((¬x1∧x2)↓(x1→¬x3))\Psi_{4}=\left(\left(\neg x_{1} \wedge x_{2}\right) \downarrow \left(x_{1} \rightarrow \neg x_{3}\right)\right);

(e)

Ψ5=(((x1⊕x2)⊕x3)↑(¬x2↓x3))\Psi_{5}=\left(\left(\left(x_{1} \oplus x_{2}\right) \oplus x_{3}\right) \uparrow \left(\neg x_{2} \downarrow x_{3}\right)\right).

Problem 58

Call the tuples α=(α1,…,αn)∈Bn\alpha =\left(\alpha_{1}, \ldots , \alpha_{n}\right) \in \mathbb {B}^{n} and β=(β1,…,βn)∈Bn\beta =\left(\beta_{1}, \ldots , \beta_{n}\right) \in \mathbb {B}^{n} neighboring if they occur in adjacent rows of the table for a function of nn variables, that is, they represent the binary expansions of numbers iαi_{\alpha } and iβi_{\beta } for which ∣iα−iβ∣=1\left|i_{\alpha }-i_{\beta }\right|=1.

Find the number of functions in Pn\mathcal{P}_{n} that take, on every pair of neighboring tuples,

?
(a)

equal values;

(b)

different values.

Problem 59

Call the tuples α=(α1,…,αn)∈Bn\alpha =\left(\alpha_{1}, \ldots , \alpha_{n}\right) \in \mathbb {B}^{n} and β=(β1,…,βn)∈Bn\beta =\left(\beta_{1}, \ldots , \beta_{n}\right) \in \mathbb {B}^{n} opposite if αi+βi=1\alpha_{i}+\beta_{i}=1 for every ii (in other words, αi=1\alpha_{i}=1 if and only if βi=0\beta_{i}=0).

Find the number of functions in Pn\mathcal{P}_{n} that take different values on every pair of opposite tuples.

?
Problem 60

Let n=2kn=2 k. Call a tuple α=(α1,…,αn)∈Bn\alpha =\left(\alpha_{1}, \ldots , \alpha_{n}\right) \in \mathbb {B}^{n} paired if αi=αk+i\alpha_{i}=\alpha_{k+i} for all i=1,…,ki=1, \ldots , k, that is α=α′α′\alpha =\alpha^{\prime } \alpha^{\prime } for some tuple α′\alpha^{\prime } of size kk. Find the number of functions in Pn\mathcal{P}_{n} that take the same value on all paired tuples.

?
Problem 61

A database administrator discovered that one or more of the three records A,BA, B and CC in his database is erroneous. He established that

?
(a)

if record BB is correct, then AA is erroneous;

(b)

at least one record of the pair B,CB, C is correct, and at least one record of the pair A,CA, C is correct;

(c)

if AA is erroneous, then exactly one of the records BB or CC is correct (but not both). Express the administrator's knowledge as a formula of propositional logic. Can he conclude that record BB is erroneous? Can it be reliably asserted that the erroneous record is unique?

Problem 62

The programmer Pyotr used three integer variables x,y,zx, y, z in his C program. At a certain point in the program he placed the conditional statement:

if⁡(x∗y>=0∣∣x∗z>=0)x=1; else x=2;  \operatorname {if}(\mathrm{x} * \mathrm{y}>=0| | \mathrm{x} * \mathrm{z}>=0) \mathrm{x}=1 \text{; else } \mathrm{x}=2 \text{; }

Having analyzed his program, Pyotr established that before this statement is executed the following conditions hold:

?
(a)

if z<0z<0, then x<0x<0 or y⩾0y \geqslant 0;

(b)

x⩾0x \geqslant 0 or y<0y<0;

(c)

if y<0y<0, then exactly one of the variables xx or zz is negative, but not both. Express Pyotr's knowledge as a formula of propositional logic. Can he optimize the program by replacing the given conditional statement with the assignment x=1\mathrm{x}=1; or with the assignment x=2\mathrm{x}=2;? If ``yes'', with which one?

Problem 63

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 $x_{1}, x_{2}, x_{3}, x_{4}, y$ ($x_{i}$ means that the $i$-th committee member votes for'', yy means that the chairman votes ``for''), whose value equals 1 if and only if the decision is adopted as a result of the vote.

?
Problem 64

In each of the following texts, pick out the elementary statements, denote them with propositional variables, and write down a formula of propositional logic that captures the content of the text.

?
(a)

Misha decided to do a small renovation in his apartment and either put up new wallpaper or repaint the floor. Along with the wallpaper he will need to replace the laminate flooring, change the door, and replace the window's double-glazed unit. After repainting the floor he needs to install a stretch ceiling, a new chandelier, and new furniture. If the laminate is replaced, new furniture will also have to be bought. Old wallpaper cannot be left with old furniture, and old furniture cannot be left with an old chandelier.

(b)

If it is frosty, it will be sunny, or if it is overcast it will snow; and if it is not frosty, it will be sunny, or if it 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, there will be neither dampness nor mud.

(c)

When Vova is home, his cat eats or sleeps, and when Vova is away, it also plays. If the cat eats, food needs to be bought. If the cat plays, new furniture or new wallpaper will have to be bought. For food one must go to the Everything for Cats'' pet shop, and for furniture or wallpaper to the Everything for the Home'' hardware store. Either shop requires taking a taxi. Vova will not take a taxi to the ``Everything for the Home'' shop.