I don't know what is wrong with my graph for this problem - at most how many students take none of these courses? Is my graph wrong? If it is, what is the correct one? I used this graph to solve the problem and got a wrong answer. It is highly appreciated if one can show me the correct graph.

Of the 60 students at Hope Middle School, 40 take algebra, 45 take geometry, 48 take trigonometry. Furthermore, 22 take all three courses. At most how many students take none of these courses?


According to this graph, I have:
$$a+b=45-22$$
$$b+c=48-22$$
$$c+a=40-22$$
$$x=60-(40+45+48-a-b-c-22)$$
$x$ is many students taking none of these courses.
 A: Your Venn diagram can be used to solve the problem. First use it to calculate that the number of students who take at least one of the classes is 
$$22+a+b+c+(18-a-c)+(23-a-b)+(26-b-c)=89-a-b-c\;,$$
so that the number who take none is
$$60-(89-a-b-c)=a+b+c-29\;;$$
this makes it very clear that we want to make $a+b+c$ as large as possible, and that we must make it at least $29$. Now $a+c$ can be at most $40-22=18$, and similarly $a+b$ can be at most $23$, and $b+c$ can be at most $26$. Thus,
$$2(a+b+c)=(a+c)+(a+b)+(b+c)$$
can be at most $18+23+26=67$, $a+b+c$ can be at most $33$ (since it must be an integer), and there can be at most $33-29=4$ students who take none of the classes. It only remains to check that we can find $a,b$, and $c$ that actually yield this result.
Suppose that we make $b+c$ as large as possible, i.e., $26$; then $c=26-b$. We know that $a+b\le 23$, so $a\le 23-b=c-3$, and $a+c\le 2c-3$. We also know that $a+c\le 18$, so we’ll be in business if $2c-3\le 18$, or $2c\le 21$. Of course $c$ must be an integer, so we want $c\le 10$. We’re trying to maximize $a+b+c$, so let’s see what happens if we try $c=10$. Then $a\le 10-3=7$, and we’ll try the maximum, $a=7$. Then we have $a=7,c=10$, and $b=26-c=16$, and indeed $7+10+16=33$ with all of the required conditions satisfied.
A: 
Total of all the classes
$$
a+b+c+2d+2e+2f=133-66=67\tag{1}
$$
Algebra
$$
a+d+e=40-22=18\tag{2}
$$
Trigonometry
$$
b+d+f=48-22=26\tag{3}
$$
Geometry
$$
c+e+f=45-22=23\tag{4}
$$
Number of students in one of these classes
$$
t=a+b+c+d+e+f+22\tag{5}
$$
Number of students not in any class
$$
\begin{align}
60-t
&=38-a-b-c-d-e-f\\
&=38-\frac{67+a+b+c}2\\
&=\frac{9-(a+b+c)}2\tag{6}
\end{align}
$$
To maximize $(6)$, we want to minimize a+b+c. We cannot have $a+b+c=0$ since $(1)$ would then imply that $2(d+e+f)=67$. Thus, the minimum would be $a+b+c=1$. There are three cases:
$a=1$: $b=c=0$, $d=10$, $e=7$, $f=16$
$b=1$: $a=c=0$, $d=10$, $e=8$, $f=15$
$c=1$: $a=b=0$, $d=11$, $e=7$, $f=15$

Each of these cases leaves us with $4$ students not taking any classes.
A: The first three equations are correct. The fourth one is wrong. Assume that $x$ is the number of the students taking none of these courses. If you look at the shaded areas carefully, you have the following equations:
$$a+b=45-22$$
$$b+c=48-22$$
$$c+a=40-22$$
$$x=60-[40+(45-a-22)+(48-c-b-22)]=-29+a+b+c$$
From the first three equations you have $$a+b+c=67/2$$ then $$x=-29+67/2=3.5$$
since $x$ has to be an integer, then "at most" $x=4$.

