1

Given a building with $n$ floors and a window on each floor. You need to paint all the windows either black, white or red. How many ways are there to paint all the windows given that there have to be an even number of black windows and an odd number of white and red windows. I probably have to look at all the possible permutations and use the cycle index.

NotanAI
  • 345

1 Answers1

0

If $n = 2k+1$ is odd, the number of ways is 0.

If $n = 2k$ is even,
let $S_k$ be the total number of ways to color the floors with no restrictions, so $S_k = 3^{2k}$.
let $S_{k,e, e, e}, S_{k,e, o, o }, S_{k,o, e, o}, S_{k,o, o , e}$ be the number of ways to color the floors with even/odd windows,
let $T_k = S_{k,e, o, o } = S_{k,o, e, o} = S_{k,o, o , e}$,
let $R_k = S_{k, e, e, e }$.
$S_k = 3T_k + R_k$

Observe that $ T_{k+1} = 7T_k + 2R_k$, $R_{k+1} = 6T_k + 3R_k$.
$T_0 = 0, R_0 = 1$.

Solve the recurrence.
Skipping steps, scroll over for the formula.

$S_k = \frac{9^k-1}{4}$


Interestingly, $R_k = T_k +1$.
I wonder if there is a way to prove this directly.

Calvin Lin
  • 68,864