American Mathematical Monthly Problem 11424 by Emeric Deutsch, Brooklyn, NY.
For every k ∈ N, for every k-tuple v ∈ {0, 1}k and every i ∈ {1, 2, ..., k} , let us denote by vi the i-th component of the k-tuple v (remember that v is an element of
{0, 1}k, that is, a k-tuple of elements of {0, 1}). Then, every v ∈ {0, 1}k satisfies v = (v1, v2, ..., vk) .
Let n > 1 be an integer. For any n-tuple a ∈ {0, 1}n, we define two integers F (a) and G (a) by
F (a) = |{i ∈ {1, 2, ..., n − 1} | ai = ai+1= 0}| ;
G (a) = |{i ∈ {1, 2, ..., n − 1} | ai = ai+1= 1}| .
Set T = {a ∈ {0, 1}n| F (a) = G (a)} . Prove that |T | = 2 n − 2 (n − 2) 2 , if n is even; n − 1 (n − 1) 2 , if n is odd = 2 n − 2 b(n − 2) 2c .
Example. For instance, if n = 4, then
T = {(0, 0, 1, 1) , (0, 1, 0, 1) , (1, 0, 1, 0) , (1, 1, 0, 0)} , so that |T | = 4.
Solution by Darij Grinberg. We are going to introduce some more notations:
• For any assertion U , we denote by [U ] the Boolean value of the assertion U (that is, [U ] = 1, if U is true;
0, if U is false ).
It is then clear that if B is a set, and U (a) is an assertion for every element a of B, then
X
a∈B
[U (a)] = |{a ∈ B | U (a) is true}| .
Also, if U1, U2, ..., Um are m assertions, then [U1 and U2 and ... and Um] = m
Q
j=1
[Uj].
• If n is an integer and k is a real, then we define the binomial coefficient n k by n k = ( n (n − 1) ... (n − k + 1) k! , if k ∈ N; ,
where N denotes the set {0, 1, 2, ...} . This definition agrees with the standard definition of n
k
in the case when k ∈ Z.
A consequence of this definition is that if S is a finite set and k is a real, then |S|
k
= |{A ∈ P (S) | |A| = k}| . It is immediate that
[α = 1] = α for every α ∈ {0, 1} , and (1)
[α = 0] = 1 − α for every α ∈ {0, 1} . (2)
Now, let us solve the problem.
Define a map f : {0, 1}n → P ({1, 2, ..., n}) by
f (a) = {i ∈ {1, 2, ..., n} | ai = 1} for any n-tuple a ∈ {0, 1} n
. It is known that this map f : {0, 1}n → P ({1, 2, ..., n}) is a bijection.
For any n-tuple a ∈ {0, 1}n, we have |f (a)| = |{i ∈ {1, 2, ..., n} | ai = 1}| = X i∈{1,2,...,n} [ai = 1] | {z } =aiby (1), since ai∈{0,1} = X i∈{1,2,...,n} ai.
Thus, for any real k, we have a ∈ {0, 1}n| X i∈{1,2,...,n} ai = k = |{a ∈ {0, 1}n | |f (a)| = k}|
=f−1({A ∈ P ({1, 2, ..., n}) | |A| = k})= |{A ∈ P ({1, 2, ..., n}) | |A| = k}| (since f is a bijection) =|{1, 2, ..., n}| k =n k .
Applying this to n − 2 instead of n, we obtain a ∈ {0, 1}n−2 | X i∈{1,2,...,n−2} ai = k =n − 2 k . (3)
Now, for any n-tuple a ∈ {0, 1}n, we have F (a) = |{i ∈ {1, 2, ..., n − 1} | ai = ai+1= 0}| =
X i∈{1,2,...,n−1} [ai = ai+1= 0] = X i∈{1,2,...,n−1} [ai = 0 and ai+1 = 0] = X i∈{1,2,...,n−1} [ai = 0] [ai+1 = 0] = X i∈{1,2,...,n−1} (1 − ai) (1 − ai+1)
since [ai = 0] = 1 − ai and [ai+1= 0] = 1 − ai+1 by (2),
as ai ∈ {0, 1} and ai+1∈ {0, 1}
; G (a) = |{i ∈ {1, 2, ..., n − 1} | ai = ai+1= 1}| =
X i∈{1,2,...,n−1} [ai = ai+1= 1] = X i∈{1,2,...,n−1} [ai = 1 and ai+1 = 1] = X i∈{1,2,...,n−1} [ai = 1] [ai+1 = 1] = X i∈{1,2,...,n−1} aiai+1
since [ai = 1] = ai and [ai+1 = 1] = ai+1 by (1),
as ai ∈ {0, 1} and ai+1∈ {0, 1} , so that F (a) − G (a) = X i∈{1,2,...,n−1} (1 − ai) (1 − ai+1) | {z }
=1−ai−ai+1+aiai+1
− X i∈{1,2,...,n−1} aiai+1 = X i∈{1,2,...,n−1} 1 | {z } =(n−1)·1=n−1 − X i∈{1,2,...,n−1} ai | {z } =a1+ P i∈{2,3,...,n−1} ai − X i∈{1,2,...,n−1} ai+1 | {z } = P i∈{2,3,...,n} ai = P i∈{2,3,...,n−1} ai+an = (n − 1) − a1+ X i∈{2,3,...,n−1} ai − X i∈{2,3,...,n−1} ai+ an = (n − 1) − a1− an− 2 X i∈{2,3,...,n−1} ai. (4)
Obviously, the map v : {0, 1}n→ {0, 1} × {0, 1}n−2× {0, 1} defined by v (a) = (a1, (a2, a3, ..., an−1) , an) for any n-tuple a ∈ {0, 1}
n
Now, for any x ∈ {0, 1} and y ∈ {0, 1} , we have {a ∈ T | (a1, an) = (x, y)}
= {a ∈ {0, 1}n| F (a) = G (a) and (a1, an) = (x, y)}
= {a ∈ {0, 1}n| F (a) − G (a) = 0 and a1 = x and an = y}
= a ∈ {0, 1}n| (n − 1) − a1− an− 2 X i∈{2,3,...,n−1} ai = 0 and a1 = x and an= y (by (4)) = a ∈ {0, 1}n| X i∈{2,3,...,n−1} ai = (n − 1) − a1− an 2 and a1 = x and an= y = a ∈ {0, 1}n| X i∈{2,3,...,n−1} ai = (n − 1) − x − y 2 and a1 = x and an = y = v−1 {x} × b ∈ {0, 1}n−2 | X i∈{1,2,...,n−2} bi = (n − 1) − x − y 2 × {y} .
Since v is a bijection, this yields |{a ∈ T | (a1, an) = (x, y)}| = {x} × b ∈ {0, 1}n−2 | X i∈{1,2,...,n−2} bi = (n − 1) − x − y 2 × {y} = b ∈ {0, 1}n−2| X i∈{1,2,...,n−2} bi = (n − 1) − x − y 2 = n − 2 (n − 1) − x − y 2 by (3), applied to k = (n − 1) − x − y 2 . (5) Now, |T | = |{a ∈ T | (a1, an) = (0, 0)}| | {z } + |{a ∈ T | (a1, an) = (0, 1)}| + |{a ∈ T | (a1, an) = (1, 0)}| + |{a ∈ T | (a1, an) = (1, 1)}|
Now, if n is odd, then n − 2 2 ∈ N, and thus/ n − 2 n − 2 2 = 0, so this becomes |T | = n − 2 n − 1 2 + n − 2 n − 3 2 = n − 2 n − 1 2 + n − 2 n − 1 2 − 1 = n − 1 n − 1 2
(by the recurrence of the binomial coefficients). On the other hand, if n is even, then n − 1 2 ∈ N and/ n − 3 2 ∈ N, so that/ n − 2 n − 1 2 = 0 and n − 2 n − 3 2 = 0, and thus (6) becomes |T | = 2 n − 2 n − 2 2 .
Thus, altogether we see that
|T | = 2 n − 2 n − 2 2 , if n is even; n − 1 n − 1 2 , if n is odd
for any n > 1. This simplifies to |T | = 2
n − 2 n − 2
2
(because in the case of n even,
we have n − 2
2 =
n − 2 2
, while in the case of n odd, we notice that
n − 1 n − 1 2 = 2 (n − 1) − 1 n − 1 2 − 1 since 2η η = 22η − 1 η − 1
for any integer η > 0 = 2 n − 2 n − 2 2