# A mathematics competition had 9 easy and 6 difficult problems

A mathematics competition had 9 easy and 6 difficult problems. Each of the participants in the competition solved 14 out of 15 problems. For each pair consisting of an easy and a difficult problem, the number of participants who solved both those problems was recorded. The sum of these recorded numbers was 459. How many participants were there?

Need help, don't really understand the question.

• If a pair is one difficult and one easy problem then if a participant solves 14 out of 15 problems, they could have solved 9 easy and 5 difficult making 5 pairs of one easy and one difficult with 4 questions remaining or problems or 8 easy and 6 difficult with 6 pairs and 2 remaining. Therefore I don't believe that there are 45 pairs or 48 pairs – 0327 Aug 23 '15 at 0:11
• If x is the number of participants who solved 6 pairs and y the number of participants who solved 5 pairs the 6x +5y = 459 – 0327 Aug 23 '15 at 0:12

Please see the answer by barak manos for an explanation of what the problem asks. I’ll expand his explanation of the answer a little and show two ways to avoid trial and error, one specific to this problem and one general.

Recall that each participant missed only one problem. Let $x$ be the number of participants who missed a hard problem; each of them solved $9$ easy and $5$ hard problems and therefore solved $9\cdot5=45$ of the hard/easy pairs of problems. Let $y$ be the number of participants who missed an easy problem; each of these participants solved $8$ easy and $6$ hard problems and therefore solved $8\cdot6=48$ of the hard/easy pairs of problems. Altogether the $x+y$ participants solved $45x+48y$ hard/easy pairs, so $45x+48y=459$.

We can divide through by $3$ to reduce this to the equivalent equation $15x+16y=153$. This in turn can be rewritten as $15(x+y)+y=153$, which can be solved by inspection: clearly $153=15\cdot10+3$, so we set $y=3$ and $x+y=10$, finally getting $x=7$. As a check, $45\cdot7+48\cdot3=315+144=459$. Thus, $n=10$, $7$ participants solved all $9$ easy problems and $5$ of the hard problems, and $3$ participants solved all $6$ hard problems and $8$ of the $9$ easy problems.

It was a bit of luck that $153$ could so easily be decomposed in a useful way, so it’s worth pointing out that there are systematic techniques for solving such Diophantine equations.

First note that $15(-1)+16(1)=1$, so $15(-153)+16(153)=153$. That is, $x=-153,y=153$ is a solution to the equation $15x+16y=153$. Next, notice that if $15x_0+16y_0=153$, then

$$15(x_0+16)+16(y_0-15)=15x_0+15\cdot16+16y_0-16\cdot15=15x_0+16y_0=153\;.$$

Thus, if $x=x_0,y=y_0$ is a solution, so is $x=x_0+16,y=y_0-15$. In particular, for any integer $k$ we have a solution $x=-153+16k,y=153-15k$. The smallest integer $k$ such that $-153+16k\ge 0$, is $k=10$, giving the solution $x=7,y=3$ that we already found. Any smaller value of $k$ makes $x$ negative, and any larger value makes $y$ negative, so $x=7,y=3$ is the only solution of this kind. And in fact all solutions of $15x+16y=153$ are of this kind (and see also here).

Here I relied on inspection to get one solution ($x=-1,y=1$), but in general the extended Euclidean algorithm can be used to find one mechanically.

Explaining the question:

• There are $n$ participants
• There are $9$ easy problems and $6$ difficult problems
• Each participant solved $14$ problems out of $15$ problems
• There are $9\cdot6=54$ pairs of one easy problem and one difficult problem
• If we add up the number of times that each pair was solved, then we get $459$

What is the value of $n$?

• Each participant solved either $9\cdot5=45$ pairs or $8\cdot6=48$ pairs
• Let $x$ denote the number of participants who solved $45$ pairs
• Let $y$ denote the number of participants who solved $48$ pairs
• Then we know that $x+y=n$ and $45x+48y=459$
• Therefore $0\leq{x}\leq\lfloor\frac{459}{45}\rfloor$ and $0\leq{y}\leq\lfloor\frac{459}{48}\rfloor$

We can solve this using trial & error for $x\in[0,10]$ and $y\in[0,9]$.

Python code below gives the answer of $10$ participants:

for x in range(0,459/45+1):
for y in range(0,459/48+1):
if 45*x+48*y == 459:
print x+y


Please note that there might be a way to solve it also using Diophantine Analysis.