7.5. Petya tells his neighbor Vova: «In our class, there are 30 people, and there is an interesting situation: any two boys have a different number of girlfriends in the class, and any two girls have a different number of friends among the boys in the class. Can you determine how many boys and how many girls we have in the class?» Vova replies: «You must be mistaken, such a situation is impossible!». a) Is Vova right? b) And how would you answer Petya's question?
Answer. a) Vova is wrong; b) 15 boys and 15 girls. Solution. a) To show that Vova is wrong, we will provide an example of a class that meets the conditions of the problem. For a class with 15 girls and 15 boys, we will number them and present a "friendship" table. In the cells of the table, there is a "+", if the corresponding boy and girl are friends. It is easy to see that the table, presented in the figure, meets the conditions of the problem. b) We will show that in the situation described by Petya, the number of boys and girls must be the same. Suppose the opposite and assume, for example, that there are more boys than girls. Then there are at least 16 boys in the class. However, the number of girlfriends each boy can have can take no more than 15 values (from 0 to 14). Therefore, not all boys have a different number of girlfriends. The contradiction proves our

![](https://cdn.mathpix.com/cropped/2024_05_06_98b44153e6468ab8fa13g-2.jpg?height=422&width=423&top_left_y=563&top_left_x=1522)
statement.