Brilliant Worldwide Competition

For the Brilliant Worldwide Competition, 1000 schools sent in teams of several male and female students. Every student competes in exactly one match with every other student that is not in the same school. A match between 2 students of the same sex is called single , and a match between 2 students of different sexes is called double . Given that the difference between total male and female students is at most 2, and the difference between single and double matches is at most 3, what is the maximum number of schools which can send an odd number of people?

Details and assumptions

There is no restriction on the number of male or female students that a particular school can send. In particular, some schools may only send students of one sex.


The answer is 10.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

7 solutions

Jon Schneider
Nov 24, 2013

Let m i m_i be the number of males on the i i th team and let f i f_i be the number of females on the i i th team. We can write our two conditions as follows:

i ( m i f i ) 2 \left|\sum_{i}(m_i - f_i)\right| \leq 2 i , j ( m i f i ) ( m j f j ) 3 \left|\sum_{i,j}(m_i - f_i)(m_j - f_j)\right| \leq 3

(Here we are noting that, between schools i and j, the number of single games is m i m j + f i f j m_im_j + f_if_j and the number of double games is m i f j + m j f i m_if_j + m_jf_i , so their difference is m i m j m i f j m j f i + f i f j = ( m i m j ) ( f i f j ) m_im_j - m_if_j - m_jf_i + f_if_j = (m_i - m_j)(f_i - f_j) ). From here on, let n i = m i f i n_i = m_i - f_i . Note that if school i i sends an odd number of people, then n i n_i is at least 1 (since there cannot be the same number of males and females from this school).

Now, squaring the first inequality we get that

i n i 2 + 2 i , j n i n j 4 \sum_{i} n_i^2 + 2\sum_{i,j}n_in_j \leq 4

But we know that i , j n i n j 3 \left|\sum_{i,j}n_in_j\right| \leq 3 , so i , j n i n j 3 \sum_{i,j}n_in_j \geq -3 and it follows that

i n i 2 10 \sum_{i} n_i^2 \leq 10

This, along with our previous observation, implies that at most 10 schools can send an odd number of people. Equality is attained when six schools send one male and four schools send one female.

Here's something interesting to think about (for anyone). In the given question, we have a bound of x = 2 x = 2 for the difference between the number of male and female students, and a bound of y = 3 y = 3 on the difference between single and double matches.

From these values, we arrive at a value of z = 10 z = 10 for an upper bound on the number of schools that can send an odd number of students, which is derived as a function of x x and y . y. For these values of x x and y y we are able to find an assignment of students to school such that we can attain the bound of 10 exactly.

When we change the values of x x and y , y, the approach/formula we currently have will give a different answer. For what values of x x and y y will we be able to find an assignment of schools that we are able to exactly meet the bound z z that we find? (You should ignore the 1000 schools restriction) For values where we cannot meet the z z bound, are there tighter bounds that we can find?

Lino Demasi - 7 years, 6 months ago

Log in to reply

The argument goes: if M F = x |M-F|=x and S D = y |S-D|=y , then i ( m i f i ) 2 x 2 + 2 y \sum_i (m_i-f_i)^2 \; \le \; x^2 + 2y and hence, if N N is the number of schools sending an odd number of candidates, then N x 2 + 2 y N \,\le\, x^2 + 2y . The question, then, is whether or not it is possible to have a set-up for which N = x 2 + 2 y N \,=\, x^2 + 2y .

