How many signals use even number of blue flags and odd number of black flags?

73 Views Asked by At

Question:

There are 48 flags,12 of each colors red,white,blue and black. 12 of these flags are used to send a signal.How many signals use even number of blue flags and odd number of black flags?

How do I go about solving this?

1

There are 1 best solutions below

3
On BEST ANSWER

Since there are enough flags of each color, it suffices to count "good" strings of arbitrarily length.

Let $T(n)$ denote the number of good strings of length $n$ (so your answer is $T(12)$.

Let $A(n)$ be the number of strings of length $n$ with an even number of blues, and an even number of black.

Let $B(n)$ be the number of strings of length $n$ with an odd number of blues and an odd number of blacks.

Let $C(n)$ denote the strings of length $n$ with an odd number of blues and an even number of blacks

Then $$A(n)=2A(n-1)+C(n-1)+T(n-1)\quad B(n)=2B(n-1)+C(n-1)+T(n-1)$$ $$C(n)=2C(n-1)+A(n-1)+B(n-1)$$ $$ T(n)=2T(n-1)+A(n-1)+B(n-1)$$

We have initial conditions $$A(1)=2\quad B(1)=0\quad C(1)=1\quad T(1)=1$$

Barring error (definitely possible) this yields $$T(12)=\fbox {4194304}$$

Consistency check (for implementation): As every string of length $n$ is exactly one of these types we must have $A(n)+B(n)+C(n)+T(n)=4^n$.