**The metric dimension of Zn×Zn×Zn is ⌊3n/2⌋**

*Theoretical Computer Science*( IF 0.747 )

**Pub Date : 2019-07-04**

*, DOI:*

*10.1016/j.tcs.2019.05.042*

Gerold Jäger; Frank Drewes

In this work we determine the metric dimension of ${\mathbb{Z}}_{n}\times {\mathbb{Z}}_{n}\times {\mathbb{Z}}_{n}$ as $\lfloor 3n/2\rfloor $ for all $n\ge 2$. We prove this result by investigating a variant of Mastermind.

Mastermind is a famous two-player game that has attracted much attention in the literature in recent years. In particular we consider the static (also called non-adaptive) black-peg variant of Mastermind. The game is played by a *codemaker* and a *codebreaker*. Given *c* colors and *p* pegs, the principal rule is that the codemaker has to choose a secret by assigning colors to the pegs, i.e., the secret is a *p*-tuple of colors, and the codebreaker asks a number of questions all at once. Like the secret, a question is a *p*-tuple of colors chosen from the *c* available colors. The codemaker then answers all of those questions by telling the codebreaker how many pegs in each question are correctly colored. The goal is to find the minimal number of questions that allows the codebreaker to determine the secret from the received answers. We present such a strategy for this game for $p=3$ pegs and an arbitrary number $c\ge 2$ of colors using $\lfloor 3c/2\rfloor +1$ questions, which we prove to be both feasible and optimal.

The minimal number of questions required for *p* pegs and *c* colors is easily seen to be equal to the metric dimension of ${{\mathbb{Z}}_{c}}^{p}$ plus 1 which proves our main result.