1. ## Help with algebra

If the teacher has a box of cookies and the first students in line takes 4 cookies each , then 5 students will be left withoutout. If the first students inline take 3 cookies each then 6 students will be left without.
How many students are there in the class?
My question is - how do you solve it i.e the calculations and the answer?

2. ## Re: Help with algebra

It does not make sense. If the first few students take fewer cookies, then more people will be left without any cookies?

Let C be the total number of cookies. Let S be the total number of students. Then we have the number of students is equal to the number of cookies divided by 4 plus 5 which is also equal to the number of cookies divided by 3 plus 6.

$S = \dfrac{C}{4}+5 = \dfrac{C}{3}+6$

Using the last equality, we have:

$\dfrac{C}{4}-\dfrac{C}{3} = 1$
$-\dfrac{C}{12} = 1$
$C = -12$

There are -12 cookies? That just does not make any sense! The problem is not solvable.

3. ## Re: Help with algebra

Sorry wrote wrong.....
A teacher comes in to the class with a box of cookies, he has the kids to line up and they start taking cookies. Each one takes 4 at the end of the line there is nothing left for the last 5 kids. IF the kids would have taken 3 each then 6 cookies would be left in the box.
How many kids are there in the class?
Did this help to clarify?

4. ## Re: Help with algebra

Yes, that helps a lot!

We have $S$ is the total number of students. The first students in line each took 4 cookies. Let's say that there are $x$ students in line that each took 4 cookies and 5 students who got none. So, the total number of students is $S = x+5$. We know that $4x$ is the number of cookies taken, and since there were none left, we know that is the exact number of cookies in the box. So, we have $4x = C$, which is the number of cookies. Solving for $x$, we have $x = \dfrac{C}{4}$. Plugging into our formula, we get the first equality I gave above:

$S = \dfrac{C}{4} + 5$ (Equation 1)

For the second scenario, all $S$ students took 3 cookies, and there were still 6 left over. So, $C = 3S+6$. Solving for $S$, we have:

$S = \dfrac{C-6}{3}$ (Equation 2)

Now, since the right hand side of both Equation 1 and Equation 2 are each equal to S, we can set them equal to each other:

$\dfrac{C}{4}+5 = \dfrac{C-6}{3}$

Multiply both sides by 12 to get:

\begin{align*}3C+60 & = 4C-24 \\ 3C+60 \color{red}{-3C+24} & = 4C-24 \color{red}{-3C+24} \\ 84 & = C\end{align*}

Now that we have $C$, we can solve for $S$ by plugging into Equation 2:

$S = \dfrac{C-6}{3} = \dfrac{84-6}{3} = \dfrac{78}{3} = 26$

There are 26 students in class. If the first 21 students take 4 cookies each, they have taken all 84 cookies, leaving the last 5 students in line with no cookies. If each of the 26 students takes 3 cookies each, they have taken 78 cookies, leaving 6 in the box.

6. ## Re: Help with algebra

I am soooo grateful for your help. but could you please explain the part written underneath "Multiply both sides by 12 to get:". How did you end up with that, from the calculation above that?

7. ## Re: Help with algebra

Originally Posted by ceedee
I am soooo grateful for your help. but could you please explain the part written underneath "Multiply both sides by 12 to get:". How did you end up with that, from the calculation above that?
Sure. Here it is, step-by-step:

\begin{align*}\dfrac{C}{4}+5 & = \dfrac{C-6}{3} \\ 12\left( \dfrac{C}{4} + 5 \right) & = 12\left( \dfrac{C-6}{3} \right) \\ 12\cdot \dfrac{C}{4} + 12\cdot 5 & = 12\cdot \dfrac{C-6}{3} \\ \dfrac{12C}{4} + 60 & = \dfrac{12(C-6)}{3} \\ \dfrac{3\cdot \cancel{\color{red}{4}}\cdot C}{\cancel{\color{red}{4}}}+60 & = \dfrac{\cancel{\color{red}{3}} \cdot 4(C-6)}{\cancel{\color{red}{3}}} \\ 3C + 60 & = 4(C-6) \\ 3C+60 & = 4C-4\cdot 6 \\ 3C+60 & = 4C-24\end{align*}

Does this clear it up?

8. ## Re: Help with algebra

I will for sure come back here if I have anything more to ask. You are just great! Once again, thank you from Finland!

9. ## Re: Help with algebra

I'll show you one more way to do the problem (there are many ways of doing it):

Above, we had equation 1 was:

$S = \dfrac{C}{4} + 5$

Then, we solved $C=4S+6$ for $S$ to get equation 2. Instead, let's use:

$C = 4S+6$ (Equation 3)

Then, we will solve the first equation for $C$:

\begin{align*}S & = \dfrac{C}{4}+5 \\ S \color{red}{-5} & = \dfrac{C}{4} + \cancel{5 \color{red}{-5}} \\ 4(S-5) = \cancel{\color{red}{4}}\left( \dfrac{C}{ \cancel{ \color{red}{4} } } \right) \\ 4S-4\cdot 5 & = C \\ 4S-20 & = C\end{align*}

Now we have another equation for $C$:
$C = 4S-20$ (Equation 4)

Since both Equation 3 and Equation 4 are expressions for $C$, we can set them equal:

\begin{align*}4S-20 & = 3S+6 \\ \color{red}{-3S+\cancel{20}} + 4S \cancel{-20} & = \cancel{3S}+6 \color{red}{\cancel{-3S}+20} \\ S & = 6+20 = 26\end{align*}

Both solutions give the same number of students in the class. Both solutions are correct ways of solving the problem.

10. ## Re: Help with algebra

Thank you so much! You are a maths genius!! The second way was interesting seeing as we use your previous solution when we are doing maths here in Finland. Very intresting seeing another way. Thank you!