Suppose that b b schools send exactly one boy and no girls, and that g g schools send exactly no boys and one girl (with no other school sending in any candidates), where b = 1 2 x ( x + 1 ) + y g = 1 2 x ( x 1 ) + y b \; = \; \tfrac12x(x+1) + y \qquad g \; =\; \tfrac12x(x-1) + y Then the number of schools sending an odd number of candidates is N = b + g = x 2 + 2 y N \; = \; b + g \; = \; x^2 + 2y Moreover there are M = b M = b boys entered and F = g F=g girls entered, so that M F = b g = x M - F \; = \; b - g \; = \; x Finally, there are S = ( b 2 ) + ( g 2 ) S \,=\, \big({b \atop 2}\big) + \big({g \atop 2}\big) single matches, and D = b g D = bg double matches. But D S = b g ( b 2 ) ( g 2 ) = 1 2 [ 2 b g b ( b 1 ) g ( g 1 ) ] = 1 2 [ ( b + g ) ( b g ) 2 ] = 1 2 [ ( x 2 + 2 y ) x 2 ] = y \begin{array}{rcl} D - S & = & bg - {b \choose 2} - {g \choose 2} \; = \; \tfrac12\big[2bg - b(b-1) - g(g-1)\big] \\ & = & \tfrac12\big[(b+g) - (b-g)^2\big] \; = \; \tfrac12\big[(x^2 + 2y) - x^2\big] \; = \; y \end{array} Thus it is always possible to achieve the optimal result N = x 2 + 2 y N = x^2 + 2y .

Mark Hennings - 7 years, 6 months ago
Mark Hennings
Nov 25, 2013

Suppose that School i i sends m i m_i boys and f i f_i girls. Then the total number of male and female entrants is M = i m i F = i f i M \; = \; \sum_i m_i \qquad F \; =\; \sum_i f_i The total number of single and double games is S = 1 2 i j ( m i m j + f i f j ) D = 1 2 i j ( m i f j + f i m j ) S \; = \; \tfrac12\sum_{i \neq j}(m_im_j + f_if_j) \qquad D \; = \; \tfrac12\sum_{i \neq j} (m_if_j + f_im_j) Thus we have M F = i ( m i f i ) S D = 1 2 i j ( m i f i ) ( m j f j ) M-F \; = \; \sum_i (m_i - f_i) \qquad S-D \; = \; \tfrac12\sum_{i \neq j}(m_i-f_i)(m_j-f_j) and so the requirements that M F 2 |M-F| \le 2 and S D 3 |S-D| \le 3 can be restated as i ( m i f i ) 2 i j ( m i f i ) ( m j f j ) 6 \left|\sum_i (m_i-f_i)\right| \le 2 \qquad \left| \sum_{i \neq j}(m_i-f_i)(m_j-f_j)\right| \le 6 and hence i ( m i f i ) 2 = [ i ( m i f i ) ] 2 i j ( m i f i ) ( m j f j ) 2 2 + 6 10 \begin{array}{rcl} \displaystyle\sum_i (m_i - f_i)^2 & = & \displaystyle\Big[\sum_i (m_i-f_i)\Big]^2 - \sum_{i \neq j}(m_i-f_i)(m_j-f_j) \\ & \le & 2^2 + 6 \; \le \; 10 \end{array} Now School i i sends an odd number of entrants precisely when m i + f i m_i + f_i is odd, which occurs precisely when m i f i m_i-f_i is odd. Since at most 10 10 of the values m i f i m_i-f_i can be nonzero, it is certainly true that no more than 10 10 schools can send an odd number of entrants.

It remains to show that it is possible for 10 10 schools to send an odd number of entrants. From the above calculations, it is clear that only the difference m i f i m_i-f_i matters for each school, and so we can look for an example with small numbers, which makes the counting easier. Suppose that 4 4 schools send 1 1 boy and 0 0 girls, while 6 6 schools send 0 0 boys and 1 1 girl, while the other 990 990 schools send nobody! Then M = 4 M=4 and F = 6 F=6 , so that M F = 2 |M-F| = 2 as required. Moreover S = 4 C 2 + 6 C 2 = 6 + 15 = 21 D = 4 × 6 = 24 S \; = \; {}^4C_2 + {}^6C_2 \; = \; 6 + 15 \; =\; 21 \qquad D \; = \; 4\times6 \; = \;24 and hence S D = 3 |S-D| = 3 . This is an example where 10 10 schools send an odd number of entrants.

Jau Tung Chan
Nov 25, 2013

Let us call the schools 1 through 1000. We denote the number of males that School i i sends as m i m_i and the number of females that School i i sends as f i f_i . For example, School 26 would send m 26 m_{26} male students and f 26 f_{26} female students.

