# Cardinality of a set

Consider four variables $x,y,z,w$. Also consider the set $S=\{x^{i_1+j_1}y^{i_2+j_2}z^{j_1+j_3}w^{j_2+j_4}\}$ where $i_1,i_2,j_1,j_2,j_3,j_4$ are nonnegative integers such that $i_1+i_2+j_1+j_2 =m$ and $0\leq j_3,j_4 \leq m_1$ with $m,m_1$ are positive integers.

What is the cardinality of the set $S$ in terms of $m,m_1$?

-
A curious way to state this question. As given the answer is $1$, you clearly wrote down a $1$-element set, whatever $i_1,\ldots,j_4,m,m_1$ may be. Supposing you meant to vary $i_1,\ldots,j_4$ inside the set description, you've got a set of monomials $x^ay^bz^cw^d$ with (1) $a+b=m$, (2) $0\leq c\leq a+m_1$, and (3) $0\leq d\leq b+m_1$. Is that right? If so I think you can solve this yourself. – Marc van Leeuwen Dec 4 '11 at 14:08
Thank you very much for your suggestion. – user12290 Dec 5 '11 at 2:34

Since $i_1+i_2+j_1+j_2 =m$, $S=\{x^{i_1+j_1}y^{i_2+j_2}z^{j_1+j_3}w^{j_2+j_4}\}$ can be written as $S=\{x^{m-i_2-j_2}y^{i_2+j_2}z^{j_1+j_3}w^{j_2+j_4}\}$. Since $i_1,i_2,j_1,j_2,j_3,j_4$ are nonnegative integers, $m-i_2-j_2=i_1+j_1\geq0$, we have $m\geq i_2+j_2\geq0$. So there are $m+1$ distinct $x^{m-i_2-j_2}y^{i_2+j_2}$ when $i_2+j_2=0,1,..., m$.
Now fix $k=0,1,..., m$. If $i_2+j_2=k$, then the possible values for $j_2$ are $0,1,2,..., k$. On the other hand, since $i_1+j_1=m-i_2-j_2=m-k$, the possible values for $j_1$ are $0,1,2,..., m-k$. Therefore, if $i_2+j_2=k$, $0\leq j_1+j_3\leq k+m_1$ and $0\leq j_2+j_4\leq m-k+m_1$. That is, if $x^{m-i_2-j_2}y^{i_2+j_2}=x^{m-k}y^k$, the number of possible $z^{j_1+j_3}w^{j_2+j_4}$ are $(k+m_1+1)(m-k+m_1+1)$.
Combining all these, the cardinality of the set $S$ is $$|S|=\sum_{k=0}^m(k+m_1+1)(m-k+m_1+1).$$