How this calculation works
The permanent resembles a determinant’s permutation expansion but omits the alternating signs. This small change produces a different algebraic quantity with important counting interpretations. The calculator evaluates it exactly for bounded rational matrices using Ryser inclusion-exclusion. For a zero-one bipartite adjacency matrix, the result counts perfect matchings. For general signed or fractional data it is a weighted algebraic sum and should not automatically be described as an ordinary count.
perm(A)=Σσ∏i a_i,σ(i), without determinant permutation signs.A worked example
For the 2×2 all-ones matrix, the two permutation products both equal one, so the permanent is two. The determinant of that same matrix is zero because the products subtract. In a bipartite matching interpretation, the two ones-per-row assignments correspond to the two distinct ways to match every left vertex to one right vertex.
Good to know
Supports rational square matrices up to 6×6 with bounded exact-fraction growth. It does not enumerate every matching, optimize assignment costs or treat a rectangular matrix as a square one automatically. General entries can produce negative or fractional permanents. Large permanent problems grow combinatorially and are outside this educational browser scope.
Reference: SymPy — matrix permanent definition (opens in a new tab) ↗
Each product selects one entry per row and column
A permutation chooses a distinct column for every row. Multiplying the selected entries gives one term, and summing over all permutations gives the permanent. For a 2×2 matrix [[a,b],[c,d]], the formula is ad+bc rather than ad−bc. The all-ones example makes this sign distinction especially visible because the determinant cancels while the permanent remains positive.
In a zero-one matrix, a selected product is one exactly when every chosen edge is allowed. A zero entry eliminates any assignment using that edge. Thus the permanent counts perfect matchings in a balanced bipartite graph. The matching interpretation belongs on this page; it does not require another calculator that would repeat the same operation under a graph title.
The matrix determinant calculator uses alternating permutation signs, so its value cannot replace a permanent.
Determinant elimination rules cannot be reused blindly
Swapping two rows does not negate the permanent, and adding a multiple of one row to another does not preserve it as determinant elimination would. A generic determinant routine with its final sign changed cannot compute the permanent. Ryser’s formula instead uses inclusion-exclusion over column subsets, combining products of row sums.
The implementation’s subset enumeration is bounded to six columns and uses exact reduced fractions. A successful result is therefore not a claim that large matching-count problems are easy. For diagonal matrices, only the diagonal permutation contributes, providing a simple independent check. The determinant calculator answers questions about invertibility and oriented volume; the permanent has a different sum and cannot replace that test.
A few questions, answered
Can a singular matrix have a nonzero permanent?
Yes. The 2×2 all-ones example is singular but has permanent two. Determinant singularity is not a permanent-zero condition.
Can the permanent be negative?
For nonnegative entries it is nonnegative. Signed entries can produce a negative algebraic sum, which is not an unweighted matching count.