Maxima – 196 – Insiemi – 5


Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.593.

intersect (a_1, ..., a_n)
intersect is the same as intersection.

intersection (a_1, ..., a_n)
Returns a set containing the elements that are common to the sets a_1 through a_n.

intersection complains if any argument is not a literal set.

(%i1) S_1 : {a, b, c, d};
(%o1)                            {a, b, c, d}
(%i2) S_2 : {d, e, f, g};
(%o2)                            {d, e, f, g}
(%i3) S_3 : {c, d, e, f};
(%o3)                            {c, d, e, f}
(%i4) S_4 : {u, v, w};
(%o4)                              {u, v, w}
(%i5) intersection (S_1, S_2);
(%o5)                                 {d}
(%i6) intersection (S_2, S_3);
(%o6)                              {d, e, f}
(%i7) intersection (S_1, S_2, S_3);
(%o7)                                 {d}
(%i8) intersection (S_1, S_2, S_3, S_4);
(%o8)                                 {}

kron_delta (x1, x2, ..., xp)
Represents the Kronecker delta function.

kron_delta simplifies to 1 when xi and yj are equal for all pairs of arguments, and it simplifies to 0 when xi and yj are not equal for some pair of arguments. Equality is determined using is(equal(xi, xj)) and inequality by is(notequal(xi,xj)). For exactly one argument, kron_delta signals an error.

(%i9) kron_delta(a,a);
(%o9)                                  1
(%i10) kron_delta(a,b,a,b);
(%o10)                         kron_delta(a, b)
(%i11) kron_delta(a,a,b,a+1);
(%o11)                                 0
(%i12) assume(equal(x,y));
(%o12)                           [equal(x, y)]
(%i13) kron_delta(x,y);
(%o13)                                 1

listify (a)
Returns a list containing the members of a when a is a set. Otherwise, listify returns a.

full_listify replaces all set operators in a by list operators.

(%i14) listify ({a, b, c, d});
(%o14)                           [a, b, c, d]
(%i15) listify (F ({a, b, c, d}));
(%o15)                          F({a, b, c, d})

makeset (expr, x, s)
Returns a set with members generated from the expression expr, where x is a list of variables in expr, and s is a set or list of lists. To generate each set member, expr is evaluated with the variables x bound in parallel to a member of s.

Each member of s must have the same length as x. The list of variables x must be a list of symbols, without subscripts. Even if there is only one symbol, x must be a list of one element, and each member of s must be a list of one element.

See also makelist.

(%i16) makeset (i/j, [i, j], [[1, a], [2, b], [3, c], [4, d]]);
                                  1  2  3  4
(%o16)                           {-, -, -, -}
                                  a  b  c  d
(%i17) S : {x, y, z}$

(%i18) S3 : cartesian_product (S, S, S);
(%o18) {[x, x, x], [x, x, y], [x, x, z], [x, y, x], [x, y, y], [x, y, z],
[x, z, x], [x, z, y], [x, z, z], [y, x, x], [y, x, y], [y, x, z], [y, y, x],
[y, y, y], [y, y, z], [y, z, x], [y, z, y], [y, z, z], [z, x, x], [z, x, y],
[z, x, z], [z, y, x], [z, y, y], [z, y, z], [z, z, x], [z, z, y], [z, z, z]}
(%i19) makeset (i + j + k, [i, j, k], S3);
(%o19) {3 x, 3 y, y + 2 x, 2 y + x, 3 z, z + 2 x, z + y + x, z + 2 y, 2 z + x,
                                                                       2 z + y}
(%i20) makeset (sin(x), [x], {[1], [2], [3]});
(%o20)                     {sin(1), sin(2), sin(3)}

moebius (n)
Represents the Moebius function.

When n is product of k distinct primes, moebius(n) simplifies to (−1) k; when n = 1, it simplifies to 1; and it simplifies to 0 for all other positive integers.

moebius distributes over equations, lists, matrices, and sets.

(%i22) moebius (1);
(%o22)                                 1
(%i23) moebius (2 * 3 * 5);
(%o23)                                - 1
(%i24) moebius (11 * 17 * 29 * 31);
(%o24)                                 1
(%i25) moebius (2^32);
(%o25)                                 0
(%i26) moebius (n);
(%o26)                            moebius(n)
(%i27) moebius (n = 12);
(%o27)                          moebius(n) = 0
(%i28) moebius ([11, 11 * 13, 11 * 13 * 15]);
(%o28)                            [- 1, 1, 1]
(%i29) moebius (matrix ([11, 12], [13, 14]));
                                  [ - 1  0 ]
(%o29)                            [        ]
                                  [ - 1  1 ]
(%i30) moebius ({21, 22, 23, 24});
(%o30)                            {- 1, 0, 1}

multinomial_coeff (a_1, ..., a_n)
multinomial_coeff ()
Returns the multinomial coefficient.

When each a_k is a nonnegative integer, the multinomial coefficient gives the number of ways of placing a_1 + ... + a_n distinct objects into n boxes with a_k elements in the k’th box. In general, multinomial_coeff (a_1, ..., a_n) evaluates to (a_1 + ... + a_n)!/(a_1! ... a_n!).

multinomial_coeff() (with no arguments) evaluates to 1.

minfactorial may be able to simplify the value returned by multinomial_coeff.

(%i31) multinomial_coeff (1, 2, x);
                                   (x + 3)!
(%o31)                             --------
                                     2 x!
(%i32) minfactorial (%);
                            (x + 1) (x + 2) (x + 3)
(%o32)                      -----------------------
(%i33) multinomial_coeff (-6, 2);

factorial: factorial of negative integer -6 not defined.
 -- an error. To debug this try: debugmode(true);

OOPS! diverso dal Reference 😐

Posta un commento o usa questo indirizzo per il trackback.



Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di

Stai commentando usando il tuo account Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.

%d blogger hanno fatto clic su Mi Piace per questo: