What is the total number of words of length $500$ on $\{a,b\}$ such that the letter $"a"$ appears more than $"b"$ ( without Brute force)?

64 Views Asked by At

The question :

What is the total number of words of length $500$ on $\{a,b\}$ such that the letter "$a$" appears more than "$b$"?

$(*)$ We know that the total number of words is $ 2^{500} $. At first glance it looks like half of them. But there are subsets of words which contain the same number of letters of "$a$" and "$b$" (I assume that if the length were odd, it would be half of $2^{500}$.

I'm trying to approach this question with even length which is countable.

For example, when $length = 4$, we have $"aaaa", "aaab", "aaba", "abaa", "baaa"$ which is $5$ out of $2^4$ options.

For $length = 6$, we have "$aaaaaa$", $6$ words with $5$ "$a$" and $1$ "$b$", and ${2\choose 6}$ words with $4$ "$a$" and $2$ "$b$". So in total we have $15 + 6 + 1 = 22$ words out of $2^6$ words.

For $length = 8$ , we have "$aaaaaaaa$" , $8$ words with $7$ "$a$" and $1$ "$b$", ${2 \choose 8}$ words with $6$ "$a$" and $2$ "$b$", and so on. Hence we have ${8 \choose 0}$ + ${8 \choose 1}$ + ${8 \choose 2}$ + ${8 \choose 3}$ which reminds me of the Binomial Theorem, $\sum\limits_{k=0}^{3} {8 \choose k}$

Hence, for length $500$, we have which is the half of $ \sum\limits_{k=0}^{500} {500 \choose k} $ , but we know that it's not true, due to $(*)$

The official answer is $ \frac {2^{500} - {500 \choose 250}} {2} $. After looking at the answer we see they use the complement principle and actually those are the number of words which have the same number of "$a$ "and "$b$" and that I forgot actually to handle the case of the number of the middle index which is not considered in both cases. But I want to know how to solve combinatorial questions without using Brute force which can waste a lot of time during exams (as you see, this way causes mistakes easily)

1

There are 1 best solutions below

0
On BEST ANSWER

There are $\binom{500}{250}$ words of length $500$ with exactly $250$ $a$, so the number of words with $500$ letters that have not the same number of $a$-s and $b$-s is $$ 2^{500}-\binom{500}{250} $$

By symmetry there are $$ \frac{1}{2} \left(2^{500}-\binom{500}{250}\right) $$ words with more $a$-s than $b$-s