How to resolve the algorithm Determinant and permanent step by step in the МК-61/52 programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Determinant and permanent step by step in the МК-61/52 programming language

Table of Contents

Problem Statement

For a given matrix, return the determinant and the permanent of the matrix. The determinant is given by while the permanent is given by In both cases the sum is over the permutations

σ

{\displaystyle \sigma }

of the permutations of 1, 2, ..., n. (A permutation's sign is 1 if there are an even number of inversions and -1 otherwise; see parity of a permutation.) More efficient algorithms for the determinant are known: LU decomposition, see for example wp:LU decomposition#Computing the determinant. Efficient methods for calculating the permanent are not known.

Let's start with the solution: