My question is that i need help for this problem understanding how they came about to the answer it is an odd problem so:

The answer they have is:
18 cakes for the first one.
8 cakes for the second one.
2 cake for the third one.

Here is the original problem:
A baker sells three types of cakes, each requiring the amount of ingredients shown.

Ingredients / cake 1 / cake 2/cake 3
Flour (cups)/ 2 / 4 / 2
Sugar (cups)/ 2 / 1 / 2
Eggs / 2 / 1 / 3

To fill its orders for these cakes,the baker used 72cups of flour, 48 cups of sugar, and 50 eggs. How many cakes of each type were made?

Three unknowns, three equations
Flour equation:2C1 + 4C2 + 2 C3=72
Sugar equation:2C1 +1C2 + 2C3=48
Egg equation:2C1 +C2 + 3C3=50

solve for C1, C2, C3
You have a problem here on equation 1 and equation 2. They are not independent equations in variables C1,C3.So you can only use them once.
subtract2 from 1 to get C2=8
Now you have to shift to equations 3 and one of the first two.
2C1 +8 + 3C3=50 or 2C1 + 3C3=42
I'll pick equation1 for the other.
2C1 + 32 + 2 C3=72 or 2C1 + 2 C3=40
subtract those equations to get C2=2
finally, you have to stay away from equaton1, 2 because you have already used it, so in equation 3
2C1 +8 + 6=50 or C1=18
This is not a good problem to use in a text because of the linear dependence problem in equations 1,3

x_i = number of cakes of type i

72 cups of flour were used --->

2 x1 + 4 x2 + 2 x3 = 72 (1)

48 cups of sugar were used --->

2 x1 + x2 + 2 x3 = 48 (2)

50 eggs were used --->

2 x1 + x2 + 3 x3 = 50 (3)

(1) - (2):

3 x2 = 24 -->

x2 = 8

(3) - (2):

x3 = 2

Insert these values of x3 and x2 in any of the three equations to obtain:

x1 = 18

thank you i figured it out and understand it thanks to your explanation. You sure have helped me.

ye that is pretty hard

You're welcome! I'm glad I could help you understand how to solve the problem. If you have any more questions or need further clarification, feel free to ask.