Now, consider a particular configuration of m 1 , m 2 , m 3 , . . . , m 1000 , f 1 , f 2 , f 3 , . . . , f 1000 {m_1, m_2, m_3, ..., m_{1000}, f_1, f_2, f_3, ..., f_{1000}} . We denote the difference in total male and female students as x x , and the difference between single and double matches as y y (let us for awhile ignore the conditions of x 2 x\leq 2 and y 3 y \leq 3 ).

We consider what happens when we decrease m 1 m_1 and f 1 f_1 each by 1 (of course assuming they are both 1 \geq 1 to begin with).

  1. The total number of male students decreases by 1, and the total number of female students decreases by 1 as well; hence x x remains constant.

  2. The total number of single matches among the males decreases by ( m 2 + m 3 + m 4 + . . . + m 1000 ) (m_2 + m_3 + m_4 + ... + m_{1000}) , i.e. the number of single matches the removed male student would have played; similarly, the total number of single matches among the females decreases by ( f 2 + f 3 + f 4 + . . . + f 1000 ) (f_2 + f_3 + f_4 + ... + f_{1000}) . On the other hand, considering the double matches, the removed male student was supposed to play ( f 2 + f 3 + f 4 + . . . + f 1000 ) (f_2 + f_3 + f_4 + ... + f_{1000}) of these, and the removed female student was supposed to play ( m 2 + m 3 + m 4 + . . . + m 1000 ) (m_2 + m_3 + m_4 + ... + m_{1000}) of these; hence, the total number of single matches decreases by ( m 2 + m 3 + m 4 + . . . + m 1000 + f 2 + f 3 + f 4 + . . . + f 1000 ) (m_2 + m_3 + m_4 + ... + m_{1000} + f_2 + f_3 + f_4 + ... + f_{1000}) , and the total number of double matches decreases by the same number, i.e. y y remains constant.

Of course, it is easy to see that this method works with any School i i , and illustrating with School 1 1 was simply for ease of explanation

Hence, noting that x x and y y are invariant when we remove male-female pairs of students from each school, and that the parity of the number of students sent by each school is invariant with respect to this removal as well, we may simplify the problem by removing all possible male-female pairs of students from each school, i.e. each school sends students of only one sex, and we aim to find the maximum number of schools that send an odd number of students, while fulfilling the same two conditions in the question.

note that because we have removed all possible male-female pairs, it is possible that some schools will end up sending 0 students in this new problem, that is, the schools that would have sent an equal number of male-female students

With this new problem, let us re-denote the variables for convenience. Let there be n n schools sending all-males, and m m schools sending all-females, where n + m = 1000 n+m=1000 . We denote the number of males and females sent by these schools as a 1 , a 2 , a 3 , . . . , a n {a_1, a_2, a_3, ..., a_n} and b 1 , b 2 , b 3 , . . . , b m {b_1, b_2, b_3, ..., b_m} , respectively (again note that any of these can be 0, since some schools can end up sending 0 students). We also denote A = a 1 + a 2 + a 3 + . . . + a n A = a_1 + a_2 + a_3 + ... + a_n and B = b 1 + b 2 + b 3 + . . . + b m B = b_1 + b_2 + b_3 + ... + b_m for convenience.

Number of males in total: A A

Number of females in total: B B

Number of male single matches: ( a 1 ) ( a 2 + a 3 + a 4 + . . . + a n ) + ( a 2 ) ( a 1 + a 3 + a 4 + . . . + a n ) + . . . + ( a n ) ( a 1 + a 2 + a 3 + . . . + a n 1 ) 2 \frac{(a_1)*(a_2 + a_3 + a_4 + ... + a_n) + (a_2)*(a_1 + a_3 + a_4 + ... + a_n) + ... + (a_n)*(a_1 + a_2 + a_3 + ... + a_{n-1})}{2}

