Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Random_permutation Calculator

Random_permutation

Function: random_permutation (<a>) Returns a random permutation of the set or list <a>, as constructed by the Knuth shuffle algorithm.

random_permutation ([a, b, c, 1, 2, 3]);
 random_permutation ([a, b, c, 1, 2, 3]);
 random_permutation ({x + 1, y + 2, z + 3});
 random_permutation ({x + 1, y + 2, z + 3});

The return value is a new list, which is distinct from the argument even if all elements happen to be the same. However, the elements of the argument are not copied.

Examples:

          (%i1) random_permutation ([a, b, c, 1, 2, 3]);
          (%o1)                  [c, 1, 2, 3, a, b]
          (%i2) random_permutation ([a, b, c, 1, 2, 3]);
          (%o2)                  [b, 3, 1, c, a, 2]
          (%i3) random_permutation ({x + 1, y + 2, z + 3});
          (%o3)                 [y + 2, z + 3, x + 1]
          (%i4) random_permutation ({x + 1, y + 2, z + 3});
          (%o4)                 [x + 1, y + 2, z + 3]

(%o1)                                true
(%i2) 

Random_permutation Example

Related Examples

random_permutation

? random_permutation;

Calculate

random_permutation

random_permutation([1...

Calculate

random_permutation

random_permutation([1...

Calculate

random_permutation

random_permutation([1...

Calculate

random_permutation

random_permutation([1...

Calculate

random_permutation

random_permutation ([...

Calculate

random_permutation

random_permutation([1...

Calculate

random_permutation

? random_permutation;

Calculate

random_permutation

random_permutation ([...

random_permutation (...

random_permutation (...

Calculate

random_permutation

random_permutation ([...

random_permutation (...

random_permutation (...

Calculate