Problem:
Suppose that 7 boys and 13 girls line up in a row. Let S be the number of places in the row where a boy and a girl are standing next to each other. For example, for the row GBBGGGBGBGGGBGBGGBGG we have S=12. The average value of S (if all possible orders of these 20 people are considered) is closest to
Answer Choices:
A. 9
B. 10
C. 11
D. 12
E. 13
Solution:
Suppose that John and Carol are two of the people. For i=1,2,…,19, let Ji​ and Ci​ be the numbers of orderings (out of all 20!) in which the ith and (i+1)nt persons are John and Carol, or Carol and John, respectively. Then Ji​=Ci​=18! is the number of orderings of the remaining persons.
For i=1,2,…,19, let Ni​ be the number of times a boy-girl or girl-boy pair occupies positions i and i+1. Since there are 7 boys and 13 girls, Ni​=7⋅13⋅(Ji​+Ci​). Thus the average value of S is
20!N1​+N2​+…+N19​​=​20!19[7⋅13⋅(18!+18!)]​=1091​.​
OR
In general, suppose there are k boys and n−k girls. For i=1,2,…,n−1 let Ai​ be the probability that there is a boy-girl pair in positions (i,i+1) in the line. Since there is either 0 or 1 pair in (i,i+1),Ai​ is also the expected number of pairs in these positions. By symmetry, all Ai​'s are the same (or note that the argument below is independent of i). Thus the answer is (n−1)Ai​.
We may consider the boys indistinguishable and likewise the girls. (Why?) Then an order is just a sequence of k Bs and n−k Gs. To have a pair at (i,i+1) we must have BG or GB in those positions, and the remaining n−2 positions must have k−1 boys and n−k−1 girls. Thus there are 2(k−1n−2​) sequences with a pair at (i,i+1). Since there are (kn​) sequences,
answer =(n−1)Ai​=(kn​)(n−1)2(k−1n−2​)​=n2k(n−k)​.
In our case, the answer is 202⋅7⋅13​=1091​.