= ( a 1 ) ( A a 1 ) + ( a 2 ) ( A a 2 ) + ( a 3 ) ( A a 3 ) + . . . + ( a n ) ( A a n ) 2 = \frac{(a_1)*(A-a_1) + (a_2)*(A-a_2) + (a_3)*(A-a_3) + ... + (a_n)*(A-a_n)}{2}

= A ( a 1 + a 2 + a 3 + . . . + a n ) ( a 1 2 + a 2 2 + a 3 2 + . . . + a n 2 ) 2 = \frac{A*(a_1 + a_2 + a_3 + ... + a_n) - (a_1^2 + a_2^2 + a_3^2 + ... + a_n^2)}{2}

= A 2 ( a 1 2 + a 2 2 + a 3 2 + . . . + a n 2 ) 2 = \frac{A^2 - (a_1^2 + a_2^2 + a_3^2 + ... + a_n^2)}{2}

Number of female single matches (similarly): B 2 ( b 1 2 + b 2 2 + b 3 2 + . . . + b m 2 ) 2 \frac{B^2 - (b_1^2 + b_2^2 + b_3^2 + ... + b_m^2)}{2}

Number of double matches: A B AB

Therefore, the conditions reduce to the following 2 equations:

  1. A B 2 |A-B| \leq 2
  2. A 2 + B 2 ( a 1 2 + a 2 2 + a 3 2 + . . . + a n 2 ) ( b 1 2 + b 2 2 + b 3 2 + . . . + b m 2 ) 2 A B 3 | \frac{A^2 +B^2 - (a_1^2 + a_2^2 + a_3^2 + ... + a_n^2) - (b_1^2 + b_2^2 + b_3^2 + ... + b_m^2)}{2} - AB | \leq 3

Note that (2) can be further simplified to:

A 2 + B 2 2 A B 2 a 1 2 + a 2 2 + a 3 2 + . . . + a n 2 + b 1 2 + b 2 2 + b 3 2 + . . . + b m 2 2 3 | \frac{A^2 +B^2 - 2AB}{2} - \frac{a_1^2 + a_2^2 + a_3^2 + ... + a_n^2 + b_1^2 + b_2^2 + b_3^2 + ... + b_m^2}{2} | \leq 3

( A B ) 2 2 a 1 2 + a 2 2 + a 3 2 + . . . + a n 2 + b 1 2 + b 2 2 + b 3 2 + . . . + b m 2 2 3 \Rightarrow | \frac{(A-B)^2}{2} - \frac{a_1^2 + a_2^2 + a_3^2 + ... + a_n^2 + b_1^2 + b_2^2 + b_3^2 + ... + b_m^2}{2} | \leq 3

Since both fractions are clearly 0 \geq 0 ,

( A B ) 2 2 3 a 1 2 + a 2 2 + a 3 2 + . . . + a n 2 + b 1 2 + b 2 2 + b 3 2 + . . . + b m 2 2 ( A B ) 2 2 + 3 \Rightarrow \frac{(A-B)^2}{2} - 3 \leq \frac{a_1^2 + a_2^2 + a_3^2 + ... + a_n^2 + b_1^2 + b_2^2 + b_3^2 + ... + b_m^2}{2} \leq \frac{(A-B)^2}{2} + 3

By the first condition, 0 ( A B ) 2 4 0 \leq (A-B)^2 \leq 4 , so,

0 3 a 1 2 + a 2 2 + a 3 2 + . . . + a n 2 + b 1 2 + b 2 2 + b 3 2 + . . . + b m 2 2 2 + 3 \Rightarrow 0 - 3 \leq \frac{a_1^2 + a_2^2 + a_3^2 + ... + a_n^2 + b_1^2 + b_2^2 + b_3^2 + ... + b_m^2}{2} \leq 2 + 3

The left half of the inequality is obvious, but when we examine the right half,

a 1 2 + a 2 2 + a 3 2 + . . . + a n 2 + b 1 2 + b 2 2 + b 3 2 + . . . + b m 2 10 \Rightarrow a_1^2 + a_2^2 + a_3^2 + ... + a_n^2 + b_1^2 + b_2^2 + b_3^2 + ... + b_m^2 \leq 10

