• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need help with math.

Status
Not open for further replies.
Level 9
Joined
Oct 17, 2009
Messages
370
Ok so here's the question,

Niklas got pigs and hen. All together there are 30 animals, and these animals have 70 legs together.

Make an equation and count how many hen Niklas got.

What i do know is that he got 5 pigs and 25 hen since 5*4+25*2 is 70 and 5+25 is 30. But how should i make the equation??? Call the amount of PIGS x.
 
Level 15
Joined
Oct 16, 2010
Messages
942
ya, everything you do in math can technically be placed into ONE equation, it's just easier for us to read it on multiple lines.

Technically what we're doing is just simplifying ONE equation.

For example, I could say this is the equation your looking for:
4(30 - y) + 2y = 70

but then I could simplify that down, so why wouldn't I?

120 - 4y + 2y = 70

but then I could simplify it down even more, so why wouldn't I?

120 - 2y = 70

and again..

-2y = -50

and again..

2y = 50

and again..

y = 25

It's all one equation, its just being simplified.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
These systems of equations become a single matrix equation...


in this case...
[X]{Y} = {Z}

[X] is a 2 by 2 matrix containing the relationship values....
[1,1]
[4,2]

{Y} is the vector containing the variables...
{pig,hen}

{Z} is the vector containing the resulting products of the equation...
{30,70}

One could compact this into a form we can even solve by fusing the right hand side into the left hand side and so equating it equal to 0 (well a vector of 0s).

[A]{B} = {0,0}

[A] is matrix [X] with vector -{Z} compentents added to it (as we had to subrast {Z] from both sides).
[1,1,-30]
[4,2,-70]

{B} is {Y} but exntended with an additional constant to accomidate the new row.
{pig,hen,1}
Note we could make the consant -1 and in doing so make the values positive that were added in matrix [A].

By utalizing matrix transformations, make [X] an eshelon matrix (diagonal of 1s).
[1,1,-30]
[4,2,-70]
goes to
[1,1,-30]
[0,-2,50]
goes to
[1,0,-5]
[0,1,-25]

Now in eshelon form, we can insert it back into the equation to get a vector equation.
{1pig + 0hen -5,0pig +1hen -25} = {0,0}
0 times anything is 0 so remove those values.
Take the constants across.

Thus we end up with the final solution.
{pig,hen} = {5,25}

Thus you can see there are 25 hens. The 5 pigs is a bonus answer. It is also technically right as the answer was worked out utalizing a single equation via rearrangements. It also did not specify you can not work out the number of pigs (just you need the number of hens) in the same equation.

However you were probably meant to do it the child way of...
4(30 - y) + 2y = 70
as shown by posters above as that will only work out the numbers of hens she had and does not utalize matrix and vector mathematics.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Yeh but this model works for more than just chickens...
What if he was asked to find chicken and pig in the same equation for example.
Or what if it was extended to contain cows with more conditions.
Or maybe they started adding farming verchels to the equation as well.

Where as other methods do work, they have limited scope of problems. Martix calculations are used professionally with some models forming matricies with over 32*32 values in them.
 
Level 36
Joined
Feb 5, 2009
Messages
4,630
I don't get how you can get 'one equation', so to speak, as this is a question which gives you two equations and requires you to use methods of substitution. Perhaps if you typed the question word-for-word, we might even be able to say it is YOU who is misunderstanding it, or perhaps understand the question better ourselves.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I don't get how you can get 'one equation', so to speak, as this is a question which gives you two equations and requires you to use methods of substitution.

No it does not as I proved. I also used no subsitutions (only matrix transformations). Matrix and vector mathemaitcs allows you to solve for multiple variables in the same equation as it allows a whole equation system to be represented as one single equation.

The problem was actually asking only for the number of chickens. As such lets state the facts...

30 animals in total
70 legs in total
1 chicken is bipedal (2 legs)
1 pig is quadrapedal (4 legs)

Number of chickens = N
Number of pigs = 30-N

Number of legs owned by pigs = 4(30-N) = 120-4N
Number of legs owned by chickens = 2N
70 legs in total (as a reminder lol)

Number of legs owned by pigs + Number of legs owned by chickens = legs in total
120-4N + 2N = 70
-2N = -50
N = 25

There you have it, with nothing more than a single equation at the end. Ofcourse the deriving process was only for show and does not count as separate equations.
 
Level 36
Joined
Feb 5, 2009
Messages
4,630
That's what you get by using 2 equations. What I was referring to was what the original poster was referring to.
You seem to have misunderstood what I was misunderstanding. As the this has been posted before and the OP said 'nope, not good enough', which confuses me as it gets you the answer very easily.
 
Status
Not open for further replies.
Top