Notations.
(i). $1^k:$ $k$ bits long string of $1's$.
(ii). $f^{i_1,i_2,\dots,i_k}(x):$ Given $x \in \{0,1\}^n$, select the $k$ bits at indices $i_1,i_2,\dots,i_k$, in order, from $x$, to generate a $k$ bits long sub-string of $x$. The indices are chosen such that: $1 \leq i_1 < i_2 < \dots < i_k \leq n$.
Problem Statement. Given $x,y \in \{0,1,2,\dots,n-1\}^n$, generate $\dbinom{n}{k}$ matrices, called $A^{i_1,i_2,\dots,i_k}_{x,y}$, such that each matrix entry is defined as:
\begin{align}\label{eqn} a_{x,y} &= \begin{cases} 1 & \text{if }~ \neg f^{i_1,i_2,\dots,i_k}(x) \vee f^{i_1,i_2,\dots,i_k}(y) = 1^k \\ 0 &\text{otherwise}, \end{cases} \end{align}
The problem is to count the average number of $a_{x,y} = 1$ entries in the $\dbinom{n}{k}$ matrices, $A^{i_1,i_2,\dots,i_k}_{x,y}$, where $f^{i_1,i_2,\dots,i_k}(x) \neq f^{i_1,i_2,\dots,i_k}(y)$.
Attempt. I tried to solve the problem and came up with the following forumla: \begin{equation}\label{eq} \sum\limits_{w=1}^n \dbinom{n}{w} \cdot \sum\limits_{m=1}^w \dbinom{n-m}{k} \cdot 2^{n-w} \qquad \qquad \end{equation}
To get to the above equation, we consider the strings $x \in \{0,1\}^n$ in ascending order of hamming weights, $||x||_1$. So, we begin by counting the number of $y \in \{0,1\}^n$ that disagree with the $x$ at exactly one $1$ index (i.e., some $i$ such that $x[i] = 1)$, hence from such $y$ we must choose from the remaining $n-1$ indices. There are $2^{n-w}$ options to fill the rest of the $n-w$ indices in such strings $y~(n-w-m \text{ number of } 1's \text{ and } m~0's$ are fixed), and we may choose any $k$ out of the $n-1$ indices from such $y$. To account for the the total number of binary strings of hamming weights $w = 1$ to $w=n$, we added the term $\dbinom{n}{w}$.
Issue. This solution first selects the $y's$ satisfying a certain condition (i.e., $x \neq y$) and then picks $k$ indices/bits from those while a proper solution should consider the $k$ combinations of indices first and then evaluate whether the desired condition is met for those indices. Hence, the solution inevitably undercounts.