<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>permutations -- produce all permutations of a list</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_pfaffians.html">next</a> | <a href="_permanents.html">previous</a> | <a href="_pfaffians.html">forward</a> | <a href="_permanents.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>permutations -- produce all permutations of a list</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>permutations x</tt></div> </dd></dl> </div> </li> <li><div class="single">Inputs:<ul><li><span><tt>x</tt>, <span>a <a href="___Visible__List.html">visible list</a></span> or <span>an <a href="___Z__Z.html">integer</a></span></span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span>a list of all the permutations of the visible list <tt>x</tt>, or, if <tt>x</tt> is an integer, of the list of integers from 0 through <tt>n-1</tt></span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><table class="examples"><tr><td><pre>i1 : permutations {a,b,c,d} o1 = {{a, b, c, d}, {a, b, d, c}, {a, c, b, d}, {a, c, d, b}, {a, d, b, c}, ------------------------------------------------------------------------ {a, d, c, b}, {b, a, c, d}, {b, a, d, c}, {b, c, a, d}, {b, c, d, a}, ------------------------------------------------------------------------ {b, d, a, c}, {b, d, c, a}, {c, a, b, d}, {c, a, d, b}, {c, b, a, d}, ------------------------------------------------------------------------ {c, b, d, a}, {c, d, a, b}, {c, d, b, a}, {d, a, b, c}, {d, a, c, b}, ------------------------------------------------------------------------ {d, b, a, c}, {d, b, c, a}, {d, c, a, b}, {d, c, b, a}} o1 : List</pre> </td></tr> <tr><td><pre>i2 : permutations 3 o2 = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0}} o2 : List</pre> </td></tr> </table> </div> </div> <div class="waystouse"><h2>Ways to use <tt>permutations</tt> :</h2> <ul><li>permutations(VisibleList)</li> <li>permutations(ZZ)</li> </ul> </div> </div> </body> </html>