It is a long time since I have studied any maths and I am not even sure I will be able to phrase my question clearly so apologies in advance.
I am trying to understand how the author of the equations below (on a thread elsewhere about a MySQL query problem) got from the information below to one of the many potential solutions at the bottom.
Any pointers on where to look would be most helpful. My internet searches thus far have all taken me into discussions too deep for my understanding and, probably, needs. All of the values below will always be whole numbers greater than zero.
If it helps, the 600 and 400 totals represent genders and the other four are geographies. I need to know how to calculate the individual values, as there will usually be other criteria such as age group or education level, so the example here is probably a simple one.
Any help would be much appreciated, cheers.
Now solve for X1,X2, …X8 in the above. There are many solutions. Here is a solution:
X1=60, X2=120, X3=180,X4=240,X5=40,X6=80,X7=120,X8=160
This system is under determined. In matrix notation that system becomes: (111100000000111110001000010001000010001000010001)(X1X2X3X4X5X6X7X8)=(600400100200300400).\left(
1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\
1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\
Solving this problem involves next to no algebra, since the equations are already decoupled very much.
One can easily solve the last four equations to eliminate four variables for example X5…X8X_5\dots X_8 just by bringing the X1…X4X_1\dots X_4 to the other side:
If one plugs in those four solutions into the second equation it becomes equivalent to the first one, so it holds no new information. One can see this immediately from the coefficient matrix: the second row is just the sum of the last four rows minus the first row – it is not linear independent.
So the last thing we can do is eliminate one last variable using the first equation, for example X4X_4:
X_4=600 – X_1 – X_2 – X_3.
So the best we can do with the equation system is:
X_4&=600 – X_1 – X_2 – X_3,\\
X_8&=-200+X_1 +X_2 +X_3.
One can choose any combination of X1X_1, X2X_2 and X3X_3, then compute X4…X8X_4\dots X_8 using the last 5 equations above and one has a solution of the system.
Thanks for the response, I am afraid I didn’t realise that the example was as structured as it was. I need to go away and try to work out how to phrase my question properly. In the meantime, I will use your answer to try and get my maths head working.
2 days ago