Of course, all of a 1 , a 2 , a 3 , . . . , a n {a_1, a_2, a_3, ..., a_n} and b 1 , b 2 , b 3 , . . . , b m {b_1, b_2, b_3, ..., b_m} are integers, hence, it is clear that at most 10 of these variables have a nonzero value. That is, at least n + m 10 = 990 n + m - 10 = 990 of the other variables will have to be 0. Recall here that if any of the variables here are 0, the corresponding school would have sent '0' students, i.e. an equal number of male-female students, which is an even number of students. Thus, there are at least 990 schools sending an even number of students, and the maximum number of schools which can send an odd number of students is simply 10 (of course this can be easily constructed by setting an arbitrary 10 of a 1 , a 2 , a 3 , . . . , a n , b 1 , b 2 , b 3 , . . . , b m {a_1, a_2, a_3, ..., a_n, b_1, b_2, b_3, ..., b_m} to be 1, and the rest 0).

Will setting an arbitrary set of 10 of a 1 , a 2 , a n , b 1 , b 2 , b m a_1,a_2, \ldots a_n, b_1, b_2, \ldots b_m equal to 1 always result in a set that satisfies the given conditions?

Lino Demasi - 7 years, 6 months ago

Log in to reply

Oops missed that out! We would need the first condition of A B 2 |A-B| \leq 2 to hold as well, so the possible cases would be 4 a a 's 6 b b 's, or 5 each. Thanks!

Jau Tung Chan - 7 years, 6 months ago

Log in to reply

Do both of those possibilities give a valid number of singles matches doubles matches | \mbox{ singles matches }- \mbox{ doubles matches }| ?

Lino Demasi - 7 years, 6 months ago

Log in to reply

@Lino Demasi For 4 a a 's 6 b b 's, there will be 6 A A single matches, and 15 B B single matches, and 24 double matches in total, so this is valid.

For 5 each, there will be 10 A A and B B single matches each, and 25 double matches in total, which is not valid though.

Jau Tung Chan - 7 years, 6 months ago
Marek Bernat
Nov 25, 2013

Let's denote the number of males and females in the i i th school as m i m_i and f i f_i . The number of single matches is then S = i < j m i m j + f i f j S = \sum_{i<j} m_i m_j + f_i f_j and the number of double matches is D = i < j m i f j + f i m j . D = \sum_{i<j} m_i f_j + f_i m_j .

We want to get our hands on the difference S D S - D . So let's write S D = i < j ( m i f i ) ( m j f j ) . S - D = \sum_{i<j} (m_i - f_i) ( m_j - f_j) .

We note here the useful identity 2 a b = ( a + b ) 2 a 2 b 2 2ab = (a+b)^2 - a^2 - b^2 that helps us rewrite S D S - D using only squares 2 ( S D ) = ( i ( m i f i ) ) 2 i ( m i f i ) 2 . 2(S - D) = \left( \sum_i (m_i - f_i) \right)^2 - \sum_i (m_i - f_i)^2. The first term of the right is simply the square of the difference between the total number of males and females. Let's denote this as A 2 A^2 . The second sum is over squares of differences in individual teams. If every team had the same number of males and females the second sum would vanish and we would have 2 ( S D ) = A 2 2(S-D) = A^2 . But in this case every school would have even number of players. So what we want to do instead is maximize the second sum by having as many schools as possible having k k males and k + 1 k+1 females (or vice versa). In that case the second sum precisely measures the number of schools having odd number of players. Denote the second sum by B 2 B^2 .

We have B 2 = A 2 + 2 ( D S ) B^2 = A^2 + 2(D-S) . We know that A |A| , the total difference in gender, is at most 2 2 and D S D-S is at most 3 3 . Making them both as big as possible maximizes B 2 B^2 so that, B 2 = 2 2 + 2 3 = 10 B^2 = 2^2 + 2\cdot 3 = {\bf 10} .

