Write a programme, using matrices, to solve simultaneous equations. You need only solve problems with two or t
115853
#include <iostream>\n#include <vector>\nusing namespace std;\n#define rep(i, n) for((i) = 0; (i) < (n); (i)++)\n#define rep2(i, k, n) for((i) = k; (i) < (n); (i)++)\nvoid f21();\nint n;\ndouble mat[100][100];\nint main()\n{\nwhile(true)\n{\ncin >> n;\nif(!n) break;\nmemset(mat, 0, sizeof(mat));\nf21();\n}\nreturn 0;\n}\n\nvoid f21()\n{\ncout << "****************************************" << endl;\ncout << "*          INVERSE OF MATRIX           *" << endl;\ncout << "****************************************" << endl;\n\ncout << "ORDER OF THE MATRIX: " << n << endl;\ncout << "ENTER ELEMENT ROW-WISE" << endl;\nint m = 2*n;\nint i, j, k;\nrep(i, n) {\nrep(j, n) {\ncin >> mat[i][j];\ncout <<"&#92;t";\nprintf("%5.3lf", mat[i][j]);\n}\nrep2(j, n, m) {\nif(i == (j-n)){\nmat[i][j] = 1;\ncontinue;\n}\nmat[i][j] = 0;\n}\ncout << endl;\n}\n\ncout << endl << "INVERSE MATRIX: " << endl;\ndouble pivot, comm;\nrep(i, n) {\npivot = mat[i][i];\nif(mat[i][i] == 0){\ncout << "DIVISION BY ZERO." <<endl;\nreturn;\n}\nrep(j, m) mat[i][j] = mat[i][j]/pivot;\nrep(j, n) {\nif(i == j) continue;\ncomm = mat[j][i];\nrep2(k, i, m) {\nmat[j][k] = mat[j][k] - (comm*mat[i][k]);\n}\n}\n}\n\nrep(i, n) {\nrep2(j, n, m) {\ncout <<"&#92;t";\nprintf("%6.4lf", mat[i][j]);\n}\ncout << endl;\n}\ncout << endl;\n}\n\n/*This is writen in C++ this will output the inverse of a Matrix\ninput:\n4\n1 2 3 4\n2 1 4 2\n2 5 7 12\n1 -1 3 11\n\n5\n1.173 -0.634 0 0 0\n-0.539 1.173 -0.634 0 0\n0 -0.539 1.173 -0.634 0\n0 0 -0.539 1.173 -0.634\n0 0 0 -0.539 1.173\n\n0\n*/
145305
Use cubic equation \ny=ax3+bx2+cx+d\n\nSince you have four points data you can get four linear equations with four variables which is very easy to solve, get variables (a,b,c,d) and plug the values to cross check and see u will get answer. Use guass jordan or elimination method.
319242
the following website talks about solving Systems of Linear Equations using Graphs
958006
in order to solve the system of equations you can do one of two things.  The easiest thing to do is to set the two equations to be equal. i.e. \n\nsince y=2x and y = -3x+5, then 2x=-3x+5.  In solving for x you will find that 5x=5 or x=1.  Then you can plug your resulting x back into the equation to get y=2(1) =2.  The main thing you are trying to do is get one of your variables to be equal to some combination of your other variables.  For example, if you are trying to solve 3y+2x-1=5x+3 and 6y=2x+7.  The first thing you want to do is to get a single variable by itself on one side of an equation.\nLet's start with the first equation, 3y+2x-1=5x+3. You would try to group the y terms by themselves on one side of the equation, an group the x terms and constants on the other side of the equation.  In this example, in order to group the terms correctly, you would have 3y=3x+4.  Then solve for y by itself by dividing both sides by 3.  The result is y=x+4/3.  You take this result and substitute for y in the second equation, 6y=2x+7.   You will get 6(x+4/3)=2x+7.  Then you solve for x by itself.  6x+8=2x+7\n4x=-1;  x=-1/4.  Then you can substitute this result back into either of your original equations to produce your solution for this system.  6y=2(-1/4)+7 => 6y=13/2 =>y=13/12.  In order to check your answer, you can graph the two linear equations.  Where the two lines intersect is the solution to your system.\n\n\nIf you are looking for a more advanced way to solve a system of equations, then you may want to consider using an augmented matrix.  Rearrange your equations so that you have only variables on one side of your equations, and only constants on the other side of your equations, then sole the system of Ax=b.  The matrix A is the coefficients of your variables, and b is a vector of your constants.  x is a vector of your variables.  Augment the matrix of your coefficients with your constant vector and do Gaussian Elimination until the matrix is in reduced row echelon form.  This will provide the exact solution to the system of equations.
218359
may be you dont know the system..\nok let me help you...\n2x^2-9x-5 this can be factorised using middle tram factor..\nlet me write it in general from..\n(mX^2+nX+c); first find m*c let k=m*c\nand then factorise k in such from that a*b = k;\nand a+b = n;\nat last rewrite the problem as...\nmX^2+aX+bX+c and solve\n\nin your problem m = 2; n = -9; c = -5;\nk = 2*(-5) = -10;\nfactorising 10: -10 = 10*(-1) = 2*(-5)...\nhere -10+1 = -9 = n\nso a=-10, b=1\nrewriing \n  2x^2-9x-5\n= 2x^2-10x+x-5\n= 2x(x-5)+1(x-5)\n= (x-5)(2x+1)
928663
Are you asking for help or an answer?\n\nTake any 2 equations and multiply all of the terms or one or both by numbers that will make one of the terms in each equation have the same coefficient. Now subtract one from the other and the term will disappear. Now take the resulting equation and do the same with it against the third. Keep doing this until you are down to one term and solve for the variable. Now substitute the variable into the equation and solve for the other variables.
772697
You use the coefficients and the answers to get a 2X3 matrix:\n1 1 8\n1-1 4\n\nAdd row 1 to row 2 to get a new row 2 with a zero in it:\n\n1 1 8\n2 0 12\n\nDivide row 2 by 2 to get a 1 in it\n\n1 1 8\n1 0 6\n\nMultiply row 2 by -1 and add it to row 1 to get a new row 1:\n\n0 1 2\n1 0 6\n\nSwitch the rows:\n\n1 0 6\n0 1 2\n\nSo x is 6 and y is 2\n\nCheck by plugging into the original equations
176323
Use the equation y = ax^2 + bx + c\nYou'll will have one equation for each point.\nFor (0,-2), plug in x = 0, and y = -2.\nYou get\n-2 = a(0)^2 + b(0) + c and so you get\n-2 = c\n\nNow the equation becomes\ny = ax^2 + bx - 2\n\nFor the point (2,-2), plug in x = 2 and y = -2\n-2 = a(2)^2 + b(2) -2 or\n-2 = 4a + 2b - 2 Simplify by adding 2 to both sides\n0 = 4a + 2b\n\nFor (3,4), plug in x = 3, and y = 4\n4 = a(3)^2 + b(3) - 2 or \n4 = 9a + 3b - 2  Simplify by adding 2 to both sides\n6 = 9a + 3b\n\nNow these two equations need to be solved simultaneously.\nSolve the first equation for b and then plug that into the second equation and solve for a.\n0 = 4a + 2b  Subtract 2b from both sides\n-2b = 4a  Divide both sides by -2\nb = -2a\nNow replace b with -2a in the equation 6 = 9a + 3b.\n6 = 9a + 3(-2a)\n6 = 9a - 6a\n6 = 3a\n2 = a\nNow plug in 2 for a in the equation b = -2a\nb = -2(2)\nb = -4\n\nNow plug a, b, and c back into the original equation.\ny = ax^2 + bx + c, where a = 2, b = -4, and c = -2\n\ny = 2x^2 - 4x - 2\n\nYou can check your answer by plugging in each of the three points separately to see if you get a true statement each time.
763084
or solve equation for x and y components separately. \nfor x    0 +3+?=0 \nfor y    3+0 +?=0
830984
You have to first eliminate one variable from two of the equations which would leave two equations with two variables.\nThen eliminate one of those two variables to get one value.  Plug this in to get a second value; plug these in to get the third.\n\nFor example in your problem b, if you multiply the second row by -1 and add it to the first row, that would eliminate z\n\n(2x - 1y = 1)\n\nThen divide the third row by 2 and add it to the (original) first row, which also eliminates z\n\n(20x - 4y = 16)\n\nNow take those 2 rows, eliminate either x or y, and start plugging in
753426
X2   5x - 4y = 1\n10x -8y =2\n-10x + 8y = -3\n-------------------------\n  0=-1                NO SOLUTION
646863
Simultaneous Equations Models\n\nTo get a numerical solution to an unknown, one must have at least as many independent equations as variables. If there are fewer independent equations than variables, there will be infinitely many solutions - another way to say this is that the solution set will be an infinite set (the set containing these infinitely many solutions). When this happens, in many cases, it is said that there are no solutions to the particular unknown one is looking for - however this is a misnomer. In such a case the solutions to an unknown depend on other variables.\n\nIf the number of independent equations is the same as the number of variables, there will typically be finitely many solutions. Therefore systems are frequently considered where the number of variables and independent equations is the same.\n\nBecause of the importance of this, the phrase in the form "x equations, y unknowns" (for example "2 equations 3 unknowns" or "4 equations, 4 unknowns") is often used to describe systems of equations. If y=x or y<x, then every variable will have an explicit solution set - usually finite.
551932
Assuming your matrix is of order nxn and you want submatrix of order mxm.\n\nThen there is (n-m+1)^2 submatrices.\n\nSo you can run this loop(Java code)\n\nfor(i=0;i==n-m;i++)\n{\nint k;\nfor(k=0;k==n-m;k++)\n{\nint p,q;\nfor(p=0;p<m;p++)\n{\nfor(q=0;q<m;q++)\n{\nprint("  ");\nprint(a[p][q]);\n}\nprintln();\n}\n}\n\n}\n\nTo print all the submatrices iterate over this procedure canging m from 1 to n.
77049
first you have to tell us what you're solving for.(either x or y).\nIf you want to combine like terms u have to add 2y+2y you get 4y,then you try 4y+4x = ?.\nBut you forgot what is equal to if you're solving \nfor the letter x or y
134530
First, generate 3 equations by inserting the values of x and y for each of the coordinates.\n\nEqn 1. For (-1,1): 1=a*-1^2+b*-1+c yields: 1=a-b+c\nEqn 2. For (1,3): 3=a*1^2+b*1+c yields: 3=a+b+c\nEqn 3. For (3,2): 2=a*3^2+b*3+c yields: 2=9a+3b+c\n\nStep 1: solve Eqn 1. for a:  a=1+b-c\nStep 2: insert a from Step 1 into Eqn 2.: 3=(1+b-c)+b+c ==> 2=2b ==> b=1\nStep 3: insert b=1 back into Step 1 and re-solve for a: a=1+1-c ==> a=2-c\nStep 4: insert the results from Step 2 for b and Step 3 for a into Eqn 3 to find c.\n  2=9*(2-c)+3*1+c ==> 2=18-9c+3+c ==> 19=8c ==> c=19/8\nStep 5. Insert the results from Step 4 and Step 2 into Eqn 1 to find a.\n  1=a-1+19/8 ==> a=-3/8\n\nTherefore:\n  a=-3/8\n  b=1\n  c=19/8\n\nStep 6: Verify for -3/8*x^2 + 1*x +19/8\n (-1,1): 1=-3/8*(-1^2)+1*-1+19/8\n (1,3): 3=-3/8*(1^2)+1*1+19/8\n (3,2): 2=-3/8*(3^2)+1*3+19/8
148434
So, continuing with mr_w's excellent example, we have 4 equations in 4 unknowns. So you can set this up as a matrix-vector problem.  Define matrix M such that M * Number of games bought vector = Cost & total games vector.  Assigning the rows of M in order to the total cost, the PS3 and Xbox360 cost, the PS1 and Xbox360 cost, and the total number of games, \nM = \n70 150 300 450\n0 0 300 450\n70 0 0 450\n1 1 1 1\nNumber of games bought vector =\na\nb\nc\nd\nand Cost & total games vector =\n13910 12000 3050 54\nThe solution will find the values of a, b, c and d.\nWhen I ran the solution I ended up with noninteger values for each and the values checked with the problem statements.  I hope those values were mr_w's solution.
695947
D\n\nEither is sufficient.  \n1) will lead to 2 equations,2 unknowns which yield a unique solution for x and y:  x=y+1, x+y=77, therefore x=39, y=38.  xy=1482 \n\n2) If the sum is 77 and x and y have the same tens digit, then there are two solutions for {x,y}, namely {38,39} and {39,38}, however the product xy is the same. xy=1482