Jerry bought some candies for his students. If he gave each student 3 candies, he would have 16 candies left. If he gave each student 5 candies, he would be short of 6 candies.

(a) How many students are there?
(b) How many candies did Jerry buy?

To solve this problem, let's represent the number of students as 'x' and the number of candies that Jerry bought as 'y'.

(a) To find the number of students, we will use the first piece of information given, which states that if Jerry gave each student 3 candies, he would have 16 candies left. We can set up an equation based on this information:

3x + 16 = y

(b) To find the number of candies Jerry bought, we will use the second piece of information, which states that if he gave each student 5 candies, he would be short of 6 candies. We can set up another equation based on this information:

5x - 6 = y

To solve this system of equations, we can use the substitution method.

First, let's solve equation (a) for 'x':

3x + 16 = y
3x = y - 16
x = (y - 16)/3

Now, substitute the value of x into equation (b):

5x - 6 = y
5((y - 16)/3) - 6 = y
(5y - 80)/3 - 6 = y
5y - 80 - 18 = 3y
5y - 3y = 80 + 18
2y = 98
y = 49

Now that we have found the value of y, we can substitute it back into equation (a) to find the value of x:

3x + 16 = y
3x + 16 = 49
3x = 49 - 16
3x = 33
x = 11

Therefore, there are 11 students and Jerry bought 49 candies.