$\newcommand{\cM}{{\mathcal M}}$
For an integer $n>0$, let $\cM\_n$ denote the set of all matrices with three rows and $n$ columns such that every column is obtained by permitting the coordinates of one of the vectors
$$ \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix},\ %
\begin{pmatrix} 0 \\ 1 \\ 1 \end{pmatrix},\ %
\begin{pmatrix} 0 \\ 0 \\ 2 \end{pmatrix},\ \text{and}\ %
\begin{pmatrix} 0 \\ 1 \\ 2 \end{pmatrix}. $$
Thus, for instance, $|\cM\_n|=13^n$, and any nonzero matrix from $\cM\_n$ has at most two identical rows.



> 
> What is the smallest possible size of a subset $S\subset\{0,1,2\}^n$ such that every matrix from $\cM\_n$ has at least one of its rows in $S$?
> 
> 
> 


In other words, I am interested in the vertex-covering number of the hypergraph $H=(V,E)$ with the vertex set $V=\{0,1,2\}^n$, and the edge set $E$ determined by the matrices from $\cM\_n$ (every matrix contributes one edge consisting of two or three vertices).


An essentially equivalent reformulation:



> 
> What is the smallest number of matrices that can be selected from $\cM\_n$ so that none of the selected matrices share a common row, while any matrix from $\cM\_n$ that is not selected has a common row with one of the selected matrices?
> 
> 
> 


My guess is that the answer should be like $3^n/f(n)$, with a slowly growing function $f$.



The vertex-covering number of a particular hypergraph
I am afraid that $f(n)$ does not grow, even if you use only permutations of $(0,1,2)$.


I claim that the minimal size of $S$ is $3^{n-1}$. As an example, you may take all rows with first coordinate 0.


Assume that $|S|<3^{n-1}$. You may partition all rows onto $3^{n-1}$ triples of the form $(x,x+u,x+2u)$, where $u=(1,1,\ldots,1)$ and addition is taken modulo 3. By pigeonhole principle, there is a triple without elements of $S$ that gives you an $S$-avoiding matrix from $M\_n$.


