{"slug":"system-2x2","tier":1,"subject":"algebra","title":"2x2 Systems","description":"Reference card for 2-variable system methods.","files":[{"filename":"SYS2X2.py","content":"def p(s):print(s)\ndef o1():\n p(\"=SUB=\")\n p(\"SOLVE 1ST\")\n p(\"FOR 1 VAR\")\n p(\"SUB INTO 2ND\")\n p(\"SOLVE REM VAR\")\ndef o2():\n p(\"=ELIM=\")\n p(\"MULTIPLY EQS\")\n p(\"MATCH COEFS\")\n p(\"ADD TO ELIM\")\n p(\"SOLVE BACK\")\ndef o3():\n p(\"=GRAPH=\")\n p(\"PLOT BOTH\")\n p(\"FIND INT PT\")\n p(\"(x,y)=SOL\")\ndef menu():\n while True:\n  p(\"=SYS 2X2=\")\n  p(\"1:SUB\")\n  p(\"2:ELIM\")\n  p(\"3:GRAPH\")\n  p(\"0:EXIT\")\n  c=input(\"?>\")\n  if c==\"1\":o1()\n  elif c==\"2\":o2()\n  elif c==\"3\":o3()\n  elif c==\"0\":break\nmenu()"}],"testCases":[{"id":"sub-method","inputs":["1","0"],"expectedContains":["SOLVE 1ST"]},{"id":"elim-method","inputs":["2","0"],"expectedContains":["MULTIPLY"]}],"usage":"Reference card for the three ways to solve a 2-variable system:\n\n- `1:SUB` — substitution: solve one equation for a variable, sub into the other.\n- `2:ELIM` — elimination: multiply to match a coefficient, add to cancel, solve back.\n- `3:GRAPH` — graphical: plot both lines, read off the intersection.\n- `0:EXIT` — leave.\n\nEach option prints a 4-line procedure. Pick the method that fits the system: `SUB` when one equation already isolates a variable, `ELIM` when coefficients are close, `GRAPH` when the intersection is at integer coordinates.","example":{"problem":"You're solving `2x + y = 10` and `3x − y = 5` and can't remember which method is fastest.","walkthrough":"The `y` coefficients are already +1 and −1 — perfect for elimination.\n\n1. Run `SYS2X2`.\n2. Pick `2:ELIM`.\n3. Screen shows: `MULTIPLY EQS` / `MATCH COEFS` / `ADD TO ELIM` / `SOLVE BACK`.\n\nApply: add the two equations → 5x = 15 → x = 3. Sub back: 2(3) + y = 10 → y = 4. Solution (3, 4). ✓"}}