2008 boys and 2008 girls sit on 4016 chairs around a round table. Each boy brings a garland and each girl brings a chocolate. In an "activity", each person gives his/her goods to the nearest person on the left. After some activities, it turns out that all boys get chocolates and all girls get garlands. Find the number of possible arrangements.
Problem
Source: Indonesia TST 2009 First Stage Test 4 Problem 4
Tags: modular arithmetic, combinatorics proposed, combinatorics
28.07.2013 11:25
Number the places from $0$ to $4015$ It is obviously there has to exist an $L$ such that $a+L$ has an other gender sitting on this number than $a$ where we look modulo $4016$. If $gcd(L,4016)=T$, we know the first $T$ places makes all genders will be fixed at all places. claim 1: The configuration is fixed when we know the gender on places $0$ until $T-1$ and correct if $16 \not|T$ If $16|T$ then looking $251T$ places away, we have the other gender, but $4016|251T$ hence $16 \not| T$ As $2| \frac{4016}{T}$ it is easy to see $a+T$ will have the other gender as $a$ does. ( $a+2Lk$ not $\equiv a+T \pmod{4016} $) and exactly half of the people sitting will be men, other half being women. Hence we know the whole fixed thing. claim 2: For different $T_1,T_2$ we won't have twice the same configuration if $v_2(T_1) \not = v_2(T_2)$ Proof: wlog $v_2(T_1)> v_2(T_2)$ hence there exist odd $k$ and even $m$ such that $kT_1=mT_2$ and hence the gender at place $a+kT_1=a+mT_2$ have to be same and different as the gender on place $a$, contradiction. Hence we can't count twice a same configuration. Claim 3 If we have made all configurations for $T_1=251*2^k$ witth $m$ an odd number, the configurations for $T_2=2^k$ are already counted . Proof: As we know $a+T_2$ and $a+252T_2$ have different genders, Taking $b=a+T_2$ , we get on $b$ and $b+T_1$ there are different genders. With knowing which gender are on the first $T_2$ chairs, we know those on $T_1$ first chairs and with these we get exactly the same configuration. MAIN We have to count the numbers of configurations for $T=251,502,1004,2008$ by previous claims which are $2^T$ each time and hence the total will be $2^{251}+2^{502}+2^{1004}+2^{2008}$ ways.