This shows that 10 is an upper bound, but doesn't show that it is the correct answer. You have 2 and 3 as upper bounds on A |A| and D S , D-S, but it is not cleat that there is a configuration of schools which will attain those maximums simultaneously, so for a complete solution you also need to show that there exists a configuration where there are 10 such schools.

Lino Demasi - 7 years, 6 months ago

Log in to reply

Sure, but that's so simple I omitted it. Just let 990 990 schools have the same number of males and females, 6 6 schools one more female than male and 4 4 schools one more male than female. Then the total gender difference is 2 2 and there are 3 3 more doubles than singles, according to the main equation.

Marek Bernat - 7 years, 6 months ago
Pratik Vora
Dec 30, 2013

You can ignore any students at any school who can be paired off in a male-female pair, since they do not change any male-female or single-double differences.

Let M = # unpaired males

Let F = # unpaired females

Let S = # singles matches involving unpaired students of same sex

Let D = # doubles matches involving unpaired students of different sexes

S <= M(M-1)/2 + F(F-1)/2 (equality if max of 1 unpaired student per school)

D = MF

MF = D <= S + 3 <= (MM-M)/2 + (FF-F)/2 + 3

2MF <= MM - M + FF - F + 6

M+F <= MM - 2MF + FF + 6 = (M-F)^2 + 6 <= 2^2 + 6 = 10

Maximum # of odd schools <= Maximum # of unpaired students = M+F = 10

The maximum occurs when M=6, F=4 or when F=6, M=4 and no school has more than one unpaired student.

In that case: S = 6 5/2 + 4 3/2 = 15+6 = 21

D = 6*4 = 24

Ariel Lanza
Dec 1, 2013

Without loss of generality we can number the schools, so we will say that there is a first, a second a third school and so on...

We will call m n m_n the number of male students sent by the n n -th school, f n f_n the number of female students sent by the n n -th school. And we will call d n d_n the difference between them. i.e. d n : = m n d n d_n:=m_n-d_n

Now we can rewrite our problem in term of those variables. Saying that the difference between total male and female students is at most 2 2 equivalent to say that i = 1 1000 d i 2 . \left| \sum_{i=1}^{1000} d_i \right| \leq 2 \ . While saying that the difference between single and double matches is at most 3 3 is the same as 1 i < j 1000 d i d j 3 \left| \sum_{1\leq i < j \leq 1000} d_i d_j \right| \leq 3 In fact the total number of single matches is 1 i < j 1000 ( m i m j ) + 1 i < j 1000 ( f i f j ) = 1 i < j 1000 ( m i m j + f i f j ) \sum_{1\leq i < j \leq 1000}\left( m_i m_j\right) \ + \sum_{1\leq i < j \leq 1000}\left( f_i f_j\right) = \sum_{1\leq i < j \leq 1000}\left( m_i m_j +f_i f_j\right) \ the total number of double matches is 1 i < j 1000 ( m i f j ) + 1 i < j 1000 ( f i m j ) = 1 i < j 1000 ( m i f j + f i m j ) \sum_{1\leq i < j \leq 1000}\left( m_i f_j\right) \ + \sum_{1\leq i < j \leq 1000}\left( f_i m_j\right) = \sum_{1\leq i < j \leq 1000}\left( m_i f_j +f_i m_j\right) Therefore the difference between them is 1 i < j 1000 ( m i m j m i f j f i m j + f i f j ) = 1 i < j 1000 ( ( m i f i ) ( m j f j ) ) \sum_{1\leq i < j \leq 1000}\left(m_i m_j- m_i f_j -f_i m_j +f_i f_j\right) = \sum_{1\leq i < j \leq 1000}\left( \left( m_i-f_i \right) \left( m_j-f_j \right) \right) Whose absolute value is equal to the L H S LHS of the previous inequality.

