TOPICS
Search

Ryser Formula


The Ryser formula expresses the permanent of an n×n matrix, where n is a positive integer, as

 perm(a_(ij))=(-1)^nsum_(s subset= {1,...,n})(-1)^(|s|)product_(i=1)^nsum_(j in s)a_(ij),

where the sum is over all subsets of {1,...,n}, and |s| is the number of elements in s. The formula can be optimized by picking the subsets so that only a single element is changed at a time (which is precisely a Gray code), reducing the work per term from O(n^2) to O(n).

The label of the disk moved at the kth step in the standard optimal three-rod tower of Hanoi solution is the element changed at the kth transition of the binary reflected Gray code ordering of these subsets (Gardner 1988b; Vardi 1991, p. 111).


See also

Determinant, Gray Code, Permanent, Tower of Hanoi

Explore with Wolfram|Alpha

References

Gardner, M. "The Icosian Game and the Tower of Hanoi." Ch. 6 in The Scientific American Book of Mathematical Puzzles & Diversions. New York: Simon and Schuster, pp. 55-62, 1959. https://books.google.com/books?id=ErAyAAAAMAAJ.Gardner, M. "The Icosian Game and the Tower of Hanoi." Ch. 6 in Hexaflexagons and Other Mathematical Diversions: The First Scientific American Book of Puzzles and Games. Chicago, IL: University of Chicago Press, pp. 55-62, 1988a.Gardner, M. Time Travel and Other Mathematical Bewilderments. New York: W. H. Freeman, 1988b.Knuth, D. E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 3rd ed. Reading, MA: Addison-Wesley, p. 515, 1998.Nijenhuis, A. and Wilf, H. Chs. 7-8 in Combinatorial Algorithms. New York: Academic Press, 1975.Vardi, I. Computational Recreations in Mathematica. Reading, MA: Addison-Wesley, p. 111, 1991.

Referenced on Wolfram|Alpha

Ryser Formula

Cite this as:

Weisstein, Eric W. "Ryser Formula." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/RyserFormula.html

Subject classifications