Permutations with repetitions: Difference between revisions

Content added Content deleted
(added Maxima code section)
Line 1,330: Line 1,330:
{{out}}
{{out}}
<pre>{{1, 1}, {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {3, 1}, {3, 2}, {3, 3}}</pre>
<pre>{{1, 1}, {1, 2}, {1, 3}, {2, 1}, {2, 2}, {2, 3}, {3, 1}, {3, 2}, {3, 3}}</pre>

=={{header|Maxima}}==
<lang maxima>apply(cartesian_product,makelist({1,2,3}, 2));</lang>
{{out}}
<pre>{[1,1],[1,2],[1,3],[2,1],[2,2],[2,3],[3,1],[3,2],[3,3]}</pre>


=={{header|Perl}}==
=={{header|Perl}}==