47. In how many ways can $n$ traffic lights be lit, of which $k$ can be in one of three states, and the remaining $n-k$ in one of two?
47. Let the first $k$ traffic lights burn in some way (there are $3^{\text {k }}$ such ways, see problem 46), while the rest can be lit in $2^{n-k}$ ways (see problem 45). This means that from each way of turning on the first $k$ traffic lights, one can obtain $2^{n-k}$ ways of turning on all the traffic lights. Therefore, the total number of ways is $3^{k} \cdot 2^{n-k}$.