Fitting two letters into 4 gaps with repetition

47 Views Asked by At

Suppose we have 4 gaps $\_~ \_~ \_ ~\_$ and we have two letters $a,b$ how many ways can we arrange them in these gaps with repetition?

I tried doing this as such

$aaaa, aaab, aabb, abbb, bbbb$ but how do i continue to find more?

Is there an efficient way of doing this?

1

There are 1 best solutions below

2
On BEST ANSWER

For each gap, we have two options; either $a$ or $b$. Since we have four gaps, in total, we have $2\cdot2\cdot2\cdot2 = 16$ ways of arranging them.

Actually, this is also dual with binary numbers with $4$ digits since we have four gaps and $2$ options. What I mean is, we can map $a \to 0$ and $b \to 1$. Then the possible constructions are the binary representations of the numbers from $0$ to $15$ written in $4$ digits, that are $0000$, $0001,0010, 0011,...,1111$.