We have a well known identity: i = 1 1000 d i 2 = ( i = 1 1000 d i ) 2 2 1 i < j 1000 ( d i d j ) \sum_{i=1}^{1000} d_i^2=\left( \sum_{i=1}^{1000} d_i \right)^2 - 2\cdot \sum_{1\leq i < j \leq 1000}\left(d_i d_j\right) Using the inequalities we have found we can show that i = 1 1000 d i 2 2 2 + 2 3 = 10 \sum_{i=1}^{1000} d_i^2 \leq 2^2 + 2 \cdot 3 = 10 We know that every d i d_i is an integer. Therefore there are at most 10 10 of them that are non-zero.

It should be clear at this stage that the number of students sent by the n n -th school has the same parity as d n d_n . This can be seen by the fact that m n + f n m n + f n 2 f n d n ( m o d 2 ) m_n+f_n \equiv m_n +f_n - 2 \cdot f_n \equiv d_n \pmod{2}

This means that there are at most 10 10 schools that sent an odd number of students. We will now show that it is actually possible that only 10 10 schools sent an odd number of students.

It is sufficient to take: d i = 1 1 i 6 d_i=1 \qquad 1 \leq i \leq 6 d j = 1 7 j 10 d_j=-1 \qquad 7 \leq j \leq 10 d k = 0 11 k 1000 d_k=0 \qquad 11 \leq k \leq 1000

The 2 2 inequalities holds, in fact: i = 1 1000 d i = 2 . \left| \sum_{i=1}^{1000} d_i \right| = 2 \ . and 1 i < j 1000 d i d j = ( 6 2 ) + ( 4 2 ) 6 4 = 15 + 6 24 = 3 \left| \sum_{1\leq i < j \leq 1000} d_i d_j \right| = {6 \choose 2}+ {4 \choose 2}-6\cdot 4 =15+6 - 24=3 because we can ignore the 0 0 s and we get 1 1 iff we multiply 1 1 by 1 1 or 1 -1 by 1 -1 . While we get 1 -1 otherwise.

Now... how came that this week I have solved all the combinatorics problem and I got from level 5 5 to level 4 4 ? I have even given this nice proof of the hardest one!

Looks like a big Trololo from Brilliant!

Matt McNabb
Nov 30, 2013

If we add or remove a boy,girl pair from one school then the difference between double and single matches is unchanged, by symmetry. So we can assume without loss of generality that each school only sends students of one gender, with some schools perhaps not sending any students.

Let B B be the total number of boys sent, and G G be the total number of girls sent. Then D = B × G D = B \times G is the total number of double matches.

To work out the number of single matches: if each boy is from a different school, then the number of boy-boy matches will be 1 2 B ( B 1 ) \frac{1}{2}B(B-1) . However, if some boys are from the same school, they do not play each other. So we can say that the number of singles matches S:

2 S = B ( B 1 ) + G ( G 1 ) k 2S = B(B-1) + G(G-1) - k

where k k is an even non-negative integer. Combining these two formulae with the constraint that D S 3 \lvert D - S \lvert \le 3 we get:

B ( B 1 ) + G ( G 1 ) k 2 B G 6 B 2 2 B G + G 2 ( B + G ) k 6 ( B G ) 2 ( B + G + k ) 6 \begin{aligned} \lvert B(B-1) + G(G-1) - k - 2BG \lvert &\le 6 \\ \lvert B^2 - 2BG + G^2 - (B+G) -k \lvert &\le 6 \\ \lvert (B-G)^2 - (B+G+k) \lvert &\le 6 \end{aligned}

We are also given the constraint B G 2 \lvert B-G \lvert \le 2 . Applying this constraint to the last line above gives:

B + G + k 10 B+G+k \le 10

Thus the maximum possible value for B + G B+G is 10, which may occur when B G = 2 B-G = 2 . This maximal value can be realized by a configuration where all students are from a school that sent an odd number of students, i.e. 6 schools send 1 boy and 4 schools send 1 girl (or vice versa), so the answer we want is 10 \boxed{10} .

This actually proves that the only configurations which attain the maximum are when 6 schools send 1 more boy than girl, and 4 schools send 1 more girl than boy, and vice versa. Otherwise k > 0 k>0 .

Matt McNabb - 7 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...