37
Advances in Applied Mathematics 25, 65–101 (2000) doi:10.1006/aama.2000.0688, available online at http://www.idealibrary.com on Perfect Two-Fault Tolerant Search with Minimum Adaptiveness 1 Ferdinando Cicalese 2 Department of Computer Science and Applications, University of Salerno, Via S. Allende, 84081 Baronissi (Salerno), Italy E-mail: [email protected] and Daniele Mundici 3 Department of Computer Science, University of Milan, Via Comelico 39-41, 20135 Milan, Italy E-mail: [email protected] Received September 11, 1999; accepted March 8, 2000 Our aim is to minimize the number of answer/question alternations in a per- fect two-fault-tolerant search. Ulam and R´ enyi posed the problem of searching for an unknown m-bit number by asking the minimum number of yes–no questions, when up to of the answers may be erroneous/mendacious. Berlekamp considered the same problem in the context of error-correcting communication with feedback. Among others, he proved that at least q m questions are necessary, where q m is the smallest integer q satisfying 2 q-m j=0 ( q j ) . When all questions are asked in advance, and adaptiveness has no role, finding a perfect strategy (i.e., a strategy with q m questions) amounts to finding an -error-correcting code with 2 m codewords of length q m. From coding theory it is known that such perfect non-adaptive searching strategies are rather the exception, for 2. At the other extreme, in a fully adaptive search, where the t + 1th question is asked knowing the answer to the t th question, perfect strategies are known to exist for all sufficiently large m. 1 A preliminary draft of the first part of this paper, only dealing with binary search, appears in [7]. 2 Partially supported by an ENEA grant. 3 Partially supported by COST ACTION 15 on many-valued logics for computer science applications, and by the Italian MURST Project on Logic. 65 0196-8858/00 $35.00 Copyright © 2000 by Academic Press All rights of reproduction in any form reserved.

Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: [email protected] and Daniele Mundici3 Department of Computer Science, University of Milan,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

Advances in Applied Mathematics 25, 65–101 (2000)doi:10.1006/aama.2000.0688, available online at http://www.idealibrary.com on

Perfect Two-Fault Tolerant Search withMinimum Adaptiveness1

Ferdinando Cicalese2

Department of Computer Science and Applications, University of Salerno,Via S. Allende, 84081 Baronissi (Salerno), Italy

E-mail: [email protected]

and

Daniele Mundici3

Department of Computer Science, University of Milan,Via Comelico 39-41, 20135 Milan, ItalyE-mail: [email protected]

Received September 11, 1999; accepted March 8, 2000

Our aim is to minimize the number of answer/question alternations in a per-fect two-fault-tolerant search. Ulam and Renyi posed the problem of searching foran unknown m-bit number by asking the minimum number of yes–no questions,when up to ` of the answers may be erroneous/mendacious. Berlekamp consideredthe same problem in the context of error-correcting communication with feedback.Among others, he proved that at least q`�m� questions are necessary, where q`�m�is the smallest integer q satisfying 2q−m ≥∑`

j=0

(q

j

). When all questions are asked in

