Consider a set of strings $ {\mathcal S} \subset \{0, 1, 2\}^n $ satisfying the following two conditions: 1.) every string in $ {\mathcal S} $ has exactly $ k $ symbols from $ \{0, 1\} $ (i.e., $ \forall x=x\_1 \cdots x\_n \in {\mathcal S} \;\; |\{ i : x\_i = 2 \}| = n - k $), and 2.) for every two strings $ x, y \in {\mathcal S} $ there exists a location $ i \in \{1, \ldots, n\} $ such that either $ x\_i = 0, y\_i = 1 $, or $ x\_i = 1, y\_i = 0 $ (in other words, such that $ x\_i + y\_i = 1 $).


Denote by $ S\_{k,n} $ the maximum possible cardinality of a set satisfying these two conditions. Clearly, $ S\_{k,n} \geq S\_{k,k} = 2^k $, for any $ n \geq k $. My feeling is that $ S\_{k,n} $ cannot be "much bigger" than $ 2^k $, regardless of $ n $ (in fact, I couldn't find an example with $ S\_{k,n} > 2^k $). Can one derive an upper bound that would establish this? The precise statement I am interested in proving is the following:
$$ \lim\_{k \to \infty} \frac{1}{k} \log\_2 \max\_{n \in \mathbb{N}} S\_{k,n} \stackrel{?}{=} 1 .$$



Ternary sequences satisfying $ x_i + y_i = 1 $ for some $ i $
I claim that $S\_{k,n}=2^k$ for all $n\geqslant k$. Moreover, $\sum 2^{-m\_i}\leqslant 1$ if the set of strings satisfies this condition, and $m\_i$ denotes the number of zeros/ones in $i$-th string.


Proof. Toss a coin for each location and consider the following events enumerated by your strings: if the string has 1/0 at some location, the corresponding coin must come out heads/tails correspondingly. No two events may occur together, thus the sum of their probabilities is at most 1.


