Let $a$, $b$, $c$ be real numbers and $f(m, n)$ be the number of $m \times n$ matrices with entries $a$, $b$, or $c$ such that each column and each row contains at least one $a$ or one $b$. Find a formula for $f(m, n)$.
My try: If it is $m \times n$, then there are $3^{m\times n}$ different placement, but i do not know how to extract the cases where each columns and rows contain at least one $a$ or one $b$. Any help?
Realize that because of the fact that it is said at least one "a" or one "b" , placing one of them will satify the condition.What i meant is that one column can consist of only $a$ and $c$ , not any $b's$ , so let say that the cells that contain "a" or "b" denoted by $d$. Now , the question turn out to be :
I thought that the best way is to use P.I.E such that assume that each rows contains at least one $d$ , we can handle it by just placing at least one $d$ to each of $m$ rows. However , we should also place them such that each columns contains at least one $d$. We can do it such that
Now , it is time for P.I.E such that if the first column does not have any $d's$ , then any row can be constructed such that
We placed the $d's$ into a row using the way above. However , realize that we have $m$ rows and the places where $d's$ placed will take either $a$ or $b$. Then , the real calculation is
As you see , the foregoing formula can be seen as the sum of the coefficients in the expansion of $$2^1\binom{n-1}{1}+2^2\binom{n-1}{2}+...+2^{n-1}\binom{n-1}{n-1}=(1+2x)^{n-1}-1=3^{n-1}-1$$
Because , if we let $x=1$ , then we can find sum of the coefficients in the binomial expression.
Hence ,If we generalize the situation from the first colum to all matrix by P.I.E: $$\sum_{k=0}^n\binom{n}{k}(-1)^k(3^{n-k}-1)^m$$