In a class of 50 students, 30 offer economics, 17 offer government and 7 offer neither economics nor government. How many study both subjects?

Number(E or G) = number(E) + number(G) - number(E and G) + 7

50 = 30 + 17 - number(E and G) + 7
etc

or

use a Venn diagram to justify my equation