3. At a congress, all attendees are either mathematicians or biologists, and no one is both a mathematician and a biologist. The mathematicians all know each other and each knows four of the biologists. The biologists all know each other and each knows nine of the mathematicians. It turns out that every mathematician knows exactly twice as many people as every biologist. (If person A knows person B, then person B also knows person A.)

How many mathematicians are there at the congress?
B3. 117 Let's first look at the number of pairs of acquaintances between mathematicians and biologists. Let the number of mathematicians be $w$ and the number of biologists be $b$. Since every mathematician knows four biologists, the total number of acquaintances of the mathematicians among the biologists is $4w$. On the other hand, every biologist knows nine mathematicians, so the total number of acquaintances of the biologists among the mathematicians is $9b$. These two numbers must be equal, so $4w = 9b$ or $b = \frac{4}{9} w$.

Furthermore, we know that every mathematician knows exactly twice as many people as every biologist. A mathematician knows all $w-1$ other mathematicians plus four biologists, so in total $w+3$ people. A biologist knows all $b-1$ other biologists plus nine mathematicians, so $b+8$ people. Since every mathematician knows exactly twice as many people as every biologist, $w+3 = 2 \cdot (b+8)$ or $w = 2b + 13$. Substituting $b = \frac{4}{9} w$ into this, we get $w = 2 \cdot \frac{4}{9} w + 13$ and solving this equation gives $w = 117$.