{"record":{"id":"95ddc332ce6c69c9","repo":"TheAlgorithms/Python","slug":"infinite-solutions-consistent-system","errorCode":null,"errorMessage":"Infinite solutions. (Consistent system)","messagePattern":"Infinite solutions\\. \\(Consistent system\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"matrix/cramers_rule_2x2.py","lineNumber":73,"sourceCode":"    # Check if the input is valid\n    if not len(equation1) == len(equation2) == 3:\n        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":55,"sourceCodeEnd":84,"githubUrl":"https://github.com/TheAlgorithms/Python/blob/f5988cc09713315817df6a7e327e258013a94440/matrix/cramers_rule_2x2.py#L55-L84","documentation":"Error \"Infinite solutions. (Consistent system)\" thrown in TheAlgorithms/Python.","triggerScenarios":"Thrown at matrix/cramers_rule_2x2.py:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The system is dependent; supply independent equations to get a unique solution."],"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"}