# Notation for selecting elements from two sets in a certain way

Is there any way in which the sets $$\{\{b_1,\dots,b_n\}\}\quad(k=0)$$ $$\{\{a_1,b_2,\dots,b_n\},\{b_1,a_2,\dots,b_n\},\dots\{b_1,\dots,b_{n-1},a_n\}\}\quad(k=1)$$ $$\{\{a_1,a_2,b_3,\dots,b_n\},\{a_1,b_2,a_3,\dots,b_n\},\dots,\{b_1,\dots,a_{n-1},a_n\}\}\quad(k=2)$$ can be formed using some briefer notation? In each case we need a set which contains the subsets of size $$n$$ from $$A\cup B$$ where $$A=\{a_1,a_2,\dots,a_n\}$$ and $$B=\{b_1,b_2,\dots,b_n\}$$ that contain an element with every index in $$\{1,\dots,n\}$$; $$k$$ elements from $$A$$ and $$n-k$$ elements from $$B$$.

Here is one idea. Let $$S=\{1,2,\dots,n\}$$. Consider the set of all "choice" functions $$\phi:S\to\{0,1\}$$.

Then consider the map $$f_{\phi}:S\to A\cup B$$ given by

$$f_{\phi}(i) = \begin{cases} a_i & \text{if } \phi(i)=0 \\ b_i & \text{if } \phi(i)=1 \end{cases}$$

Finally you can denote the set generated by a given choice function by $$f_\phi(S)=\{f_\phi(i):i\in S\}$$.

The $$k$$-th set in your list is then given by $$\{f_\phi(S):|\phi^{-1}(0)|=k\}$$.

This might be overblowing it. You can drop some of the notation.

I'd write $$\cup_{k=0}^n \{X_k \in \mathcal{P}(A\cup B) | \hspace{.1cm} card(X_k) = n \wedge \forall i\in \{1,...,n\}\hspace{.1cm} a_i \in X_k \vee b_i \in X_k \wedge card(X_k \cap A) = k \}$$, but i doubt that this is what youre looking for.