# Advent calendar 2017

## 15 December

The string *ABBAABBBBB* is 10 characters long, contains only *A* and *B*, and contains at least three *A*s.

Today's number is the number of different 10 character strings of *A*s and *B*s that have at least three *A*s.

#### Show answer

#### Hide answer

The number of 10 character strings containing at least 3 *A*s is equal to
the number of 10 character strings containing exactly 3 *A*s
plus
the number of 10 character strings containing exactly 4 *A*s
plus ... plus
the number of 10 character strings containing exactly 10 *A*s.
The number of 10 character strings containing exactly \(a\) *A*s is \(\left(\begin{array}{c}10\\a\end{array}\right)\) ("10 choose \(a\)").
Therefore the number we are looking for is

$$
\left(\begin{array}{c}10\\3\end{array}\right)
+
\left(\begin{array}{c}10\\4\end{array}\right)
+
\left(\begin{array}{c}10\\5\end{array}\right)
+
\left(\begin{array}{c}10\\6\end{array}\right)
+
\left(\begin{array}{c}10\\7\end{array}\right)
+
\left(\begin{array}{c}10\\8\end{array}\right)
+
\left(\begin{array}{c}10\\9\end{array}\right)
+
\left(\begin{array}{c}10\\10\end{array}\right)
$$

You can work this out by either using the formula \(\left(\begin{array}{c}n\\r\end{array}\right)=\frac{n!}{r!(n-r)!}\), or by remembering that
these numbers all appear in the 10th row of

Pascal's triangle.

The answer is **968**.