0

I was given a riddle that I can't seem to solve using Combinatorics only.

How many N length combinations can one create using the letters A B C D E F, in which the letter C has to appear an even amount of times (including none~zero).

Appreciate if you can direct to me a previous post \ solution or a good hint :)

Sleeper
  • 19
  • 2
    What is the source of this problem? A duplicate was posted a little while ago. – lulu Apr 26 '20 at 20:49
  • 1
    I see two reasons to reopen this question. (1) There are three answers, which at least shows some interest in the question. (2) A duplicate was posted later on, but it cannot be closed as a duplicate since the question I propose to reopen is closed. – J.-E. Pin Apr 27 '20 at 11:31

3 Answers3

1

So you choose $2k$ position from $n$ to put $C$ and on the rest of them you put one of $A,B,D,E,F$ so that is $5^{n-2k}$ ways, for all even $k$ from $0$ to $n$:

$$A={n\choose 0}5^n+{n\choose 2}5^{n-2}+{n\choose 4}5^{n-4}+...$$

Now this can be writen in a closed form: Let

$$B={n\choose 1}5^{n-1}+{n\choose 3}5^{n-3}+{n\choose 5}5^{n-5}+...$$

then $$A+B = (5+1)^n =6^n$$ and $$A-B = (5-1)^n =4^n$$

so $$A = {1\over 2}(6^n+4^n)$$

User2020201
  • 1,020
  • So, this answer is of no use to you? – User2020201 Apr 27 '20 at 15:13
  • 1
    There is also a "direct" proof. Sequences with an even number of $C$'s come in two types; those which have zero $C$'s and zero $D$'s, and sequences which have at least one $C$ or one $D$. The number of the first type is $4^n$. The $6^n-4^n$ other sequences are partitioned into pairs $(s,s')$ where $s'$ is obtained from $s$ by taking the leftmost $C$ or $D$ in $s$ and replacing it with the other letter, $D$ or $C$. In each pair, exactly one sequence has an even number of $C$'s. Adding up these two counts, you get $4^n+\frac12(6^n-4^n)=\frac12(4^n+6^n)$. – Mike Earnest Apr 27 '20 at 17:48
  • I don't understand, what has $D$ to do with $C$? @MikeEarnest – User2020201 Apr 28 '20 at 08:15
  • I am applying a similar proof strategy used in this answer to prove exactly half of the subsets of an $n$-element set are even. The choice of using the letter D is arbitrary, but I needed to choose some letter to replace C with. – Mike Earnest Apr 28 '20 at 14:40
0

Hint: Choose the positions, from the $N$ slots select, lets say, $2k$ in $\binom{N}{2k}$ ways. Assume that the rest of the slots do not have a $C,$ so you have $6-1=5$ letters and $N-2k$ spots. Add over all of the possible $k's.$

Phicar
  • 14,722
0

$f(1) = 1$. (0 "C"s)

$f(2) = \operatorname{choose}(1,1-1)*5^{1-1} = 1$. (0 "C"s)

$f(3) = 1 + \operatorname{choose}(3, 3-2)*5 = 1 + 3*5 = 16$.

$f(4) = 1 + \operatorname{choose}(4,4-2)*5^{4-2} + \operatorname{choose}(4,4-4)*5^{4-4}$.

$f(N) = \sum_{m = 0}^{\operatorname{floor}(N/2)}{\big(\operatorname{choose}(N, N-2m)*5^{N-2m}}\big)$

Choose the indices in the string which are to not be "C"s. If there are $2m$ "C"s in the string, then this is $\operatorname{choose}(N, N - 2m)$ possibilities. Then fill these with any of the 5 letters which are available and which are not "C"; there are $5^{N-2m}$ options for this. Now, let $m$ range over all possible values (from 0 to approximately half of $N$, although we have to worry about odd $N$ values) and add up the possibilities.

Something like that. I am a bit distracted right now, but this seems to be close to the correct idea.