Documentos de Académico
Documentos de Profesional
Documentos de Cultura
“Magma”
1/4
Magma - 6
2/4
Magma - 6
Problemas.
1. Respuesta. El programa pedido es el siguiente.
> I := IdentityMatrix(Rationals(),3);
> ro := Set(Rows(I));
> [Eigenvalues(Matrix(p)) : p in Permutations(ro)];
[
{ <-1, 1>, <1, 2> },
{ <1, 1> },
{ <-1, 1>, <1, 2> },
{ <-1, 1>, <1, 2> },
{ <1, 1> },
{ <1, 3> }
]
3/4
Magma - 6
Problemas.
2. Respuesta. La función pedida es la siguiente.
sign := function(M)
N := Matrix(RealField(),M);
L1 := [p[2] : p in Eigenvalues(N) | p[1] gt 0];
L2 := [p[2] : p in Eigenvalues(N) | p[1] lt 0];
if #L1 eq 0 then n1 := 0; else n1 := &+L1; end if;
if #L2 eq 0 then n2 := 0; else n2 := &+L2; end if;
return [n1,n2];
end function;
4/4