advance, and adaptiveness has no role, finding a perfect strategy (i.e., a strategy withq`�m� questions) amounts to finding an `-error-correcting code with 2m codewordsof length q`�m�. From coding theory it is known that such perfect non-adaptivesearching strategies are rather the exception, for ` ≥ 2. At the other extreme, in afully adaptive search, where the �t + 1�th question is asked knowing the answer tothe tth question, perfect strategies are known to exist for all sufficiently large m.

1 A preliminary draft of the first part of this paper, only dealing with binary search, appearsin [7].

2 Partially supported by an ENEA grant.3 Partially supported by COST ACTION 15 on many-valued logics for computer science

applications, and by the Italian MURST Project on Logic.

65

0196-8858/00 $35.00Copyright © 2000 by Academic Press

All rights of reproduction in any form reserved.

Page 2: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

66 cicalese and mundici

What happens if we impose restrictions on the amount of adaptiveness avaliableto the questioner? Focusing attention on the case ` = 2, we shall prove that, foreach m 6= 2, perfect searching strategies still exist even if the questioner is allowedto adapt his strategy only once. All our results are constructive and explicitly yieldperfect two-error-correcting codes with the least possible feedback. We finally gen-eralize our results to k-ary search. © 2000 Academic Press

Key Words: searching with errors; fault-tolerant search; adaptive search; perfectcoding; error-correcting codes; communication with feedback.

1. INTRODUCTION

Let q`�m� be the smallest integer q satisfying 2q−m ≥ ∑`j=0

(qj

). The first

aim of this paper is to explicitly give, for each m 6= 2, perfect two-error-correcting search strategies over the space of m-bit numbers, with the leastpossible degree of adaptiveness/feedback. The second aim is to generalizethese results to k-ary search.

The problem of efficient search of an unknown element in a finite set S isoften reformulated as a game between two players—one deciding the ques-tions to be asked, and the other deciding the answering strategy that makesas hard as possible the first player’s task. In Berlekamp’s theory of error-correcting communication with feedback [3] (also see [11, 19]) one furtherassumes answers to be subject to distortion. Variants of the 20 questionsgame with lies yield the game-theoretic counterpart of the correspondingsearch problem.

We shall be concerned with the following problem: Two players, calledPaul and Carole, first fix a set S = �0; 1; : : : ; 2m − 1�. Now Carole thinks ofa number xCarole ∈ S, and Paul must find out xCarole by asking questions, towhich Carole can only answer “yes” or “no.” Assuming Carole is allowedto lie—or just to be inaccurate—in up to ` answers, what is the minimumnumber of questions needed by Paul to infallibly guess xCarole?

When the questions are asked adaptively, i.e., the ith question is askedknowing the answer to the �i − 1�th question, the problem is generallyreferred to as the Ulam–Renyi problem, [18, p. 47; 23, p. 281]. Optimalsolutions (for each m) are given in [9, 15, 16, 21], respectively, for thecases ` = 1, ` = 2, ` = 3, and (for all sufficiently large m) for the generalcase. See [10] for a survey. If queries with k many possible answers areconsidered, one gets a k-ary search with lies. Solutions of the correspondinggeneralized Ulam–Renyi problems can be found in [1] for the case ` = 1and in [6, 8] for the case ` = 2.

At the other, fully non-adaptive extreme, when all questions must beasked in advance, the Ulam–Renyi problem amounts to finding an `-errorcorrecting code with �S� codewords of shortest length, where �S� denotesthe number of elements of S. As is well known for ` = 1 Hamming codes

Page 3: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 67

yield searching strategies with the smallest possible number of questions—indeed, Pelc [17] shows that adaptiveness is irrelevant even under the addi-tional assumption that repetition of the same question is forbidden. By con-trast, for ` > 1 the best known non-adaptive search strategies over the setof m-bit numbers generally require a number of questions strictly greaterthan q`�m� (see, e.g., [13, 22]).

In many practical applications where adaptiveness takes its toll, prefer-ence is given to search procedures involving large batches of non-adaptivequestions. One can thus minimize the number of interactive alternationsbetween answers and questions. For instance, in certain applications ofcomputational molecular biology (see [12]) preference is given to two-stagesearching strategies, where the search is adapted only once.

In this paper we give a detailed account of two-stage perfect two-faulttolerant searching strategies as follows: Paul first asks about the m bits ofxCarole and then, only depending on Carole’s answers, he asks a secondnon-adaptive batch Q of q2�m� −m questions. A careful choice of Q allowsPaul to infallibly guess xCarole, even if up to two of Carole’s q2�m� answersare false. We describe an inductive algorithm to effectively compute Q forall m 6= 2: this includes all cases of practical interest, as opposed to asymp-totic results. To this purpose we extensively build on error-correcting codesexisting in the literature (notably [4, 5]).

A substantial portion of this paper is devoted to extending these resultsto a k-ary search.

2. THE ULAM–RENYI GAME

Questions, Answers, States, Strategies

Assuming Carole and Paul to have agreed on the search space S =�0; 1; : : : ; 2m − 1�, by a question T we understand an arbitrary subset T ofS. The opposite question is the complement S \ T . In case Carole’s answeris “yes,” numbers in T are said to satisfy Carole’s answer, while numbersin S \ T falsify it. Carole’s negative answer to T has the same effect as apositive answer to the opposite question S \ T .

Suppose questions T1; : : : ; Tt have been asked and answers b1; : : : ; bthave been received from Carole (bi ∈ �no; yes�). Since up to two ofCarole’s answers may be erroneous, a number y ∈ S must be rejected fromconsideration if, and only if, it falsifies three or more answers. The remain-ing numbers of S still are possible candidates for the unknown xCarole. Allthat Paul knows (Paul’s state of knowledge) is a triplet σ = �A0;A1;A2�of pairwise disjoint subsets of S, where Ai is the set of numbers falsifying

Page 4: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

68 cicalese and mundici

i answers, i = 0; 1; 2. The initial state is naturally given by �S;Z;Z�. Astate �A0;A1;A2� is final iff A0 ∪ A1 ∪ A2 is empty or has exactly oneelement.

For any state σ = �A0;A1;A2� and question T ⊆ S, the two states σyes

and σno, respectively, resulting from Carole’s positive or negative answer,are given by

σyes = �A0 ∩ T; �A0 \ T � ∪ �A1 ∩ T �; �A1 \ T � ∪ �A2 ∩ T �� (1)

and

σno = �A0 \ T; �A0 ∩ T � ∪ �A1 \ T �; �A1 ∩ T � ∪ �A2 \ T ��: (2)

Turning attention to questions T1; : : : ; Tt and their respective answers Eb =b1; : : : ; bt , iterated application of the above formulas yields a sequence ofstates

σ0 = σ; σ1 = σb10 ; σ2 = σb2

1 ; : : : ; σt = σbtt−1: (3)

By a strategy S with q questions we mean the full binary tree ofdepth q, where each node ν is mapped into a question Tν, and the twoedges ηleft; ηright generated by ν are respectively labelled yes and no. LetEη = η1; : : : ; ηq be a path in S , from the root to a leaf, with respec-tive labels b1; : : : ; bq, generating nodes ν1; : : : ; νq and associated questionsTν1; : : : ; Tνq . Fix an arbitrary state σ . Then, iterated application of (1), (2)

naturally transforms σ into σ Eη (where the dependence on the bj and Tj isunderstood). We say that strategy S is winning for σ iff for every path Eηthe state σ Eη is final.

A strategy is said to be non-adaptive iff all nodes at the same depth ofthe tree are mapped into the same question.

Type, Weight, Character, Berlekamp’s Lower Bound

Let σ = �A0;A1;A2� be a state. For each i = 0; 1; 2 let ai = �Ai� bethe number of elements of Ai. Then the triplet �a0; a1; a2� is called thetype of σ . By definition, the Berlekamp weight of σ before q questions, q =0; 1; 2; : : :, is given by

wq�σ� = a0

((q

2

)+ q+ 1

)+ a1�q+ 1� + a2: (4)

The character ch(σ) of a state σ is the smallest integer q ≥ 0 such thatwq�σ� ≤ 2q.

By abuse of notation, the weight of any state σ of type �a0; a1; a2� beforeq questions will be denoted wq�a0; a1; a2�. Similarly, its character will alsobe denoted ch�a0; a1; a2�.

Page 5: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 69

As an immediate consequence we have the following monotonicity prop-erties: For any two states σ ′ = �A′0;A′1;A′2� and σ ′′ = �A′′0;A′′1;A′′2�,respectively, of type �a′0; a′1; a′2� and �a′′0; a′′1; a′′2�, if a′i ≤ a′′i for all i = 1; 2; 3then

ch�σ ′� ≤ ch�σ ′′� and wq�σ ′� ≤ wq�σ ′′� (5)

for each q ≥ 0. Note that ch�σ� = 0 iff σ is a final state. The proof of thefollowing results goes back to [3]:

Lemma 2.1. Let σ be an arbitrary state, and let T ⊆ S be a question. Letσyes and σno be as in (1), (2). We then have

(i) Conservation Law: For every integer q ≥ 1,

wq�σ� = wq−1�σyes� +wq−1�σno�:

(ii) Berlekamp’s lower bound: If σ has a winning strategy with q ques-tions then q ≥ ch�σ�.

Definition 2.2. A strategy S with q questions for a state σ is said tobe perfect iff S is winning for σ and q = ch�σ�.4

Let σ = �A0;A1;A2� be a state. Let T ⊆ S be a question. We say thatT is balanced for σ iff �Aj ∩ T � = �Aj \ T �, for each j = 0; 1; 2.

Lemma 2.3. Let T be a balanced question for a state σ = �A0;A1;A2�.Let n = ch�σ�. Let σyes and σno be as in (1), (2) above. Then, for each integerq ≥ 0,

(i) wq�σyes� = wq�σno�,(ii) ch�σyes� = ch�σno� = n− 1.

Proof. Condition (i) is an immediate consequence of the definitionof Berlekamp’s weight, together with (1), (2). In order to prove (ii),since for each q, wq�σyes� = wq�σno�, then by Lemma 2.1(i) we have2n ≥ wn�σ� = wn−1�σyes� + wn−1�σno� = 2wn−1�σyes� = 2wn−1�σno� and2n−1 < wn−1�σ� = wn−2�σyes� + wn−2�σno� = 2wn−2�σyes� = 2wn−2�σno�,whence wn−1�σyes� = wn−1�σno� ≤ 2n−1 and wn−2�σyes� = wn−2�σno� >2n−2; i.e., ch�σyes� = ch�σno� = n− 1.

4Because a perfect strategy S uses the least possible number of questions, as given byBerlekamp’s bound, S cannot be superseded by a shorter strategy. Thus every perfect strategyis a fortiori an optimal strategy. On the other hand, this paper will exhibit several optimalstrategies which are not perfect.

Page 6: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

70 cicalese and mundici

3. BACKGROUND FROM CODING THEORY

For arbitrary integers k ≥ 2 and n > 0 let Ex; Ey ∈ �0; 1; : : : ; k− 1�n. TheHamming distance dH�Ex; Ey� is defined by

dH�Ex; Ey� = ��i ∈ �1; : : : ; n� � xi 6= yi��;

where, as above, �A� denotes the number of elements of A.The Hamming sphere Br�Ex� with radius r and center Ex is the set of ele-

ments of �0; 1; : : : ; k − 1�n whose Hamming distance from Ex is ≤ r; insymbols,

Br�Ex� = �Ey ∈ �0; 1; : : : ; k− 1�n � dH�Ex; Ey� ≤ r�:

For any Ex ∈ �0; 1; : : : ; k− 1�n we have

�Br�Ex�� =r∑i=0

(n

i

)�k− 1�i: (6)

The Hamming weight wH�Ex� is the number of non-zero digits of Ex.We refer to [13] for background in coding theory. When k is clearly under-stood from the context, by a code we shall mean a k-ary code in the fol-lowing sense:

Definition 3.1. A (k-ary) code C of length n is a subset of �0; 1; : : : ; k−1�n. When k = 2 we will call C a binary code. Its elements are calledcodewords. The minimum distance of C is given by

δ�C� = min�dH�Ex; Ey� � Ex; Ey ∈ C; Ex 6= Ey�:

We say that C is an �n;m; d� code iff C has length n, �C� = m, and δ�C� =d. The minimum weight of C is the minimum of the Hamming weights ofits codewords; in symbols, µ�C� = min�wH�Ex� � Ex ∈ C�.

Let C1 and C2 be two codes of length n. The minimum distance betweenC1 and C2 is defined by 1�C1;C2� = min�dH�Ex; Ey� � Ex ∈ C1; Ey ∈ C2�.

By definition, the empty set Z is an �n; 0; d� k-ary code for all integersn; d ≥ 0 and k ≥ 2. Further, for any code C and integer d ≥ 0, we havethe inequality 1�Z;C� ≥ d. Similarly, the code consisting of the singlecodeword 0 · · · 0︸ ︷︷ ︸

n times

is an �n; 1; d� k-ary code for all integers d ≥ 0 and k ≥ 2.

Lemma 3.2. Let e; n;m be integers > 0, and let k ≥ 2. Suppose C to bean �n;m; d� k-ary code such that µ�C� ≥ e and d ≥ 3. Then there exists an�n+ 2; km; d′� k-ary code D such that µ�D� ≥ e and d′ ≥ 3.

Page 7: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 71

Proof. Given any code G of length n together with tuples Ex = x1 · · ·xn ∈�0; 1; : : : ; k − 1�n and Ea = a1a2 · · · as ∈ �0; 1; : : : ; k − 1�s, we denote by�G ⊕ Ex� ⊗ Ea the k-ary code of length n+ s whose codewords are obtainedby adding Ex (termwise and modulo k) to every codeword of G, and thenappending the suffix Ea to the resulting n-tuple. In symbols,

�G ⊕ Ex� ⊗ Ea = �z1 · · · zna1 · · · as � zi ≡ yi + xi mod k

for some y1 · · · yn ∈ G; with z1; : : : ; zn ∈ �0; 1; : : : ; k− 1��:

Let us now define the code D by

D =k−1⋃i=0

�C ⊕ i 00 · · · 0︸ ︷︷ ︸n−1 times

� ⊗ ii: (7)

We claim that D satisfies the requirements of the lemma. By definition, thelength of D is n+ 2. Since for all 0 ≤ i < j ≤ k− 1,

�C ⊕ i00 · · · 0� ⊗ ii ∩ �C ⊕ j00 · · · 0� ⊗ jj = Z;

we immediately obtain � D �= k× � C �.We shall now show that δ�D� ≥ 3. Indeed, any two distinct codewordsEx; Ey ∈ D have the form Ex = �Ex′ ⊕ i00 · · · 0�⊗ ii and Ey = �Ey ′ ⊕ j00 · · · 0�⊗ jjfor suitable codewords Ex′; Ey ′ ∈ C and i; j ∈ �0; 1; : : : ; k− 1�.

We now argue by cases:

(i) If i = j then Ex′ 6= Ey ′, whence

dH�Ex; Ey� = dH��Ex′ ⊕ i00 · · · 0� ⊗ ii; �Ey ′ ⊕ i00 · · · 0� ⊗ ii� = dH�Ex′; Ey ′� ≥ 3;

by our hypothesis on δ�C�.(ii) If i 6= j then

dH�Ex; Ey� = dH��Ex′ ⊕ i00 · · · 0� ⊗ ii; �Ey ′ ⊕ j00 · · · 0� ⊗ jj�= dH��Ex′ ⊕ i00 · · · 0�; �Ey ′ ⊕ j00 · · · 0�� + 2:

If Ex′ = Ey ′ then dH��Ex′ ⊕ i00 · · · 0�; �Ey ′ ⊕ j00 · · · 0�� = 1; hence dH�Ex; Ey� = 3.If Ex′ 6= Ey ′ then dH��Ex′ ⊕ i00 · · · 0�; �Ey ′ ⊕ j00 · · · 0�� ≥ d − 1 ≥ 2, whencedH�Ex; Ey� ≥ 4.

Finally, by definition µ�D� = µ�C� ≥ e. The proof is complete.

The following lemma directly follows from the well known Gilbertbound [13].

Page 8: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

72 cicalese and mundici

Lemma 3.3. Let n ≥ 0; k ≥ 2. Let M ≥ 0 be an integer satisfying theinequality

M ≤ kn −∑3

i=0

(ni

)�k− 1�i∑2i=0

(ni

)�k− 1�i :

Then there exists an �n;M; 3� k-ary code C with µ�C� ≥ 4.

Proof. We can safely identify our alphabet with the set K =�0; 1; : : : ; k − 1�. Let C′ be the largest k-ary code of length n such thatδ�C′� ≥ 3 and µ�C′� ≥ 4. Then there is no word in Kn simultaneously hav-ing distance ≥ 3 from each word in C′, and distance ≥ 4 from E0. Statedotherwise, the spheres B2�Ec�, with Ec ∈ C′, cover Kn \B3�E0�. We then con-clude that the sum �C′�∑2

i=0

(ni

)�k− 1�i of the volumes of these spheres is≥ �Kn \B3�E0�� = kn −

∑3i=0

(ni

)�k− 1�i.

4. OPTIMAL STRATEGIES FOR BINARY SEARCH WITHMINIMUM ADAPTIVENESS

By Lemma 2.1(ii), at least ch�2m; 0; 0� questions are necessary for Paulto guess the unknown number xCarole ∈ S = �0; 1; : : : ; 2m − 1�, if up totwo answers may be erroneous. In this section we shall prove that, con-versely (with the exception of m = 2 and m = 4), ch�2m; 0; 0� questionsare sufficient under the following constraint: Paul first sends to Carole abatch of m non-adaptive questions D1; : : : ;Dm, and then, only dependingon Carole’s answers, he sends ch�2m; 0; 0� −m non-adaptive questions ina second batch. More precisely, the first batch of questions asks for thebinary representation of xCarole. The above perfect strategy is “canonical” inthe following sense

Definition 4.1. A strategy S for a state σ of type �2m; 0; 0� is said to becanonical iff S is winning for σ and consists of two batches of non-adaptivequestions, where the questions in the first batch ask for the binary digitsof xCarole, and the second batch only depends on the m-tuple of Carole’sanswers to these questions.

In Lemma 4.11 below we shall see that a perfect strategy with minimumadaptiveness, albeit non-canonical, also exists for the case m = 4.

Canonical Binary Search with Minimum Adaptiveness

The first batch of questions is described as follows:

For each i = 1; 2; : : : ;m, let Di ⊆ S denote the question “Is the ith binary digitof xCarole equal to 1?” Thus a number y ∈ S belongs to Di iff the ith bit yi of itsbinary expansion Ey = y1 · · · ym is equal to 1.

Page 9: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 73

Upon identifying 1 = “yes” and 0 = “no,” let bi ∈ �0; 1� be Carole’sanswer to question Di. Let Eb = b1 · · · bm. Repeated application of (1), (2),beginning with the initial state σ = �S;Z;Z�, shows that Paul’s state ofknowledge as an effect of Carole’s answers is a triplet σ Eb = �A0;A1;A2�,where

A0 = the singleton containing the number whose binary expansionequals Eb

A1 = �y ∈ S � dH�Ey; Eb� = 1�A2 = �y ∈ S � dH�Ey; Eb� = 2�.

By direct verification we have �A0� = 1, �A1� = m, �A2� =(m2

). Thus the

state σ Eb is of type �1;m; (m2 )�. As in (3), let σi be the state resulting afterCarole’s first i answers, beginning with σ0 = σ . Since each question Di

is balanced for σi−1, an easy induction using Lemma 2.3 yields ch�σ Eb� =ch�2m; 0; 0� −m.

The Critical Index mn

For each m-tuple Eb ∈ �0; 1�m of Carole’s answers, we shall constructa non-adaptive strategy with ch�1;m; (m2 )� questions, which turns out tobe winning for the state σ

Eb. To this purpose, let us consider the val-ues of ch�1;m; (m2 )� for m ≥ 1. A direct computation yields ch�1; 1; 0� =4, ch�1; 2; 1� = 5, ch�1; 3; 3� = ch�1; 4; 6� = 6, ch�1; 5; 10� = · · · =ch�1; 8; 28� = 7, ch�1; 9; 36� = · · · = ch�1; 14; 91� = 8; : : : .

Definition 4.2. Let n ≥ 4 be an arbitrary integer. The critical index mn

is the largest integer m ≥ 0 such that ch�1;m; (m2 )� = n. Thus,

ch(

1;mn;

(mn

2

))= n and ch

(1;mn + 1;

(mn + 1

2

))> n: (8)

The function n 7→ mn is well defined for all n ≥ 4. The first values of mn

are given by

m4 = 1; m5 = 2; m6 = 4; m7 = 8; (9)

m8 = 14; m9 = 22; m10 = 34;

m11 = 52; m12 = 78; m13 = 114; (10)

m14 = 166; m15 = 240; : : : :

As usual, for every real number ρ we denote by �ρ� the largest integerk ≤ ρ.

Page 10: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

74 cicalese and mundici

Lemma 4.3. Let n ≥ 4 be an arbitrary integer.

(i) If n is odd then mn = 2�n+1�/2 − n− 1.(ii) If n is even then, letting m∗ = �2�n+1�/2� − n − 1, we either have

mn = m∗ or mn = m∗ + 1.

Proof. The case n = 4 is settled by direct verification, recalling thatm4 = 1. For the case n ≥ 5 see [14, Lemma 4.2], where our present mn isdenoted nχ and is called the first critical index.

Strategies and Codes: The Second Batch of Questions

As a key tool for the construction of the second batch of questions weprepare the following

Lemma 4.4. For any integers a0; a1; a2 ≥ 0, let σ = �A0;A1;A2� be astate of type �a0; a1; a2� and n = ch�a0; a1; a2�. Then a non-adaptive winningstrategy for σ with n questions exists if and only if for some integers d0 ≥ 5and d1 ≥ 3 there exist an �n; a0; d0� binary code C0 and an �n; a1; d1� binarycode C1 such that 1�C0;C1� ≥ 4.

Proof. ⇒ Assume σ = �A0;A1;A2� to be a state of type �a0; a1; a2�having a non-adaptive winning strategy S with n questions T1; : : : ; Tn. Letthe map

z ∈ A0 ∪A1 ∪A2 7→ EzS ∈ �0; 1�n

send each z ∈ A0 ∪A1 ∪A2 into the n-tuple of bits EzS = zS1 · · · zS

n arising,via the identifications “yes” = 1 and “no” = 0, from the answers to thequestions “does z belong to T1?,” “does z belong to T2?,” : : :, “does zbelong to Tn?” More precisely, for each j = 1; : : : ; n; zS

j = 1 iff z ∈ Tj . LetC ⊆ �0; 1�n be the range of the map z 7→ EzS .

We shall prove that, for each i ∈ �0; 1�, the set Ci = �EyS ∈ C � y ∈ Ai� isan �n; ai; di� binary code for some di ≥ 5− 2i; further, for every z ∈ A1 andh ∈ A0 we shall establish the inequality dH�EzS ; EhS � ≥ 4, i.e., 1�C1;C2� ≥ 4.

Since S is winning, the map z 7→ EzS is one-one, whence in particular�C0� = a0 and �C1� = a1. Moreover, by definition, C0 and C1 are subsets of�0; 1�n. The remaining desired properties δ�Ci� ≥ 5− 2i and 1�C0;C1� ≥ 4are direct consequences of the following

Claim. For all i; j ∈ �0; 1� and Ec ∈ Ci; Ed ∈ Cj we have dH�Ec; Ed� ≥4− �i+ j�.

For otherwise (absurdum hypothesis) assuming c ∈ Ai and d ∈ Aj tobe two distinct elements satisfying dH�EcS ; EdS � < 4− �i + j�, we will provethat S is not a winning strategy. We can safely assume cS

k = dSk for each

k = 1; : : : ; n− 3+ �i+ j�. Suppose Carole’s answer to question Tk is “yes”

Page 11: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 75

or “no” according as cSk = 1 or ¿cS

k = 0, respectively. Then c and d satisfyall of Carole’s n− 3+ �i + j� answers. It follows that Paul’s resulting stateof knowledge has the form σ ′ = �A′0;A′1;A′2�, with c ∈ A′i and d ∈ A′j ,whence the type of σ ′ is �a′0; a′1; a′2� with a′i + a′j ≥ 2. By [3, Lemma 2.5]we have ch�σ ′� ≥ 4 − �i + j�. By Lemma 2.1(ii), in either case 3− �i + j�questions/answers will not suffice to reach a final state, a contradiction.

⇐ Let C0 be an �n; a0; d0� code, with d0 ≥ 5, and let C1 be an �n; a1; d1�code, with d1 ≥ 3. Moreover, assume 1�C0;C1� ≥ 4. Let H ⊆ �0; 1�n bethe union of the Hamming spheres of radius 2 centered at the codewordsof C0, together with the Hamming spheres of radius 1 centered at the code-words of C1; in symbols, H = ⋃Ex∈C0

B2�Ex� ∪⋃Ey∈C1

B1�Ey�. By our standinghypothesis on δ�C0�; δ�C1� and 1�C0;C1�, it is not hard to see that, forany two distinct codewords Ex0; Ex1 ∈ C0 and any two distinct codewordsEy0; Ey1 ∈ C1, the Hamming spheres B2�Ex0�;B2�Ex1�;B1�Ey0�; B1�Ey1� are pair-wise disjoint. From (6) it follows that �H � = �(n2) + n + 1�a0 + �n + 1�a1.Let C2 = �0; 1�n \ H . Since n = ch�a0; a1; a2�, by definition of charac-ter we have 2n ≥ �(n2) + n + 1�a0 + �n + 1�a1 + a2. It follows that �C2� =2n − �H � ≥ a2. Trivially, C2 is an �n;χ; 1� binary code for some χ ≥ a2.Let σ = �A0;A1;A2� be an arbitrary state of type �a0; a1; a2�. Let us nowfix, once and for all, three one-one maps f0x A0 → C0, f1x A1 → C1, andf2x A2 → C2. The existence of f0; f1, and f2 is ensured by the minimumdistance of the the codes C0;C1, and C2.

Let the map f x A0 ∪A1 ∪A2 → �0; 1�n be defined by cases as follows:

f �y� = f0�y�; y ∈ A0f1�y�; y ∈ A1f2�y�; y ∈ A2:

(11)

Note that f is one-one. For each y ∈ A0 ∪A1 ∪A2 and j = 1; : : : ; n letf �y�j be the jth bit of the binary vector corresponding to y via f .

Let the set Tj ⊆ S be defined by Tj = �z ∈ S � f �z�j = 1�; �j = 1; : : : ; n�. This isPaul’s second batch of questions. Intuitively, letting xCarole denote Carole’s secretnumber, Tj asks “is the jth bit of f �xCarole� equal to 1?”

We shall show that the sequence T1; : : : ; Tn yields a perfect non-adaptivewinning strategy for σ . Again writing “yes” = 1 and “no” = 0, Carole’sanswers to questions T1; : : : ; Tn determine an n-tuple of bits Ea = a1 · · · an.As in (3), let σi be the state resulting after Carole’s first i answers, beginningwith σ0 = σ . Arguing by cases, we shall show that σn = �A∗0;A∗1;A∗2� is afinal state.

By (1), (2), for all i = 0; 1; 2, any z ∈ Ai that falsifies > 2 − i answersdoes not survive in σn—in the sense that z 6∈ A∗0 ∪A∗1 ∪A∗2.

Page 12: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

76 cicalese and mundici

Case 1. Ea 6∈ ⋃h∈A0B2�f �h�� ∪

⋃y∈A1

B1�f �y�� ∪ f �A2�.Then for any i = 0; 1; 2 and for each h ∈ Ai we have h 6∈ A∗0 ∪A∗1 ∪A∗2.

As a matter of fact, from Ea 6∈ B2−i�f �h��, it follows that dH�f �h�; Ea� >2 − i, whence h falsifies > 2 − i of the answers to T1; : : : ; Tn, and h doesnot survive in σn. We have proved that A∗0 ∪A∗1 ∪A∗2 is empty, and σn is afinal state.

Case 2. Ea ∈ B2−i�f �h�� for some i ∈ �0; 1; 2� and h ∈ Ai.Then h ∈ A∗0 ∪A∗1 ∪A∗2, because dH�f �h�; Ea� ≤ 2− i, whence h falsifies≤ 2− i answers. Our assumptions about C0;C1, and C2 ensure that, for allj = 0; 1; 2 and each h′ ∈ Aj (with h′ 6= h) we have Ea 6∈ B2−j�f �h′��. Thus,dH�f �h′�; Ea� > 2 − j and h′ falsifies > 2 − j of the answers to T1; : : : ; Tn,whence h′ does not survive in σn. This shows that h′ 6∈ A∗0 ∪ A∗1 ∪ A∗2.Therefore, A∗0 ∪ A∗1 ∪ A∗2 only contains the element h, and σn is a finalstate.

Corollary 4.5. Let m = 1; 2; 3; : : : and n = ch�1;m; (m2 )�. Let σ =�A0;A1;A2� be any state of type �1;m; (m2 )�. Then there exists a non-adaptivewinning strategy for σ with n questions if and only if for some integer d ≥ 3there exists an �n;m; d� binary code with minimum Hamming weight ≥ 4.

Proof. If there exists a non-adaptive winning strategy for σ with n ques-tions then by Lemma 4.4 there exist an �n; 1; d0� code C0 and an �n;m; d1�code C1 with d0 ≥ 5; d1 ≥ 3, and 1�C0;C1� ≥ 4. Let C0 = �Eh�. Let

C = �Ey ⊕ Eh � Ey ∈ C1�;where ⊕ stands for bitwise sum modulo 2. For any two distinct codewordsEa; Eb ∈ C we have Ea = Ec ⊕ Eh and Eb = Ed ⊕ Eh, for uniquely determined ele-ments Ec; Ed ∈ C1. Thus we get dH� Ea; Eb� = dH�Ec ⊕ Eh; Ed ⊕ Eh� = dH�Ec; Ed� ≥d1 ≥ 3, whence δ�C� ≥ 3. Using the abbreviation

E0 = 0 · · · 0︸ ︷︷ ︸n times

;

we have wH� Ea� = dH� Ea; E0� = dH�Ec ⊕ Eh; Eh ⊕ Eh� = dH�Ec; Eh� ≥ 4, whenceµ�C� ≥ 4. In conclusion, C is an �n;m; d� code with d ≥ 3 and µ�C� ≥ 4,as required.

Conversely, let C be an �n;m; d� code with d ≥ 3 and µ�C� ≥ 4. LetD = �E0�. Then D is an �n; 1; d′� code for every d′ ≥ 1. Furthermore, wehave 1�C;D� ≥ 4. Thus by Lemma 4.4 there exists a non-adaptive winningstrategy for σ with n questions. The proof is complete.

Lemma 4.6. For each integer n ≥ 7 there exists an integer d ≥ 3 and an�n;mn; d� code Cn such that µ�Cn� ≥ 4, where mn is as in Definition 4.2.

Page 13: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 77

Proof. We shall argue by cases.

Case 1. 7 ≤ n < 11.With reference to (9), (10) we can write m7 = 8;m8 = 14;m9 =

22;m10 = 34. By direct inspection in [5, Table I-A], for suitable integerse1; e2 > 0 with e1 + e2 ≥ mn there exist an �n; e1; 4� binary code A1 andan �n; e2; 4� binary code A2. Moreover, for every Ex ∈ A1; wH�Ex� = 4 andfor all Ey ∈ A2; wH�Ey� = 7; hence dH�Ex; Ey� ≥ 3. It follows that every setCn ⊆ A1 ∪ A2 such that �Cn� = mn is an �n;mn; 3� binary code with theadditional property µ�Cn� = 4, as required.

Case 2. n ≥ 11.

Claim. There exists an �n; e; d� binary code Dn such that e ≥ 2�n+1�/2,d ≥ 3, µ�Dn� ≥ 4.

We argue by induction on n.

Basis. �n = 11; 12�. Then direct inspection in [5, Table I-A] yields twobinary codes A1;A2, such that

• A1 is an �11; 66; 4� code and for every Ex ∈ A1; wH�Ex� = 6;

• A2 is a �12; 132; 4� code and for every Ex ∈ A2; wH�Ex� = 6.

Let D11 = A1 and D12 = A2. The inequalities 132 > 213/2 and 66 > 26 nowsettle our claim for n ∈ �11; 12�.

Induction Step. Assuming the claim to hold for n ≥ 11, by Lemma 3.2the claim also holds for n+ 2, as required.

From Lemma 4.3 we get 2�n+1�/2 > mn, whence the desired conclusionnow follows from our claim by arbitrarily picking a subcode Cn ⊆ Dn with�Cn� = mn.

Corollary 4.7. For m = 5; 6; 7; : : : let σ be a state of type �1;m; (m2 )�.Then there exists a perfect strategy S for σ . In other words, S is winning forσ and the number of questions in S coincides with Berlekamp’s lower boundch�σ� = ch�2m; 0; 0� −m.

Proof. Let n = ch�σ�. From the assumption m ≥ 5 we get n ≥ 7. ByDefinition 4.2, m ≤ mn. By Lemma 4.6 there exists an �n;mn; d� binarycode Cn with d ≥ 3 and µ�Cn� ≥ 4. Picking now a subcode C′n ⊆ Cn suchthat �C′n� = m and applying Corollary 4.5 we have the desired conclusion.

Turning our attention to the remaining cases, we shall prove that Corol-lary 4.7 also holds when m = 1 and m = 3. For m = 2 and m = 4 we shallprove that the shortest non-adaptive winning strategy for a state of type�1;m; (m2 )� requires ch�1;m; (m2 )� + 1 questions.

Page 14: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

78 cicalese and mundici

Lemma 4.8. Let C be the largest binary code of length 6 such that µ�C� =4 and δ�C� ≥ 3. Then �C� = 3.

Proof. Since the code D = �111100; 110011; 001111� satisfies δ�D� ≥3; µ�D� = 4, and �D� = 3, then the largest code C satisfying the require-ments of the lemma necessarily has ≥ 3 elements.

Conversely, we shall prove that any such C has ≤ 3 (and hence, exactly 3)elements. Let us write C = C�4� ∪ C�5� ∪ C�6�, where C�i� = �Ex ∈ C �wH�Ex� = i�. We shall prove the following easy facts:

(a) �C�5� ∪ C�6�� ≤ 1.(b) �C�4�� ≤ 3.(c) If �C�4�� = 3 then �C�5� ∪ C�6�� = 0.

There cannot exist two distinct codewords Ey1; Ey2 ∈ C�5� ∪C�6�, for other-wise, dH�Ey1; Ey2� ≤ 2, against the hypothesis δ�C� ≥ 3. This settles (a).

To prove (b), let Ex1; : : : ; Exn be the list of codewords of C�4�. For eachi = 1; : : : ; n let Ni = �Ey ∈ �0; 1�6 � dH�Exi; Ey� ≤ 1 and wH�Ey� = 5�. EachNi has exactly two elements, and whenever i 6= j we have Ni ∩Nj = Z. Itfollows that �⋃n

i=1Ni� = 6ni=1�Ni� = 2n. Therefore,

2n = �n⋃i=1

Ni� ≤ ��Ex ∈ �0; 1�6 � wH�Ex� = 5�� = 6;

and n ≤ 3, as desired.Finally, to prove (c), assume �C�4�� = 3. Since by the above proof of (b),⋃ni=1Ni exhausts the set of 6-tuples of bits having Hamming weight 5, every

6-tuple of bits having Hamming weight 5 is contained in the Hammingsphere of radius 1 centered at some codeword in C�4�. From the assumptionδ�C� ≥ 3 it follows that �C�5�� = 0. Finally, C�6� must be empty, because itsonly element 111111 has Hamming distance 2 from every element of C�4�.

Proposition 4.9. For each m = 1; 2; 3; 4 let λ�m� be the length of theshortest non-adaptive winning strategy for some (equivalently, for every) stateof type �1;m; (m2 )�. Then

λ�1� = 4; λ�2� = 6; λ�3� = 6; λ�4� = 7:

For m ∈ �1; 3�, and only for such values of m, the number λ�m� satisfies thecondition λ�m� = ch�1;m; (m2 )�.

Proof. For m = 1 we have λ�1� ≥ ch�1; 1; 0� = 4. Conversely, by Corol-lary 4.5, using the singleton code �1111�, we also get λ�1� ≤ 4.

For m = 2, by [9, pp. 75–76], any winning strategy for a state of type�1; 2; 1� necessarily uses ≥ 6 questions—even in the fully interactive model,

Page 15: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 79

where each question is adaptively asked after receiving the answer to theprevious questions. A fortiori, in our present non-adaptive case, λ�2� ≥6. On the other hand, taking the code C = �111100; 001111� and usingCorollary 4.5, one obtains a non-adaptive strategy with six questions whichis winning for every state of type �1; 2; 1�. Thus λ�2� ≤ 6.

For m = 3 we have λ�3� ≥ ch�1; 3; 3� = 6. Conversely, combiningCorollary 4.5 and Lemma 4.8 we get λ�3� ≤ 6.

Finally, let us consider the case m = 4. On the one hand, Corollary 4.5and Lemma 4.8 are to the effect that λ�4� ≥ 7. On the other hand, tak-ing the �7; 4; 3� code C = �1111000; 0001111; 0110011; 1111111� and againusing Corollary 4.5, we obtain a non-adaptive winning strategy with sevenquestions for any state of type �1; 4; 6�. Therefore, λ�4� ≤ 7, and the proofis complete.

Combining Corollary 4.7 and Proposition 4.9 we have

Theorem 4.10. For each integer m = 1; 3; 5; 6; 7; 8; : : : there is a binarysearching strategy S to guess a number x ∈ �0; : : : ; 2m − 1� with up to twolies in the answers, which is perfect and canonical. Thus, S uses a first batchof m non-adaptive questions asking for the bits of the binary expansion of xand then, only depending on the answers to these questions, a second batch ofch�2m; 0; 0� −m non-adaptive questions.

In casem ∈ �2; 4�, let S be the shortest canonical strategy to guess a numberx ∈ �0; : : : ; 2m − 1� with up to two lies in the answers. Then S requiresprecisely ch�2m; 0; 0� + 1 questions.

A Non-canonical Perfect Strategy for the Case m = 4The above theorem leaves open the possibility that there exist perfect

non-canonical strategies for the exceptional cases m = 2 and m = 4. Thefollowing lemma shows that this is indeed the case for m = 4. A finalremark in this section will (negatively) take care of the case m = 2.

Lemma 4.11. There exists a perfect binary strategy to guess a number x ∈S = �0; : : : ; 15� with up to two lies in the answers, using a first batch offive non-adaptive questions and then, only depending on the answers to thesequestions, a second batch of five non-adaptive questions.

Proof. Let xCarole denote Carole’s secret number. We can safely identifyeach x ∈ S with the four bit string x1x2x3x4 yielding the binary expansionof x. Paul’s first batch �Q1; : : : ;Q5� of non-adaptive questions is as follows:For each i = 1; : : : ; 4, question Qi asks

“Is the ith bit of (the binary expansion of) xCarole equal to 1?”

Question Q5 asks

“Is the sum modulo 2 of the first three bits of xCarole equal to 1?”

Page 16: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

80 cicalese and mundici

Let σ = �A0;A1;A2� denote Paul’s state resulting from Carole’s answersto questions Q1; : : : ;Q4. There is precisely one element h = h1h2h3h4 ∈ Ssuch that A0 = �h�. Specifically, using the identifications “yes” = 1 and“no” = 0, the ith bit hi of the only element of A0 coincides with Carole’sanswer to the ith question. Each element x = x1x2x3x4 ∈ A1 has preciselyone discrepancy from h (in the sense that xj = hj for all j = 1; 2; 3; 4except one.) Each element y = y1y2y3y4 ∈ A2 has exactly two discrepan-cies from h. Direct inspection shows that the type of σ is �1; 4; 6�. Letσ√ = �A

√0 ;A

√1 ;A

√2 � be the state resulting from the first five answers. Then,

denoting by b ∈ �0; 1� Carole’s answer to the fifth question, the state σ√

arises from σ in accordance to the formation rules (1), (2).

Claim 1. The type of σ√

is either �1; 1; 6� or �0; 4; 4�.We shall argue by cases as follows.

Case 1. h satisfies Carole’s fifth answer; i.e., h1 + h2 + h3 ≡ b mod 2.Then A

√0 = A0 = �h�. An element x = x1x2x3x4 ∈ A1 satisfies Carole’s

fifth answer iff its unique discrepancy from h occurs in the fourth position—so that the sum modulo 2 of its first three bits is the same as for h. Onlyone element x∗ ∈ A1 satisfies this condition, and A

√1 will only consist of

this element. The three remaining elements of A1 will survive as elementsof A

√2 , because they falsify exactly two of Carole’s answers to Q1; : : : ;Q5.

An element y = y1y2y3y4 ∈ A2 satisfies Carole’s fifth answer iff its twodiscrepancies from h both occur in the first three positions—so that thesum modulo 2 of the first three bits of y is the same as for h. The threeelements in A2 satisfying this condition will survive in A

√2 , together with

the three elements of A1 other than x∗. Since the remaining elements ofA2 falsify three answers, they do not survive in σ

√. For the case under

consideration, we have proved that σ√

is of type �1; 1; 6�.Case 2. h falsifies Carole’s fifth answer; i.e., h1+h2 +h3 ≡ 1− b mod 2.Then no element of S satisfies all five answers, and A

√0 = Z. Since h only

falsifies Carole’s answer to Q5 then h ∈ A√1 . An element x = x1x2x3x4 ∈

A1 belongs to A√1 iff it satisfies the fifth answer, iff its unique discrepancy

from h occurs among its first three bits—so that the sum of these three bitsmodulo 2 coincides with Carole’s answer. The three elements in A1 satisfy-ing this condition will be members of A

√1 , together with h. The remaining

element x† ∈ A1 will survive in A√2 . An element y = y1y2y3y4 ∈ A2 belongs

to A√2 iff it satisfies Carole’s fifth answer iff its two discrepancies from h are

not both occurring in the first three positions: this latter condition is nec-essary and sufficient for y1 + y2 + y3 ≡ b ≡ 1− �h1 + h2 + h3� mod 2. Thethree elements in A2 satisfying this condition belong to A

√2 , together with

Page 17: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 81

x†. The remaining members of A2 do not survive in σ√

. We have provedthat in the present case, σ

√is of type �0; 4; 4�, and the claim is proved.

Claim 2. For any state σ√

of either type �1; 1; 6� or �0; 4; 4� Paul has anon-adaptive winning strategy with five questions.

Indeed, if σ√

is of type �1; 1; 6� then ch�σ√� = 5. Let C0 = �00000� andC1 = �11111�. Then 1�C0;C1� = 5. Further, for all integers d0 ≥ 5 andd1 ≥ 3, Ci is a �5; 1; di� binary code (for each i ∈ �0; 1�). By Lemma 4.4there exists a non-adaptive winning strategy for σ

√with five questions.

If, on the other hand, σ√

is of type �0; 4; 4� then, again, ch�σ√� = 5.Let C0 = Z and C1 = �11100; 10111; 01011; 00000�. According to Defini-tion 3.1, we can write 1�C0;C1� ≥ 4. In the same way, C0 is a �5; 0; d�binary code for every integer d ≥ 5, and C1 is a �5; 4; 3� binary code. ByLemma 4.4 there exists a non-adaptive winning strategy for σ

√with five

questions. Our second claim is settled.Since ch�24; 0; 0� = 10, our two claims yield the desired perfect strategy.

Remark. As proved in [9], in the fully adaptive game with two lies, a per-fect strategy exists to find an m bit number iff m 6= 2. Therefore, combiningTheorem 4.10 and the above Lemma 4.11 we have now the stronger resultthat even if Paul is allowed to adapt his strategy only once, i.e., in the gamewith one-shot feedback, a perfect strategy exists to find an m bit number withtwo lies iff m 6= 2.

5. EXTENSIONS TO k-ARY SEARCH

We shall now consider the Ulam–Renyi problem with two lies and k-arysearch. In the corresponding game one now assumes that Paul asks questionshaving k distinct possible answers.

We shall generalize Theorem 4.10 by proving that, for any fixed inte-ger k = 2; 3; 4; : : :, with finitely many exceptions m, Paul can find Carole’sunknown number xCarole in the set �0; 1; : : : ; km − 1� using Berlekamp’sminimum number of k-ary questions and being allowed to adapt his strat-egy only once. Furthermore, we shall prove that for all k = 2; 3; : : :, andm = 1; 2; : : :, an optimal k-ary search can be achieved by strategies usingminimum adaptiveness. This strengthens the results in [8, 9].

Notation. In the Ulam–Renyi game with two lies and k-ary search, Pauland Carole first fix two integers k ≥ 2 and m ≥ 1. The search space S isidentified with the set �0; 1; : : : ; km − 1�. The definition of state and finalstate are the same as in Section 2. Typically, a k-ary question T has the form

“Which one of the sets T0; T1; : : : ; Tk−1 does xCarole belong to?,”

Page 18: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

82 cicalese and mundici

where T = �T0; T1; : : : ; Tk−1� is a k-tuple of (possibly empty) pairwisedisjoint subsets of S whose union is S.5 Carole’s answer is an integeri ∈ �0; 1; : : : ; k − 1�, telling Paul that xCarole belongs to Ti. Generaliz-ing (1), (2), if Paul is in state σ = �A0;A1;A2� and Carole’s answer isequal to i, then Paul’s state becomes

σi = �A0 ∩ Ti; �A0 \ Ti� ∪ �A1 ∩ Ti�; �A1 \ Ti� ∪ �A2 ∩ Ti��: (12)

A k-ary strategy with q questions is a k-ary tree of depth q where eachnode ν is labelled by a k-ary question Tν. The definitions of winning andnon-adaptive k-ary strategies are the natural generalizations of those givenin Section 2.

For every integer k ≥ 2 and state σ of type �a0; a1; a2�, Berlekamp’s(k-ary) weight of σ before q questions is defined by

w�k�q �σ� = a0

((q

2

)�k− 1�2 + q�k− 1� + 1

)+ a1�q�k− 1� + 1� + a2:

(13)This is a generalization of (4). Accordingly, Lemma 2.1 has the followingk-ary generalization.

Proposition 5.1. Let σ be an arbitrary state and let T be a question.Define ch�k��σ� = min�q = 0; 1; 2; : : : � w�k�q �σ� ≤ kq�. Let σi be as in (12).

(i) For every integer q ≥ 1 we have

w�k�q �σ� =k∑i=1

w�k�q−1�σi�:

(ii) If σ has a winning k-ary strategy with q questions then q ≥ch�k��σ�.

See [1, 8] for a detailed discussion of the properties of w�k�q .Generalizing Definition 2.2, by a perfect k-ary strategy for σ we now mean

a winning strategy for σ only requiring ch�k��σ� questions. GeneralizingDefinition 4.1, we say that a strategy S for a state σ of type �km; 0; 0� iscanonical iff S is winning for σ and consists of two batches of non-adaptivequestions, where the questions in the first batch ask for the k-ary digitsof xCarole, and the second batch only depends on the m-tuple of Carole’sanswers to these questions.

5Whenever Paul’s state of knowledge σ = �A0;A1;A2� is clear from the context, it willbe tacitly assumed that a question actually partitions only the set A0 ∪A1 ∪A2 of survivingelements in σ . (If so desired, for the sake of definiteness, the remaining elements of S can besafely attached to Tk−1.)

Page 19: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 83

Canonical k-ary Strategies with Minimum Adaptiveness

To guess the secret number xCarole in ch�k��km; 0; 0� questions, by analogywith the binary case, Paul adopts a canonical strategy S as follows: He firstnon-adaptively asks for the k-ary expansion of xCarole—thus spending mquestions. After receiving Carole’s answers, Paul fixes a k-ary encodingof the surviving candidates, and then non-adaptively asks Carole for theupdated encoding of xCarole. With finitely many exceptions m, the successof Paul’s search is guaranteed by Theorem 5.9 below, which in turns relieson a multitude of results in the theory of error-correcting codes.

By definition, the first batch of questions of S is given byFor each i = 1; 2; : : : ;m, let Di = �Di;0; : : : ;Di;k−1� denote the question “Whichis the ith digit in the k-ary expansion of xCarole?” Thus a number y ∈ S belongsto Di;j iff the ith digit of its k-ary expansion Ey = y1 · · · ym is equal to j.

Let bi ∈ �0; 1; : : : ; k − 1� be Carole’s answer to question Di. Let thestring Eb of k-ary digits be defined by Eb = b1 · · · bm. Repeated applicationof (12) beginning with the initial state σ = �S;Z;Z� shows that Paul’s stateof knowledge as an effect of Carole’s answers is a triplet σ Eb = �A0;A1;A2�,where

A0 = the singleton containing the number whose k-ary expansionequals Eb

A1 = �y ∈ S � dH�Ey; Eb� = 1�A2 = �y ∈ S � dH�Ey; Eb� = 2�.

Thus the state σEb has type �1;m�k − 1�; (m2 )�k − 1�2�. Moreover,

repeated application of Proposition 5.1(i) (compare with [8]) yieldsch�k��σ Eb� = ch�k��km; 0; 0� −m.

The k-ary Critical Index m�k�n

For eachm-tuple Eb ∈ �0; 1; : : : ; k− 1�m given by Carole’s answers, we shallconstruct a non-adaptive k-ary strategy with ch�k��1;m�k − 1�; (m2 )�k − 1�2�questions, and show that the strategy is winning for the state σ Eb.

To this purpose, let us consider the values of ch�k��1;m�k− 1�; (m2 )�k−1�2� for m ≥ 1.

Definition 5.2. Let k ≥ 2 and n ≥ 3 be arbitrary integers. The k-ary criti-cal index m�k�n is the largest integer m ≥ 0 such that ch�k��1;m�k− 1�; (m2 )�k−1�2� = n.

Lemma 5.3. Let n ≥ 3 be an arbitrary integer. Then for all k ≥ 2 we have⌊√2kn/2

k− 1

⌋− n− 1 ≤ m�k�n ≤

⌊√2kn/2

k− 1

⌋− n+ 1:

Page 20: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

84 cicalese and mundici

Proof. m�k�n is the largest integer m such that w�k�n �1;m�k− 1�; (m2 )�k−

1�2� ≤ kn. A tedious but straightforward computation yields

m�k�n =⌊√

8kn + k2 − 6k+ 12�k− 1� + k− 3

2�k− 1� − n⌋; (14)

from which the desired conclusion follows immediately.

The second batch of questions is obtainable from the following general-ization of Lemma 4.4.

Lemma 5.4. Fix integers a0; a1; a2 ≥ 0, k ≥ 2 and n ≥ ch�k��a0; a1; a2�.Let σ = �A0;A1;A2� be a state of type �a0; a1; a2�. Then there exists a non-adaptive winning k-ary strategy for σ with n questions if and only if for someintegers d0 ≥ 5 and d1 ≥ 3 there exist an �n; a0; d0� k-ary code C0 and an�n; a1; d1� k-ary code C1, such that 1�C0;C1� ≥ 4.

Proof. The proof is a routine variant of the proof of Lemma 4.4.

Corollary 5.5. Fix arbitrary integers k ≥ 2, m ≥ 1, and assume theinteger n to satisfy the inequality n ≥ ch�k��1;m�k − 1�; (m2 )�k − 1�2�. Letσ = �A0;A1;A2� be a state of type �1;m�k − 1�; (m2 )�k − 1�2�. Then thereexists a non-adaptive winning k-ary strategy for σ with n questions if and onlyif for some integer d ≥ 3 there exists an �n;m�k − 1�; d� k-ary code withminimum Hamming weight ≥ 4.

Auxiliary Results

Lemma 5.6. Let k ≥ 3 and n ≥ 5 be arbitrary integers. Then for someinteger M ≥ m

�k�n �k − 1� there exists an �n;M; 3� k-ary code Ck; n with

µ�Ck; n� ≥ 4.

Proof. We shall first consider the cases

(i) k = 3; n ≥ 11(ii) k = 4; 5; n ≥ 9

(iii) 6 ≤ k ≤ 8; n ≥ 8(iv) 9 ≤ k ≤ 19; n ≥ 7(v) 20 ≤ k ≤ 197; n ≥ 6

(vi) k ≥ 198; n ≥ 5.

In each of the above cases the desired result is a consequence of Lem-mas 3.3 and 5.3, together with the inequalities

kn −∑3i=0

(ni

)�k− 1�i∑2i=0

(ni

)�k− 1�i ≥√

2kn2 ≥ m�k�n �k− 1�:

Page 21: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 85

We now consider the cases

(vii) n = 5; 4 ≤ k ≤ 197(viii) n = 6; 5 ≤ k ≤ 19

(ix) n = 7; 5 ≤ k ≤ 8(x) n = 8; k = 5.

Case 1. k ≥ n− 1 is a prime power.Then there exists an �n; kn−2; 3� k-ary code Dk;n [20]. Such a code

belongs to the well known class of the MDS codes. In particular[13, Chap. 11, Theorem 6], Dk; n contains the codeword E0, has exactly(n

3

)�k− 1� codewords with Hamming weight 3, and (because of δ�Dk; n� =3) does not contain any non-zero codeword of Hamming weight ≤ 2. Upondefining Ck; n = �Ex � Ex ∈ Dk;n; wH�Ex� ≥ 4�, by Lemma 5.3 we have

�Ck; n� = kn−2 −(n

3

)�k− 1� − 1 ≥

√2kn/2 − �n− 1��k− 1� ≥ m�k�n �k− 1�:

Case 2. k > 5 not a prime power and �k; n� 6= �6; 7�.Then let p1 be the largest prime power < k and p2 the smallest prime

power > k. Let d = p2 − p1. Notice that, under our standing hypothesis,we have p1 ≥ n− 1. Let Ck; n be the code whose codewords are obtainedfrom those of Dp1; n

(as defined in Case 1), replacing by the digit p1 everyoccurrence of the zero digit. Trivially Ck; n is an �n;pn−2

1 ; 3� k-ary code andµ�Ck; n� = n > 4. Furthermore,

d ≤ 2 for 5 < k < 13;d ≤ 3 for 13 < k < 17;d ≤ 10 for 17 < k < 197:

(15)

Then the desired result follows from (15), together with Lemma 5.3 via theinequalities �Ck; n� = pn−2

1 ≥ √2�p1 + d − 1�n/2 − �n − 1��p1 + d − 2� ≥√2kn/2 − �n − 1��k − 1� ≥ m�k�n �k − 1� , which hold for any pair �k; n�

under consideration in the present case.

Case 3. �k; n� ∈ ��5; 7�; �5; 8�; �6; 7��.Again let p2 be the smallest prime power > k. Thus, under our standing

hypothesis, p2 ≥ n− 1. Let us define

Ck; n = �x1 · · ·xn ∈ Dp2; n� wH�Ex� ≥ 4 and

xi ≤ k− 1 for each i = 1; : : : ; n�:In other words, Ck; n is the subcode of Dp2; n

(as defined in Case 1) whosecodewords have Hamming weight ≥ 4 and are defined on the k-ary alphabet�0; 1; : : : ; k− 1�. We shall prove the inequality

�Ck; n� ≥ �k− 1�m�k�n : (16)

Page 22: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

86 cicalese and mundici

As a matter of fact, for every �n; kr; n− r + 1� k-ary MDS code C and forany choice of distinct indices i1; : : : ; ir ∈ �1; 2; : : : ; n� we have

�xi1xi2 · · ·xir � x1 · · ·xn ∈ C� = �0; 1; : : : ; k− 1�r :Therefore, for each i = 1; 2; : : : ; n and d ≤ k, there are exactly dkr−1

codewords in C whose ith digit is in �k − d; k − d + 1; : : : ; k − 1�. LetW ⊆ C be the set of codewords whose initial segment of length r − 1contains at least one of the digits �k − d; k − d + 1; : : : ; k − 1�. It is nothard to verify that the number α�k�d; r of elements of W is given by

α�k�d; r = k�kr−1 − �k− d�r−1�:

Fix now i ∈ �r; r + 1; : : : ; n�, and let β�k�d; r be the number of codewords ofW whose ith digit is in �k− d; k− d + 1; : : : ; k− 1�. Then we have

β�k�d; r = d�kr−1 − �k− d�r−1�:

Let us now turn our attention to code Ck; n. Recall that Dp2; nis an

�n;pn−22 ; 3� p2-ary MDS code. Thus setting d = p2 − k and r = n− 2, by

the above consideration, upon deleting from Dp2; nall codewords whose ini-

tial segment of length n− 3 contains one of the digits k; k+ 1; : : : ; p2 − 1,we obtain a new code D′p2; n

having exactly pr2 − α�p2�d; r codewords. Further-

more, for each i ∈ �n− 2; n − 1; n� there are at most dpr−12 − β�p2�

d; r code-words in D′p2; n

whose ith digit belongs to the set �k; k + 1; : : : ; p2 − 1�.Deleting from D′p2; n

all these codewords we obtain a new code D′′p2; nwhose

number of codewords is ≥ �D′p2; n� − 3�dpr−1

2 − β�p2�d; r �. Note that D′′p2; n

con-tains the codeword E0 and may well contain codewords with Hammingweight = 3. Since, as noted above, there are precisely

(n3

)�p2 − 1� code-words of weight 3 in Dp2; n

, we finally obtain

�Ck; n� ≥ γ�p2�k; n ;

where

γ�p2�k; n = pr2 − α�p2�

d; r − 3�dpr−12 − β�p2�

d; r � −(n

3

)�k− 1� − 1:

In conclusion, from the inequalities

γ�7�5; 7 = 414 > 4× 92 = 4×m�5�7

γ�7�5; 8 = 2788 > 4× 213 = 4×m�5�8

γ�7�6; 7 = 4973 > 5× 142 = 5×m�6�7

we have the desired result (16). Also Case 3 is settled.

Page 23: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 87

We are now left with the nine cases

(xi) k = 3; n = 5; 6; 7; 8; 9; 10(xii) k = 4; n = 6; 7; 8.

In the Appendix we display the desired codes Ck; n for each of thesecases. Direct inspection shows that �Ck; n� = �k− 1�m�k�n .

Lemma 5.7. For each integer k ≥ 2 let Mk be the largest integer m suchthat there exists a �4;mk; 3� k-ary code. Then

(i) Mk = k for k = 3; 4; 5; 7; 8; 9; : : :(ii) Mk = k− 1 for k ∈ �2; 6�.

Proof. By the well known Singleton bound (see [13] and referencestherein) each �n;M; d� k-ary code satisfies the inequality M ≤ kn−d+1. Set-ting n = 4 and d = 3 we have the upper bound M ≤ k2, whence Mk ≤ k.

To prove (i) we recall that finding a �4; k2; 3� k-ary code is equivalent tofinding a pair of orthogonal Latin squares of order k (see [13, Chap. 11] andreferences therein). It was proved by Bose et al. [4] that orthogonal Latinsquares of order n do exist for all integers n ≥ 2, except for n ∈ �2; 6�. Thissettles (i).

In order to prove (ii), again by [4] we obtain M2 ≤ 1 and M6 ≤ 5. For theconverse inequality, the �4; 2; 3� binary code �0000; 1111� and the �4; 30; 3�6-ary code

�1000; 0110; 2220; 3330; 4440; 5550; 2101; 3011; 0321; 1231;

0202; 1312; 4022; 5132; 2542; 3452; 4303; 5213; 1423; 0533;

3143; 2053; 5404; 4514; 0044; 1154; 3505; 2415; 5345; 4255�are enough to show that M2 ≥ 1 and M6 ≥ 5. This settles (ii).

Corollary 5.8. For each integer k ≥ 3 let Mk be the largest integer msuch that there exists a �4;m�k− 1�; 3� k-ary code C with µ�C� = 4. Then

(i) Mk = k− 1 for k = 4; 5; 6; 8; 9; : : :(ii) Mk = k− 2 for k ∈ �3; 7�.

Proof. Let k′ = k − 1. The existence of a �4;M; 3� k-ary code C, withµ�C� = 4, is equivalent to the existence of a �4;M; 3� k′-ary code C′.Indeed, no codeword in C can contain a digit equal to 0, because ofµ�C� = 4, whence C is actually a �4;M; 3� code defined over the k′-aryalphabet �1; 2; : : : ; k′�. Thus from C one immediately obtains a k′-arycode in the sense of Definition 3.1. Conversely, replacing by the digit keach occurrence of the digit 0 in the codewords of a �4;M; 3� k′-ary codeC′, we get a �4;M; 3� k-ary code with µ�C� = 4. The desired conclusionnow immediately follows by Lemma 5.7.

Page 24: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

88 cicalese and mundici

Theorem 5.9. Fix integers k = 3; 4; : : : and m = 1; 2; : : :. Let S =�0; 1; : : : ; km − 1� and λ�k;m� be the number of questions in a shortestcanonical k-ary strategy to search for an unknown number x ∈ S with twolies. Let the sets E1; E2; E3 be defined by

E1 = ��3; 2�; �7; 6��

E2 = ��k;m� ∈ Z2 � k ≥ 5 and k ≤ m ≤ m�k�4 =⌊√

8k4+k2−6k+12�k−1� − 7k−5

2�k−1�⌋�

E3 = ��k;m� ∈ Z2 � k ≥ 5 and 1 ≤ m ≤ m�k�3 =⌊√

8k3+k2−6k+12�k−1� − 5k−3

2�k−1�⌋�.

We then have

(i) E2 coincides with the set of pairs �k;m� ∈ Z2 such that 5 ≤ k ≤ mand ch�km; 0; 0� = m+ 4. E3 coincides with the set of pairs �k;m� ∈ Z2 suchthat ch�km; 0; 0� = m + 3. Thus, in particular, for any fixed k, only finitelymany integers m are such that �k;m� ∈ E2 ∪ E3.

(ii) In case �k;m� 6∈ E1 ∪ E2 ∪ E3 then λ�k;m� = ch�k��km; 0; 0�.(iii) Otherwise, if �k;m� ∈ E1 ∪ E2 ∪ E3, then λ�k;m� =

ch�k��km; 0; 0� + 1.

Proof. After receiving Carole’s answers to his first m questions, Paul’sstate of knowledge σ is of type �1;m�k− 1�; (m2 )�k− 1�2�. Furthermore wehave ch�k��σ� = ch�k��km; 0; 0� −m. Therefore, for the proof of (ii) (resp.,of (iii)), it suffices to show that the shortest non-adaptive winning k-arystrategy for σ requires exactly ch�k��σ� (resp., ch�k��σ� + 1) questions.

Writing n as an abbreviation of ch�k��σ�, direct inspection shows thatn ≥ 3. A tedious but straightforward computation using Lemma 5.3settles (i).

(ii) Under the assumption �k;m� 6∈ E1 ∪ E2 ∪ E3 we shall exhibit a k-arynon-adaptive winning strategy for σ using n questions. We argue by cases:

Case 1. n ≥ 5.Then by Lemma 5.6 there exists an �n;M; 3� k-ary code Ck;n such that

µ�Ck;n� ≥ 4 and M ≥ m�k�n �k − 1�. By Definition 5.2, M ≥ m�k�n �k − 1� ≥m�k− 1�. The desired conclusion now follows from Corollary 5.5 by pickinga subcode Dk;m ⊆ Ck; n with �Dk;m� = m�k− 1�.

Case 2. n = 4.By direct inspection, for each k ∈ �3; 4�, we have m�k�4 = k − 1. By our

standing hypothesis �k;m� 6∈ E2 we easily obtain m ≤ �k− 1�.Let k 6∈ �3; 7�. By Corollary 5.8 there exists a �4; �k− 1�2; 3� k-ary code

C with µ�C� ≥ 4. Picking any subcode D ⊆ C, with �D� = m�k − 1�, andusing Corollary 5.5 we have the desired strategy.

Page 25: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 89

If k ∈ �3; 7� then from �k;m� 6∈ E1 we get m ≤ k− 2. Again by Corol-lary 5.8 there exists a �4; �k − 2��k − 1�; 3� k-ary code C with µ�C� ≥ 4.Picking now any subcode D ⊆ C, with �D� = m�k − 1� and using Corol-lary 5.5 we get the desired strategy.

Case 3. n = 3.This case would imply �k;m� ∈ E3, which is impossible.The proof of (ii) is complete.(iii) Under the assumption �k;m� ∈ E1 ∪ E2 ∪ E3, let ξ�σ� denote the

length of the shortest winning k-ary strategy for σ . We prove that ξ = n+ 1.We shall again argue by cases as follows:

Case I. �k;m� ∈ E1 ∪ E2.Then n = 4. By Corollaries 5.8 and 5.5 no winning k-ary strategy can

exist for σ with four questions, whence ξ�σ� ≥ 5. On the other hand, m ≤m�k�4 < m

�k�5 . Thus by Lemma 5.6 there exists a �5;M; 3� k-ary code C such

that µ�C� ≥ 4 and M ≥ m�k�5 �k − 1� > m�k − 1�. Picking now a subcodeD ⊆ C, with �D� = m�k − 1�, and using Corollary 5.5 we get ξ�σ� = 5 =ch�k��σ� + 1, as required.

Case II. �k;m� ∈ E3.We then have n = 3, k ≥ 5, and

m ≤⌊√

8k3 + k2 − 6k+ 12�k− 1� − 5k− 3

2�k− 1�

⌋< �k− 3�:

Trivially, no �3;m�k− 1�; 3� k-ary code C with µ�C� = 4 can exist; henceby Corollary 5.5 we have ξ�σ� ≥ 4 = ch�k��σ� + 1. Moreover, by Corol-lary 5.8, for some M ≥ �k− 1��k− 2� > m�k− 1� there exists a �4;M; 3�k-ary code C such that µ�C� = 4. Picking any subcode D ⊆ C such that�D� = m�k− 1� and using Corollary 5.5, we obtain a non-adaptive winningstrategy for σ with ch�k��σ� + 1 questions.

Proposition 5.10. Adopt the above notation. For each pair �k;m� ∈ E2 ∪E3 and state σ of type �km; 0; 0�, there is no perfect strategy for σ with twolies—even in the fully adaptive model.

Proof. Let σ = �A0;Z;Z� be a state of type �km; 0; 0�. Let τ =�Z;A0;Z�. Let T1; : : : ;Tm be the first m questions of a winning strategyS for σ . We shall prove that the number t of questions of S necessar-ily satisfies the inequality t > ch�k��km; 0; 0�, whence S cannot be perfect.For every sequence Er = r1 · · · rm of Carole’s answers (rj ∈ �0; : : : ; k− 1�) toT1; : : : ;Tm let σ Er denote the state resulting from these answers. As an effectof these answers, also τ is transformed into a new state τEr . Repeated appli-cation of Proposition 5.1(i) shows that, among Carole’s answering strategies

Page 26: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

90 cicalese and mundici

Er = r1 · · · rm to the above questions, at least one, say Ez = z1 · · · zm, satisfiesthe inequality

w�k�t−m�0; a; b� ≥

w�k�t �0; km; 0�

km= w�k�t−m�0; 1;m�k− 1��; (17)

where �a; b; c� is the type of σ Ez, and hence, �0; a; b� is the type of τEz.It follows that, for every t > m,

w�k�t−m�0; a; b� > k whenever m ≥ 1; (18)

and, moreover,

w�k�t−m�0; a; b� > k2 whenever m ≥ k: (19)

Therefore, recalling (18), for all m ≥ 1 we can write ch�k��0; a; b� ≥ 2.By [8, translation bound] the smallest winning strategy for σ Ez requires≥ 2 + ch�k��0; a; b� ≥ 4 questions. Therefore, t − m ≥ 4, and, recallingTheorem 5.9(i), we see that S is not perfect in case �k;m� ∈ E3.

Now turning attention to the case �k;m� ∈ E2, in the light of (19) forall m ≥ k we can write ch�k��0; a; b� ≥ ch�k��0; 1;m�k− 1�� ≥ 3. Again by[8, translation bound], the smallest winning strategy for σ Ez requires at least2+ ch�k��0; a; b� ≥ 5 questions. Since the strategy is assumed to be winningthen t −m ≥ 5, whence t ≥ m + 5. Again, S is not perfect, for all pairs�k;m� ∈ E2.

Further Preparatory Material

The following lemma provides perfect k-ary strategies with minimumadaptiveness for each case �k;m� ∈ E1, defined in Theorem 5.9. In viewof Theorem 5.9(iii), our perfect strategies here are non-canonical: indeed,every strategy considered in this section uses a first batch of m + 1(rather than m) non-adaptive questions. Paul’s state resulting from Carole’sanswers to these questions carries more information than Carole’s answersto the first batch of questions in any canonical strategy. A carefully designedsecond batch of ch�k��km; 0; 0� −m − 1 questions allows Paul to infalliblyguess Carole’s number.

Lemma 5.11. For each k = 2; 3; : : : there exists a perfect k-ary strategyto guess a number x ∈ S = �0; : : : ; kk−1� with up to two lies in the answers,using a first batch of k non-adaptive questions and then, only depending onthe answers to these questions, a second batch of ch�k��kk−1; 0; 0� − k non-adaptive questions.

Page 27: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 91

Proof. Again, let xCarole denote Carole’s secret number. Direct computa-tion shows that ch�k��kk−1; 0; 0� = k+ 3. Our first batch of k non-adaptivequestions, denoted �Q1;Q2; : : : ;Qk�, is defined as follows:

For each i = 1; : : : ; k− 1, question Qi asks “What is the ith digit in thek-ary expansion of xCarole?” Finally, question Qk asks “What is the sum(modulo k) of the digits in the k-ary expansion of xCarole?”

Claim. Only depending on Carole’s reply to questions Q1; : : : ;Qk, theresulting state is of either type �1; 0;

(k2

)�k− 1�� or �0; k; (k2)�k− 2��.As a matter of fact, let the map x ∈ S 7→ Ex = x1x2 · · ·xk ∈ �0; 1; : : : ; k−

1�k be defined by

xi = the ith digit in the k-ary expansion of x �i = 1; : : : ; k− 1�xk ≡ x1 + · · · + xk−1 mod k:

Let Ea = a1a2 · · · ak be the k-tuple of Carole’s answers, ai ∈ �0; : : : ; k−1�. There exists exactly one x ∈ S such that x1 · · ·xk−1 = a1 · · · ak−1.

Case 1. xk = ak.Then Ex = Ea and Paul’s state of knowledge after Carole’s first k answers

is of type �1; r; s� for some r; s ≥ 0. We shall prove

r = 0 and s =(k

2

)�k− 1�: (20)

Let us suppose r > 0 (absurdum hypothesis), and let h ∈ S be such thatdH�Eh; Ex� = 1. Since by definition, dH�h1 · · ·hk−1; x1 · · ·xk−1� ≥ 1 it followsthat dH�h1 · · ·hk−1; x1 · · ·xk−1� = 1. Let i ∈ �1; : : : ; k − 1� be such thatxi 6= hi. We then have hi ≡ xi + di mod k for a uniquely determined di ∈�1; : : : ; k− 1�. Therefore, modulo k, we can write the congruences

hk ≡k−1∑j=1

hj ≡(k−1∑j=1

xj

)+ di 6≡

(k−1∑j=1

xj

)≡ xk; (21)

thus obtaining the contradiction dH�Ex; Eh� = 2. This shows r = 0.To end the proof of (20), let s′ be the number of elements y ∈ S such

that dH�x1 · · ·xk−1; y1 · · · yk−1� = 1 and yk 6= xk; further let s′′ be thenumber of y ∈ S such that dH�x1 · · ·xk−1; y1 · · · yk−1� = 2 and yk = xk.Then s = s′ + s′′. To compute the value of s′, suppose y ∈ S to sat-isfy dH�x1 · · ·xk−1; y1 · · · yk−1� = 1 and yk 6= xk. Let i ∈ �1; : : : ; k − 1�be the only index such that yi 6= xi and write yi ≡ xi + di mod k fora uniquely determined di ∈ �1; : : : ; k − 1�. An easy modification of (21)shows that the number of such elements y is equal to the number of pos-sible choices of index i = 1; : : : ; k− 1 multiplied by the number of choicesof di = 1; : : : ; k− 1. Therefore, s′ = �k− 1�2.

Page 28: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

92 cicalese and mundici

In order to compute s′′ let y ∈ S be such thatdH�x1 · · ·xk−1; y1 · · · yk−1� = 2and yk = xk. There exist exactly two indices 1 ≤ i < j ≤ k − 1 such thatxi 6= yi and xj 6= yj . Write yi ≡ xi + di mod k and yj ≡ xj + dj mod jfor suitable di; dj ∈ �1; : : : ; k − 1�. We have the following congruences,modulo k:

k−1∑j=1

xj ≡ xk ≡ yk ≡k−1∑j=1

yj ≡(k−1∑j=1

xj

)+ di + dj: (22)

Thus, di + dj ≡ 0 mod k, whence di ≡ k − dj . Since every choice of diuniquely determines dj there are precisely k− 1 ways to choose di; dj and(k−1

2

)ways to choose i; j. We have shown that s′′ = (k−1

2

)�k− 1�, as required.Summing up, s =

[(k−12

)+ �k− 1�]�k − 1� = (

k2

)�k − 1�, and Eq. (20)holds.

Case 2. ak 6= xk.Then Paul’s state after Carole’s answers is of type �0; t; u�, with t ≥ 1

(because dH�Ex; Ea� = 1) and u ≥ 0. We shall first prove

t = k: (23)

To this purpose, let us write ak ≡ xk + dk mod k, for a uniquelydetermined dk ∈ �1; : : : ; k − 1�. For every y ∈ S; y 6= x we havedH�a1 · · · ak−1; y1 · · · yk−1� ≥ 1. For the identity dH� Ea; Ey� = 1 to hold, wemust have dH�a1 · · · ak−1; y1 · · · yk−1� = 1 and

∑k−1j=1 yj ≡ ak mod k. Let

i ∈ �1; : : : ; k − 1� be uniquely determined by the condition yi 6= xi = ai.Then yi ≡ xi + di mod k for a unique di ∈ �1; : : : ; k− 1�. Thus, modulo k,we can write the congruences(

k−1∑j=1

xj

)+ di ≡

k−1∑j=1

yj ≡ ak ≡ xk + dk ≡(k−1∑j=1

xj

)+ dk;

showing that dk = di. It follows that the number of elements y ∈ S whosek-ary coding has distance 1 from Ea is equal to the number k− 1 of possiblechoices of the index i, plus the single contribution given by x itself. Thisshows (23).

We shall now prove

u =(k

2

)�k− 2�: (24)

Let U ′ be the set of y ∈ S such that dH�y1 · · · yk−1; x1 · · ·xk−1� = 1 and yk 6=ak; further, let U ′′ be the set of y ∈ S such that dH�y1 · · · yk−1; x1 · · ·xk−1� =2 and yk ≡ ak ≡ xk + dk mod k. Let u′ and u′′ be the number of elementsof U ′ and U ′′, respectively.

Page 29: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 93

Assume y ∈ U ′. There is i ∈ �1; : : : ; k− 1� such that yi ≡ xi + di mod kfor some di ∈ �1; : : : ; k − 1�. Since yk 6= ak, we can write the followingcongruences modulo k:(

k−1∑j=1

xj

)+ di ≡

k−1∑j=1

yj ≡ yk 6≡ xk + dk ≡(k−1∑j=1

xj

)+ dk:

Thus, di 6= dk. Since di ∈ �1; : : : ; k− 1� \ �dk� we see that U ′ has as manyelements as the number k − 1 of possible choices for i multiplied by thenumber k− 2 of possible choices for di. Therefore, u′ = �k− 1��k− 2�.

Assume now y ∈ U ′′. Then there exist exactly two indices 1 ≤ i < j ≤k − 1, together with elements di; dj ∈ �1; : : : ; k − 1�, such that yi ≡ xi +di mod k and yj ≡ xj + dj mod k. We can write the following congruencesmodulo k:(

k−1∑j=1

xj

)+ di + dj ≡

k−1∑j=1

yj ≡ yk ≡ xk + dk ≡(k−1∑j=1

xj

)+ dk:

It follows that di + dj ≡ dk mod k. Then any element of U ′′ is uniquelydetermined by the choice of the pair of indices i; j together with the choiceof di ∈ �1; : : : ; k− 1� \ �dk�. Specifically, we must have di 6= dk because wemust ensure dj 6= 0 and di + dj ≡ dk mod k. Thus there are exactly u′′ =(k−1

2

)�k− 2� elements y ∈ U ′′. Summing up we have u = u′ + u′′ = �(k−12

)+�k− 1���k− 2� = (k2)�k− 2�, which establishes (24) and also concludes theproof of the claim.

To conclude the proof, assume the state σ resulting from Carole’sanswers to �Q1;Q2; : : : ;Qk� is of type �1; 0;

(k2

)�k − 1��. Direct compu-tation yields ch�k��σ� = 3. In view of Lemma 5.4, the trivial �3; 1; 5� k-arycode C0 = �000�, along with the empty code C1 = Z, provides the desiredresult.

For the other case, assume the state σ resulting from Carole’s answers to�Q1;Q2; : : : ;Qk� has type �0; k; (k2)�k− 2�. Again, ch�k��σ� = 3. One moreapplication of Lemma 5.4 using the codes C0 = Z and C1 = �www � w =0; 1; : : : ; k − 1� yields a non-adaptive k-ary winning strategy for σ withthree questions. The proof is complete.

6. MAIN RESULTS AND FINAL REMARKS

By Berlekamp’s bound (Proposition 5.1), every winning k-ary strategy Sto guess a number x ∈ �0; : : : ; km − 1� with up to two lies in the answersmust necessarily use at least ch�k��km; 0; 0� questions. As the reader willrecall, when S uses exactly ch�k��km; 0; 0� questions, S is said to be per-fect. We say that S is quasi perfect if it uses 1 + ch�k��km; 0; 0� questions.

Page 30: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

94 cicalese and mundici

The following result sums up what is known about the existence and non-existence of perfect and quasi perfect searching strategies with minimumadaptiveness and up to two faulty tests.

Theorem 6.1. Let the sets S1; S2; S3 be defined by

(i) S1 = ��2; 2�; �2; 4�; �3; 2�; �7; 6��(ii) S2 = ��k;m� ∈ Z2 � 5 ≤ k ≤ m and ch�km; 0; 0� = m+ 4�

(iii) S3 = ��k;m� ∈ Z2 � ch�km; 0; 0� = m+ 3�.We then have

(A) For any fixed k = 2; 3; 4; : : :, there are only finitely many integersm such that �k;m� ∈ S1 ∪ S2 ∪ S3.

(B) For all pairs of integers �k;m�, k ≥ 2;m ≥ 1, other than thoselisted in (i)–(iii), there is a perfect and canonical k-ary strategy S to guess anumber x ∈ �0; : : : ; km − 1� with up to two lies in the answers.6

(C) A non-canonical perfect strategy Z also exists for the pair �2; 4�, aswell as for the pairs �3; 2� and �7; 6� (more generally, for each pair �k; k− 1�,where k = 2; 3; : : :). Strategy Z uses a first batch of 1 + m non-adaptivequestions and then, only depending on the answers to these questions, a secondbatch of ch�k��km; 0; 0� −m− 1 non-adaptive questions.

(D) The pair �2; 2�, as well as all pairs listed in (ii) and (iii), has aquasi perfect strategy, using a first batch of m non-adaptive questions andthen, only depending on the answers to these questions, a second batch of1 + ch�k��km; 0; 0� − m non-adaptive questions. None of these pairs has aperfect strategy, even in the fully adaptive game.

Proof. (A) By Theorem 5.9(i) together with Eq. (14) we have

S2 = ��k;m� ∈ Z2 � k ≥ 5 and

m = k; k+ 1; : : : ;

⌊√8k4 + k2 − 6k+ 1

2�k− 1� − 7k− 52�k− 1�

⌋�

and

S3 = ��k;m� ∈ Z2 � k ≥ 5 and

m = 1; 2; : : : ;

⌊√8k3 + k2 − 6k+ 1

2�k− 1� − 5k− 32�k− 1�

⌋�:

This immediately yields the desired conclusion.

6Thus, by definition, S uses a first batch of m non-adaptive questions asking for the k-arydigits of x and then, only depending on the answers to these questions, a second batch ofch�k��km; 0; 0� −m non-adaptive questions.

Page 31: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 95

(B) This follows from Theorems 5.9(ii) and 4.10.

(C) This follows from Lemmas 4.11 and 5.11.

(D) The first statement follows from Theorem 4.10, together withTheorem 5.9(iii). For the second statement, all pairs listed in (ii) and (iii)are taken care of by Proposition 5.10. Concerning the pair �2; 2�, we firstnote that ch�2��4; 0; 0� = 7. Further, ch�2��0; 4; 0� = 5. By [3, translationbound], the shortest winning strategy for a state of type �4; 0; 0� requires atleast 3+ ch�2��0; 4; 0� = 8 questions, whence no winning strategy can existwith less than ch�2��4; 0; 0� + 1 questions. (Compare with the argument in[9, pp. 75–76].)

Remarks. (1) For each �k;m� the above result provides an optimaltwo-fault tolerant search strategy S for Paul to find an unknown num-ber x ∈ S = �0; 1; : : : ; km − 1�. With respect to fully non-adaptive strate-gies considered in two-error correcting theory (where optimality results arerather the exception), S has the property that Paul is allowed, once andonly once, to adapt his searching strategy. Thus Theorem 6.1 significantlystrengthens the optimality results proved in [8, 9] for the fully adaptivemodel.

(2) As is well known, the Ulam–Renyi game has an equivalent coop-erative formulation where, to fix ideas, Carole is identified with a satelliteand Paul is the receiver; answers are now k-ary digits transmitted by thesatellite via a noisy channel. Noise has the same effect as lies/errors. Forthis cooperative model, the results of our paper show that the minimumamount of redundancy which, by Berlekamp’s bound, is necessary for two-error correction of an m-tuple of k-ary digits, turns out to be sufficient—onthe condition that the receiver is allowed to send just one feedback messageto the satellite. This is achieved via the following protocol:

(i) the original m-tuple Ex is sent by the satellite and is received as Ex′;(ii) the receiver feeds Ex′ back to the satellite via a noiseless feedback

channel as in [3];

(iii) only depending on Ex′, the satellite sends a final tip Er ofch�k��km; 0; 0� −m many k-ary digits, which are received as Er ′, in such away that

(iv) from Ex′ Er ′ the receiver is able to recover the original m-tuple Ex(as well as Er), even if distortion has corrupted one or two of the digits ofExEr (causing Ex′ Er ′ to be received instead of ExEr).

(3) In this paper, perfect two-error-correcting minimum feedbackstrategies are effectively computed, for all m 6= 2, by an inductive procedurebased on several error-correcting codes actually existing in the literature.

Page 32: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

96 cicalese and mundici

This is not the same as giving nonconstructive existence proofs for suit-ably large m. For instance, our analysis has shown that, for m = 4, perfecttwo-error-correction can only be achieved if the receiver sends the feed-back acknowledgment after receiving m + 1 (rather than m) digits. Thisincreases by one digit the feedback size to be transmitted via the noiselesschannel during step (ii) in the above protocol.

REFERENCES

1. M. Aigner, Searching with lies, J. Combin. Theory Ser. A 74 (1995), 43–56.2. R. S. Borgstrom and S. Rao Kosaraju, Comparison-based search in the presence of

errors, in “Proceedings of the 25th Annual ACM Symposium on the Theory of Comput-ing, San Diego, California, 16–18 May 1993,” pp. 130–136.

3. E. R. Berlekamp, Block coding for the binary symmetric channel with noiseless, delaylessfeedback, in “Error-Correcting Codes” (H.B. Mann, Ed.), pp. 61–88, Wiley, New York,1968.

4. R.C. Bose, S. S. Shrikhande, and E. T. Parker, Further results in the construction ofmutually orthogonal Latin squares and the falsity of a conjecture of Euler, Canad. J.Math. 12 (1960), 189–203.

5. A. E. Brouwer, J. B. Shearer, N. J. A. Sloane, and W. D. Smith, A new table of constantweight codes, IEEE Trans. Inform. Theory 36 (1990), 1334–1380.

6. F. Cicalese, Q-ary searching with lies, in “Proc. of the Sixth Italian Conf. on TheoreticalComputer Science” (P. Degano, U. Vaccaro, and G. Pirillo, Eds.), pp. 228–240, WorldScientific, Singapore, 1998.

7. F. Cicalese and D. Mundici, Optimal binary search with two unreliable tests andminimum adaptiveness, in “Proc. of European Symposium on Algorithms (ESA’ 99)”(J. Nesetril, Ed.), Lectures Notes in Computer Science, Vol. 1643, pp. 257–266,Springer-Verlag, Berlin/New York, 1999.

8. F. Cicalese and U. Vaccaro, Optimal strategies against a liar, Theoret. Comput. Sci. 230(2000), 167–193.

9. J. Czyzowicz, D. Mundici, and A. Pelc, Ulam’s searching game with lies, J. Combin.Theory Ser. A 52 (1989), 62–76.

10. R. Hill, Searching with lies, in “Surveys in Combinatorics” (P. Rowlinson, Ed.), pp. 41–70,Cambridge Univ. Press, Cambridge, UK, 1995.

11. R. Hill, J. Karim, and E. R. Berlekamp, The solution of a problem of Ulam on searchingwith lies, in “IEEE ISIT 1998, Cambridge, MA,” p. 244.

12. E. Knill, Lower bounds for identifying subset members with subset queries, in “Proc. ofthe Sixth Annual ACM-SIAM Symposium on Discrete Algorithms,” pp. 369–377, 1995.

13. F. J. MacWilliams and N. J. A. Sloane, “The Theory of Error-Correcting Codes,” North-Holland, Amsterdam, 1977.

14. D. Mundici and A. Trombetta, Optimal comparison strategies in Ulam’s searching gamewith two errors, Theoret. Comp. Sci. 182 (1997), 217–232.

15. A. Negro and M. Sereno, Ulam’s searching game with three lies, Adv. Appl. Math. 13(1992), 404–428.

16. A. Pelc, Solution of Ulam’s problem on searching with a lie, J. Combin. Theory Ser. A 44(1987), 129–142.

17. A. Pelc, Searching with permanently faulty tests, Ars Combin. 38 (1994), 65–76.18. A. Renyi, “Naplo az informacioelmeletrol,” Gondolat, Budapest, 1976 (English transla-

tion: “A Diary on Information Theory,” Wiley, New York, 1984).

Page 33: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 97

19. R. L. Rivest, A. R. Meyer, D. J. Kleitman, K. Winklmann, and J. Spencer, Coping witherrors in binary search procedures, J. Comput. System Sci. 20 (1980), 396–404.

20. R. C. Singleton, Maximum distance q-nary codes, IEEE Trans. Inform. Theory 10 (1964),116–118.

21. J. Spencer, Ulam’s searching game with a fixed number of lies, Theoret. Comput. Sci. 95(1992), 307–321.

22. A. Tietavainen, On the nonexistence of perfect codes over finite fields, SIAM J. Appl.Math. 24 (1973), 88–96.

23. S. M. Ulam, “Adventures of a Mathematician,” Scribner’s, New York, 1976.

APPENDIX: THE LAST NINE CODES OF LEMMA 5.6

We use the same notation as in the proof of Lemma 3.2, together withthe abbreviation E0j = 0 · · · 0︸ ︷︷ ︸

j times

. For each n ∈ �5; 6; 7; 8; 9; 10� the code C3; n

is given by

C3; n =n⋃i=5

D3; i ⊗ E0n−i;

where D3; 5; : : : ;D3; 10 are as follows in Table 1.

For each n ∈ �6; 7; 8� the code C4; n is given by

C4; n =n⋃i=6

D4; i ⊗ E0n−i;

where D4; 6; : : : ;D4; 8 are as follows in Table 2.

Page 34: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

98 cicalese and mundici

TAB

LE

1T

heco

des

C3;n,f

orn=

5;6;

7;8;

9;10

.

1.0

11

11

2.0

22

22

3.1

02

11

4.2

01

22

5.2

10

21

6.1

20

12

7.2

22

01

8.1

11

02

9.2

21

10

10.1

12

20

11.1

21

21

12.2

12

12

The

subc

ode

D3;

5:13

.21

10

01

14.1

22

00

115

.20

21

01

16.2

20

20

117

.10

12

01

18.0

21

01

119

.00

22

11

20.0

12

02

121

.00

11

21

22.1

10

22

123

.11

01

02

24.0

22

10

225

.01

12

02

26.1

20

01

2T

hesu

bcod

eD

3;6:

27.2

01

01

20

28.2

10

02

20

29.1

02

02

20

30.1

21

00

01

31.2

12

00

01

32.2

00

11

01

33.0

22

11

01

34.0

01

21

01

35.2

20

02

01

36.0

10

12

01

37.1

01

12

01

38.2

10

10

11

39.0

21

10

11

40.0

12

20

11

41.1

02

01

11

42.1

20

11

11

43.1

11

21

11

44.2

22

21

11

45.2

01

02

11

46.1

12

12

11

47.0

00

22

11

48.2

01

10

21

49.1

00

20

21

50.0

10

01

21

51.2

12

11

21

52.0

21

02

21

The

subc

ode

D3;

7:53

.00

21

22

10

54.2

11

22

21

055

.12

22

22

10

56.1

11

10

02

057

.12

02

00

20

58.2

02

20

02

059

.11

00

10

20

60.0

12

21

02

061

.12

20

20

20

62.0

21

12

02

063

.10

01

01

20

64.2

00

01

12

065

.01

01

11

20

66.2

21

11

12

067

.02

00

21

20

68.0

11

22

12

069

.10

22

21

20

70.2

20

00

22

071

.10

10

02

20

72.0

12

00

22

073

.00

11

12

20

74.1

22

11

22

075

.02

02

12

20

76.2

00

12

22

077

.21

01

00

01

78.1

22

10

00

179

.02

12

00

01

80.2

11

01

00

181

.02

01

10

01

82.1

00

21

00

183

.20

20

20

01

84.0

10

22

00

185

.01

21

01

01

86.2

20

01

10

187

.11

20

11

01

88.2

01

11

10

189

.01

12

11

01

90.1

00

02

10

191

.11

11

21

01

92.2

22

12

10

193

.11

10

02

01

94.2

22

00

20

195

.00

11

02

01

96.2

00

20

20

197

.00

20

12

01

98.1

21

11

20

1

The

subc

ode

D3;

8:99

.21

22

12

01

010

0.0

20

02

20

10

101.

10

12

22

01

010

2.2

01

00

01

10

103.

02

20

00

11

010

4.1

10

20

01

10

105.

12

00

10

11

010

6.2

21

11

01

10

107.

11

21

10

11

010

8.2

02

21

01

10

109.

01

10

20

11

011

0.1

21

22

01

10

111.

10

21

01

11

011

2.0

20

20

11

10

113.

21

12

01

11

011

4.2

10

02

11

10

115.

00

20

21

11

011

6.0

10

10

21

10

117.

00

22

02

11

011

8.2

00

01

21

10

119.

02

12

12

11

012

0.1

12

02

21

10

121.

10

01

22

11

012

2.2

20

22

21

10

123.

10

20

00

21

012

4.0

01

01

02

10

125.

22

02

10

21

012

6.1

11

21

02

10

127.

22

10

20

21

012

8.0

00

12

02

10

129.

21

22

20

21

013

0.0

10

00

12

10

131.

12

10

01

21

013

2.2

20

10

12

10

133.

00

12

01

21

013

4.1

12

20

12

10

135.

02

20

11

21

013

6.2

12

11

12

10

137.

20

02

21

21

013

8.2

11

10

22

10

139.

11

01

12

21

014

0.2

01

21

22

10

141.

01

21

22

21

014

2.1

01

10

00

20

143.

21

12

00

02

014

4.0

12

01

00

20

145.

11

01

10

02

014

6.0

21

02

00

20

147.

20

01

20

02

014

8.1

02

22

00

20

149.

11

00

01

02

015

0.0

20

10

10

20

151.

10

10

11

02

015

2.1

22

11

10

20

Page 35: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 99

TAB

LE

1—C

ontin

ued

153.

20

02

11

02

015

4.1

21

22

10

20

155.

21

22

21

02

015

6.2

12

10

20

20

157.

12

02

02

02

015

8.0

00

11

20

20

159.

11

12

12

02

016

0.0

22

21

20

20

161.

01

11

22

02

016

2.1

20

10

01

20

163.

01

11

00

12

016

4.2

02

10

01

20

165.

21

00

10

12

016

6.0

20

21

01

20

167.

10

00

20

12

016

8.0

12

22

01

20

169.

20

00

01

12

017

0.1

22

20

11

20

171.

01

10

11

12

017

2.0

02

11

11

20

173.

22

20

21

12

017

4.2

11

12

11

20

175.

02

00

02

12

017

6.2

11

00

21

20

177.

10

20

02

12

017

8.1

21

01

21

20

179.

22

01

12

12

018

0.1

10

22

21

20

The

subc

ode

D3;

9.18

1.0

01

22

21

20

018

2.2

22

00

02

20

018

3.0

10

20

02

20

018

4.2

01

11

02

20

018

5.1

22

21

02

20

018

6.0

02

02

02

20

018

7.1

12

12

02

20

018

8.2

21

20

12

20

018

9.1

20

01

12

20

019

0.1

11

11

12

20

019

1.2

02

12

12

20

019

2.0

22

22

12

20

019

3.0

21

10

22

20

019

4.2

02

01

22

20

019

5.1

00

21

22

20

019

6.0

10

02

22

20

019

7.1

20

12

22

20

019

8.0

12

10

00

01

019

9.2

22

20

00

01

020

0.1

12

01

00

01

020

1.2

20

11

00

01

020

2.2

21

02

00

01

020

3.1

00

22

00

01

020

4.0

11

22

00

01

020

5.1

20

10

10

01

020

6.0

10

20

10

01

020

7.2

10

01

10

01

020

8.0

22

11

10

01

020

9.2

01

21

10

01

021

0.1

01

02

10

01

021

1.2

00

12

10

01

021

2.1

22

22

10

01

021

3.0

21

00

20

01

021

4.2

02

00

20

01

021

5.1

01

10

20

01

021

6.0

10

11

20

01

021

7.1

02

21

20

01

021

8.2

11

12

20

01

021

9.0

20

22

20

01

022

0.1

02

00

01

01

022

1.0

20

10

01

01

022

2.2

11

10

01

01

022

3.2

00

20

01

01

022

4.2

01

01

01

01

022

5.1

21

11

01

01

022

6.0

10

21

01

01

022

7.1

10

02

01

01

022

8.0

22

02

01

01

022

9.2

02

12

01

01

023

0.2

20

00

11

01

023

1.0

02

10

11

01

023

2.1

21

20

11

01

023

3.0

12

01

11

01

023

4.1

00

21

11

01

023

5.0

11

12

11

01

023

6.2

10

22

11

01

023

7.1

11

00

21

01

023

8.1

22

10

21

01

023

9.0

01

20

21

01

024

0.2

12

20

21

01

024

1.2

22

01

21

01

024

2.0

00

02

21

01

024

3.2

20

12

21

01

024

4.2

10

00

02

01

024

5.0

01

10

02

01

024

6.0

20

01

02

01

024

7.1

00

11

02

01

024

8.2

12

11

02

01

024

9.2

21

21

02

01

025

0.0

02

22

02

01

025

1.2

01

00

12

01

025

2.1

12

00

12

01

025

3.2

22

10

12

01

025

4.1

21

01

12

01

025

5.1

10

12

12

01

025

6.1

10

20

22

01

025

7.0

22

20

22

01

025

8.0

11

01

22

01

025

9.2

00

21

22

01

026

0.1

20

02

22

01

026

1.2

12

02

22

01

026

2.1

02

12

22

01

026

3.1

20

00

00

11

026

4.2

12

00

00

11

026

5.2

01

10

00

11

026

6.1

11

20

00

11

026

7.0

02

20

00

11

026

8.2

00

01

00

11

026

9.0

21

01

00

11

027

0.1

22

21

00

11

027

1.1

10

12

00

11

027

2.0

22

12

00

11

027

3.2

20

22

00

11

027

4.2

21

00

10

11

027

5.1

02

00

10

11

027

6.0

00

21

10

11

027

7.0

10

02

10

11

027

8.2

11

22

10

11

027

9.0

20

10

20

11

028

0.1

12

10

20

11

028

1.1

10

01

20

11

028

2.2

02

11

20

11

028

3.2

21

21

20

11

028

4.0

01

02

20

11

028

5.1

22

02

20

11

028

6.0

12

22

20

11

028

7.2

22

10

01

11

028

8.0

02

01

01

11

028

9.2

10

11

01

11

029

0.1

01

21

01

11

029

1.0

01

12

01

11

029

2.1

12

22

01

11

029

3.2

00

10

11

11

029

4.0

20

01

11

11

029

5.2

11

01

11

11

029

6.1

22

11

11

11

029

7.1

21

02

11

11

029

8.2

12

12

11

11

029

9.0

22

22

11

11

030

0.1

00

00

21

11

030

1.0

12

00

21

11

030

2.0

00

11

21

11

030

3.1

11

11

21

11

030

4.1

20

21

21

11

030

5.2

02

02

21

11

030

6.0

11

00

02

11

030

7.1

21

10

02

11

030

8.1

00

20

02

11

030

9.2

22

01

02

11

031

0.1

01

02

02

11

031

1.2

11

12

02

11

031

2.0

21

22

02

11

031

3.2

10

20

12

11

031

4.1

00

01

12

11

031

5.0

01

11

12

11

031

6.2

02

21

12

11

031

7.2

20

02

12

11

031

8.0

02

10

22

11

031

9.2

20

11

22

11

032

0.0

10

21

22

11

032

1.1

11

22

22

11

032

2.2

22

22

22

11

0

The

subc

ode

D3;

10.

Page 36: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

100 cicalese and mundiciTA

BL

E2

The

code

sC

4;n,f

orn=

6;7;

8:

1.1

11

10

02.

22

21

00

3.3

33

10

04.

32

12

00

5.1

32

20

06.

21

32

00

7.2

31

30

08.

31

23

00

9.1

23

30

010

.21

10

10

11.1

22

01

012

.31

01

10

13.0

21

11

014

.10

31

10

15.2

20

21

016

.30

22

10

17.0

33

21

018

.13

03

10

19.1

31

02

020

.31

30

20

21.1

20

12

022

.20

11

20

23.0

12

12

024

.33

02

20

25.2

10

32

026

.10

23

20

27.2

32

03

028

.11

02

30

29.0

22

23

030

.32

03

30

31.0

11

33

032

.20

33

30

33.3

11

00

134

.22

30

01

35.2

10

10

136

.03

11

01

37.1

02

10

138

.12

02

01

¿39.

20

12

01

40.0

12

20

141

.33

03

01

42.1

10

01

143

.20

20

11

44.3

33

01

145

.30

11

11

46.0

13

11

147

.13

12

11

48.0

20

31

149

.32

00

21

50.0

32

02

151

.10

30

21

52.2

33

12

153

.02

12

21

54.1

11

32

155

.22

23

21

56.1

21

03

157

.13

01

31

58.3

12

13

159

.30

02

31

60.0

02

33

161

.11

20

02

62.3

20

10

263

.20

31

02

64.2

30

20

265

.02

32

02

66.1

01

30

267

.03

23

02

68.3

21

01

269

.03

01

12

70.2

12

11

271

.10

02

12

72.0

11

21

2T

hesu

bcod

eD

4;6.

73.0

03

31

20

74.3

02

02

20

75.3

11

12

20

76.1

32

12

20

77.1

13

22

20

78.3

23

32

20

79.2

10

03

20

80.0

31

03

20

81.2

21

13

20

82.2

02

23

20

83.3

33

23

20

84.1

22

33

20

85.3

22

00

30

86.1

33

00

30

87.3

10

20

30

88.2

20

30

30

89.3

03

30

30

90.2

30

01

30

91.1

01

01

30

92.0

12

01

30

93.3

32

11

30

94.2

23

11

30

95.3

11

31

30

96.2

21

02

30

97.3

00

12

30

98.0

02

22

30

99.0

30

32

30

100.

02

30

33

010

1.0

10

13

30

102.

21

12

33

010

3.1

03

23

30

104.

13

13

33

010

5.3

31

00

01

106.

11

30

00

110

7.1

30

10

01

108.

30

21

00

110

9.0

23

10

01

110.

32

00

10

111

1.0

32

01

01

112.

20

30

10

111

3.2

31

11

01

114.

31

12

10

111

5.1

23

21

01

116.

01

03

10

111

7.1

01

31

01

118.

22

23

10

111

9.3

33

31

01

120.

23

00

20

112

1.3

21

12

01

122.

21

31

20

112

3.0

31

22

01

124.

30

32

20

112

5.0

21

03

01

126.

10

20

30

112

7.2

00

13

01

128.

21

22

30

112

9.1

32

00

11

130.

30

30

01

113

1.0

30

20

11

132.

32

22

01

113

3.1

00

30

11

134.

01

13

01

113

5.2

33

30

11

136.

31

20

11

113

7.0

23

01

11

138.

33

01

11

113

9.2

32

21

11

140.

32

13

11

114

1.1

13

31

11

142.

13

11

21

114

3.0

03

12

11

144.

31

02

21

114

5.2

23

22

11

146.

20

13

21

114

7.3

32

32

11

148.

01

00

31

114

9.2

31

03

11

150.

02

21

31

115

1.0

01

23

11

152.

13

32

31

115

3.2

20

33

11

154.

31

00

02

115

5.0

33

00

21

156.

23

21

02

115

7.3

01

20

21

158.

02

03

02

115

9.1

30

01

21

The

subc

ode

D4;

7.

Page 37: Perfect Two-Fault Tolerant Search with Minimum Adaptiveness · 2017. 3. 2. · E-mail: cicalese@dia.unisa.it and Daniele Mundici3 Department of Computer Science, University of Milan,

perfect fault-tolerant search 101TA

BL

E2—

Con

tinue

d

160.

32

21

12

10

161.

21

32

12

10

162.

20

03

12

10

163.

03

13

12

10

164.

12

30

22

10

165.

33

31

22

10

166.

11

03

22

10

167.

00

23

22

10

168.

11

10

32

10

169.

22

20

32

10

170.

12

01

32

10

171.

01

31

32

10

172.

03

22

32

10

173.

33

03

32

10

174.

10

33

32

10

175.

12

00

03

10

176.

20

10

03

10

177.

31

11

03

10

178.

10

31

03

10

179.

02

12

03

10

180.

11

22

03

10

181.

33

32

03

10

182.

00

01

13

10

183.

12

11

13

10

184.

30

23

13

10

185.

01

10

23

10

186.

22

01

23

10

187.

03

21

23

10

188.

10

02

23

10

189.

21

23

23

10

190.

02

33

23

10

191.

30

00

33

10

192.

21

30

33

10

193.

32

31

33

10

194.

23

02

33

10

195.

32

30

00

20

196.

03

21

00

20

197.

10

32

00

20

198.

11

03

00

20

199.

30

13

00

20

200.

01

30

10

20

201.

00

23

10

20

202.

33

20

20

20

203.

13

31

20

20

204.

02

32

20

20

205.

12

13

20

20

206.

31

00

30

20

207.

20

10

30

20

208.

02

01

30

20

209.

33

11

30

20

210.

11

21

30

20

211.

23

32

30

20

212.

23

00

01

20

213.

30

01

01

20

214.

11

31

01

20

215.

33

12

01

20

216.

22

13

01

20

217.

00

33

01

20

218.

03

10

11

20

219.

13

21

11

20

220.

20

31

11

20

221.

32

02

11

20

222.

21

03

11

20

223.

30

10

21

20

224.

21

30

21

20

225.

03

01

21

20

226.

32

21

21

20

227.

01

23

21

20

228.

10

00

31

20

229.

01

11

31

20

230.

12

22

31

20

231.

31

32

31

20

232.

23

23

31

20

233.

13

10

02

20

234.

31

21

02

20

235.

20

23

02

20

236.

33

33

02

20

237.

30

00

12

20

238.

23

20

12

20

239.

02

31

12

20

240.

13

32

12

20

241.

12

03

12

20

242.

00

30

22

20

243.

23

11

22

20

244.

32

12

22

20

245.

01

20

32

20

246.

10

11

32

20

247.

00

02

32

20

248.

21

13

32

20

249.

10

20

03

20

250.

00

11

03

20

251.

23

31

03

20

252.

20

02

03

20

253.

01

32

03

20

254.

02

23

03

20

255.

02

00

13

20

256.

11

01

13

20

257.

30

12

13

20

258.

21

22

13

20

259.

33

03

13

20

260.

10

33

13

20

261.

13

00

23

20

262.

20

21

23

20

263.

31

31

23

20

264.

11

12

23

20

265.

32

10

33

20

266.

03

12

33

20

267.

31

23

33

20

268.

22

33

33

20

269.

12

10

00

30

270.

21

20

00

30

271.

01

12

00

30

272.

03

33

00

30

273.

30

10

10

30

274.

13

30

10

30

275.

20

21

10

30

276.

32

31

10

30

277.

11

22

10

30

278.

21

33

10

30

279.

11

00

20

30

280.

02

20

20

30

281.

20

02

20

30

282.

00

13

20

30

283.

23

23

20

30

284.

22

00

30

30

285.

21

11

30

30

286.

00

31

30

30

287.

03

02

30

30

288.

10

12

30

30

289.

30

23

30

30

290.

01

30

01

30

291.

02

01

01

30

292.

33

21

01

30

293.

13

13

01

30

294.

32

33

01

30

295.

22

10

11

30

296.

10

01

11

30

297.

01

02

11

30

298.

30

32

11

30

299.

12

23

11

30

300.

11

21

21

30

301.

13

02

21

30

302.

21

12

21

30

303.

30

03

21

30

304.

33

00

31

30

305.

20

30

31

30

306.

32

11

31

30

307.

02

32

31

30

308.

11

03

31

30

309.

10

30

02

30

310.

11

01

02

30

311.

00

21

02

30

312.

22

12

02

30

313.

31

32

02

30

314.

22

01

12

30

315.

13

11

12

30

316.

33

02

12

30

317.

02

22

12

30

318.

31

23

12

30

319.

03

00

22

30

320.

20

10

22

30

321.

02

11

22

30

322.

10

22

22

30

323.

23

32

22

30

324.

33

13

22

30

325.

01

33

22

30

326.

13

20

32

30

327.

32

30

32

30

328.

30

01

32

30

329.

03

10

03

30

330.

12

21

03

30

331.

30

22

03

30

332.

01

03

03

30

333.

31

00

13

30

334.

00

30

13

30

335.

01

11

13

30

336.

12

02

13

30

The

subc

ode

D4;

8: