Let $A$ and $B$ be nonempty finite sets of cardinalities $n$ and $m$, respectively. The *distance* between two functions $f, g : A \to B$ is defined as the number of disagreements between them, that is, 
$$
d(f,g) := \# \{x\in A : f(x) \neq g(x)\}.
$$


Let $ 0 < k < n$. A set $F \subset B^A$ is called *$k$-separated* if $d(f,g) \ge k$ for every pair of distinct elements $f,g \in F$.



> 
> **Main question:** Is there an exact formula for the maximal cardinality $S(n,m,k)$ of a $k$-separated set? 
> 
> 
> **Subsidiary question:** Is there a simple combinatorial description of a $k$-separated set of maximal (or nearly maximal) cardinality?
> 
> 
> 


It's easy to give bounds. The cardinality of a ``closed'' ball of radius $r$ is 
$$
B(n,m,r) := \sum\_{j=0}^{r} \binom{n}{j} (m-1)^j.
$$ 
If $M$ is a $k$-separated set of maximal cardinality (and therefore maximal) then the balls centered at points of $M$ and of radii $k-1$ (resp. $\lfloor k/2 \rfloor$) cover $B^A$ (resp. are disjoint), so:
$$
\frac{m^n}{B(n,m,k-1)} \le S(n,m,k) \le \frac{m^n}{B(n,m,\lfloor k/2 \rfloor)}
$$



Separated sets of functions between finite sets
Expanding on the comments of Andreas and Fedor I will point out a resource where this data is kept track of. This will give some measure of how unknown these numbers are (and when they are actually known).


For $m=2$ you are looking for the largest binary code of length $n$ with minimum distance $k$. Which as Fedor says is a a famous problem. Let $A(n,d)$ denote the maximum number codewords in binary code of length $n$ with minimum distance $d$. We have $A(n-1,2d-1) = A(n, 2d)$ so we can restrict attention to even minimum distance. There was a table for $A(n,d)$ in the paper  [Bounds for Binary Codes of Length Less than 25](https://pdfs.semanticscholar.org/87ee/ac9ec831f1e1a098a15788aaa49b260e1efc.pdf) by Best, Brouwer, MacWilliams, Odlyzko, and Sloane from 1978. 


Brouwer has a [table](https://www.win.tue.nl/~aeb/codes/binary-1.html) on his webpage with updates to the table from the article above. On the Andries E. Brouwer's [homepage](https://www.win.tue.nl/~aeb/) you can find links to tables (with references) for $m=2,3,4,5$ (i.e. binary, ternary, etc.) and small $n$. The tables should be up to date, I see references as recent as 2016 on the pages for $m =3,4,5$.


