{"record":{"id":"962029b66d94a888","repo":"TheAlgorithms/Python","slug":"no-solution-inconsistent-system","errorCode":null,"errorMessage":"No solution. (Inconsistent system)","messagePattern":"No solution\\. \\(Inconsistent system\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"matrix/cramers_rule_2x2.py","lineNumber":75,"sourceCode":"        raise ValueError(\"Please enter a valid equation.\")\n    if equation1[0] == equation1[1] == equation2[0] == equation2[1] == 0:\n        raise ValueError(\"Both a & b of two equations can't be zero.\")\n\n    # Extract the coefficients\n    a1, b1, c1 = equation1\n    a2, b2, c2 = equation2\n\n    # Calculate the determinants of the matrices\n    determinant = a1 * b2 - a2 * b1\n    determinant_x = c1 * b2 - c2 * b1\n    determinant_y = a1 * c2 - a2 * c1\n\n    # Check if the system of linear equations has a solution (using Cramer's rule)\n    if determinant == 0:\n        if determinant_x == determinant_y == 0:\n            raise ValueError(\"Infinite solutions. (Consistent system)\")\n        else:\n            raise ValueError(\"No solution. (Inconsistent system)\")\n    elif determinant_x == determinant_y == 0:\n        # Trivial solution (Inconsistent system)\n        return (0.0, 0.0)\n    else:\n        x = determinant_x / determinant\n        y = determinant_y / determinant\n        # Non-Trivial Solution (Consistent system)\n        return (x, y)\n","sourceCodeStart":57,"sourceCodeEnd":84,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/matrix/cramers_rule_2x2.py#L57-L84","documentation":"Error \"No solution. (Inconsistent system)\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at matrix/cramers_rule_2x2.py:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The system is inconsistent; check the equations for contradictory constraints."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f5988cc09713315817df6a7e327e258013a94440","analyzedAt":"2026-08-14T17:30:07.041Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}