# Other kinds of tables: three symbols

## The question

Does the picture change when each switch has three settings instead of two? And how many rows does a table need when it must also locate a faulty pair of settings?

## Why it matters

Many test plans use switches with more than two settings.

## What answering it would help with

It sorts the kinds of tables by whether they admit fast rules for adding a column.

## What our research shows

Yes: with three settings per switch, strength-2 extension is NP-complete (a written proof, rebuilt and checked on small cases; no Lean proof). For the locating arrays below, the 13 by 13 table is printed so that you can check it (COMPUTED), and that 13 rows is the minimum for 13 columns is CONJECTURED: one solver found no 12-row array in a SAT encoding of the problem; a second solver has re-checked a sample of the search, not the whole search, and the search is not part of this book.

So far every switch had two settings, 0 and 1. A covering array can have more. With three settings per switch ('ternary'), strength 2 means: for any two switches, all nine pairs of settings occur.

### The result

**Ternary strength 2.** Deciding whether a ternary strength-2 covering array can take one more column, keeping all rows and adding none, is NP-complete. (Status: PROVED-written.)

Compare this with chapter 6: for two settings per switch, strength 2 is the monotone-duality question and is not expected to be NP-hard (CONDITIONAL). With three settings the same strength becomes hard. That is a statement about one decision problem, computed for one alphabet size.

### How it was checked

The result was rebuilt from the written proof alone and checked: 7,404 small source puzzles were run against two complete solvers, 71 of them with the answer no, with no disagreement. Rows can repeat among certain edge classes when twin vertices occur, and the argument does not use distinct rows. Nothing here has a Lean proof.

### Prior art

The problem is the ternary case of the parameter extension problem of chapter 9 (Garn and Simos 2017, Problem 6). In the sources we checked we found no statement of this result; as for chapter 9, we did not read all the relevant sources, and we claim no priority.

### Locating arrays: how many rows do 13 switches need?

Picture a machine with 13 switches, each on or off, and one pair of switch settings that is faulty, say switch 3 on together with switch 9 off. A test run is a row of the table, and a run fails when the faulty pair shows in it. The table is a (1-bar,2)-locating array when the failing runs tell you which pair is at fault. In symbols: each of the 4 × 78 = 312 pairs of settings on two switches shows in at least one row, and different pairs show in different sets of rows.

**What we found.** A computer search found a table with 13 rows and 13 columns that is a (1-bar,2)-locating array (COMPUTED: found by search, then checked against the definition by two separately written programs). A second search, for a table with 12 rows and 13 columns, found none: the search used a SAT encoding of the definition, with row 0 fixed to zero by complementing columns and rows and columns each sorted in lexicographic order (double-lex symmetry breaking). The search tree was cut into cubes. In the receipt of the run, the solver CaDiCaL 1.9.5 answered UNSAT on 601,831 distinct cubes and SAT on none. Of these, 552,691 are the terminal cubes that close the tree, and the other 49,140 lie below a cube already answered UNSAT. A completeness check over the recorded cubes found every branch of the tree covered by the terminal cubes, with no gap. That 13 rows is the minimum for 13 columns is therefore CONJECTURED: one solver found no 12-row array in a SAT encoding of the problem; a second solver has re-checked a sample of the search, not the whole search, and the search is not part of this book. If the search is complete and the encoding and sorting rules are right, the minimum is 13. The sorting rules lose no tables by a written argument that the solver does not check.

**Checks.** A second solver, glucose 4, replayed a seeded random sample of 300 cubes and the 25 hardest: 307 returned UNSAT, 18 timed out, and none disagreed. As an encoding control, the encoding accepts the 13 by 13 table below once it is put in canonical form, and rejects a copy with one bit flipped. Neither check replays the whole search with a second solver.

**Smaller numbers of columns.** With the same encoding, the smallest number of rows we found for k columns is 6, 7, 8, 9, 10, 11, 11, 11 and 11 for k = 3 to 11. COMPUTED. These agree with the minima that Konishi, Kojima, Nakagawa and Tsuchiya proved for 3 to 11 columns.

**Prior art.** Konishi, Kojima, Nakagawa and Tsuchiya (2019, journal version 2020) searched for minimum locating arrays with a CSP solver. For 13 columns their solver timed out at 12 and 13 rows and found 14, and for 12 columns it proved 12 the minimum. Their simulated-annealing paper (2019) also reports 14 for 13 columns, with an earlier SAT-based paper (Konishi and others, 2017) as the source of that value; we did not read the 2017 paper directly. We did not read Shi, Fu, Wang and Yan (2021), which gives upper bounds for small numbers of factors and might cover this case, so our literature check is incomplete. The tables we found in the literature we checked have 14 rows, and we claim no priority.

**The 13 by 13 table, so that you can check it.** Each line is a row; each column is a switch. The same table is in the file [array-13x13.txt](../locating-array/array-13x13.txt).

```
0000000000000
0000011111111
0001100001111
0010100110011
0110101010101
0110110101010
1001010011010
1100111010010
1101000111001
1101001100110
1110001001111
1110010110100
1111110000001
```

To check it, list the 312 pairs (switch i, switch j, value a, value b) with i < j. For each, collect the set of rows that show value a in switch i and value b in switch j. All 312 sets are non-empty and all 312 are different. Flip any single bit of the table and the check fails, for each of the 169 positions. Recipe 11 of the [check guide](../VERIFY.md) gives the condition and the expected answer; a few lines of your own code are enough. The search itself is not shipped.

### What is not in this edition

Other table problems, apart from the locating array above, are not part of this edition of the book. This chapter is deliberately short.

### What it suggests

The change from 'not expected to be NP-hard' at two settings to NP-complete at three settings indicates that the number of settings, not just the strength, changes how hard the extension problem is. Further research is recommended for four or more settings, which are not covered here.

## Check it yourself

The ternary result is a written proof; the [register of results](../statement/RESULTS.md) says how it was checked, and no files for it are shipped. The locating-array table is checked with recipe 11 of the [check guide](../VERIFY.md), by hand or with a few lines of your own code. The search for a 12-row table is not shipped.

## Where to go next

- Which other arrays were found? [Chapter 14: more arrays](14-more-arrays.md).
- What is still open? [Chapter 16: the ledger](16-the-ledger.md).
