Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
144 views
ubuntu2204
Kernel: SageMath 10.1

Lista I

Zadanie 1.1


Wykonaj poniższe rachunki:

a.

[213102]+2[120341]\begin{equation*} \begin{bmatrix} 2 & -1 & 3 \\ 1 & 0 & 2 \end{bmatrix} + 2 \begin{bmatrix} 1 & -2 & 0 \\ -3 & 4 & -1 \end{bmatrix} \end{equation*}

b.

(2[021230]+[132312])[100120210]3[110021]\begin{equation*} \left( 2 \begin{bmatrix} 0 & -2 & 1 \\ 2 & -3 & 0 \end{bmatrix} + \begin{bmatrix} 1 & 3 \\ 2 & -3 \\ 1 & 2 \end{bmatrix}^{\top} \right) \begin{bmatrix} -1 & 0 & 0 \\ 1 & -2 & 0 \\ 2 & 1 & 0 \end{bmatrix}^{\top} -3 \begin{bmatrix} 1 & -1 & 0 \\ 0 & -2 & 1 \end{bmatrix} \end{equation*}
A=matrix(3,4,[3,5,6,0,-1,-4,8,0,-3,0,-2,3]) B=matrix(3,3,[0,-10,-7,-3,2,-1,7,-7,6]) C=matrix(3,3,[1,8,2,5,0,-1,1,1,2]) show(A,B,C)

(356014803023)(0107321776)(182501112)\displaystyle \left(\begin{array}{rrrr} 3 & 5 & 6 & 0 \\ -1 & -4 & 8 & 0 \\ -3 & 0 & -2 & 3 \end{array}\right) \left(\begin{array}{rrr} 0 & -10 & -7 \\ -3 & 2 & -1 \\ 7 & -7 & 6 \end{array}\right) \left(\begin{array}{rrr} 1 & 8 & 2 \\ 5 & 0 & -1 \\ 1 & 1 & 2 \end{array}\right)

C=C^3 D=5*B*C Xt=
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In [22], line 5 3 F=D*E 4 G=transpose(A) ----> 5 H=F*G 6 show(D,E,F,G)
File /ext/sage/10.1/src/sage/structure/element.pyx:3939, in sage.structure.element.Matrix.__mul__() 3937 3938 if BOTH_ARE_ELEMENT(cl): -> 3939 return coercion_model.bin_op(left, right, mul) 3940 3941 cdef long value
File /ext/sage/10.1/src/sage/structure/coerce.pyx:1269, in sage.structure.coerce.CoercionModel.bin_op() 1267 # We should really include the underlying error. 1268 # This causes so much headache. -> 1269 raise bin_op_exception(op, x, y) 1270 1271 cpdef canonical_coercion(self, x, y):
TypeError: unsupported operand parent(s) for *: 'Full MatrixSpace of 3 by 3 dense matrices over Integer Ring' and 'Full MatrixSpace of 4 by 3 dense matrices over Integer Ring'
H=F*G show(H)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In [21], line 1 ----> 1 H=F*G 2 show(H)
File /ext/sage/10.1/src/sage/structure/element.pyx:3939, in sage.structure.element.Matrix.__mul__() 3937 3938 if BOTH_ARE_ELEMENT(cl): -> 3939 return coercion_model.bin_op(left, right, mul) 3940 3941 cdef long value
File /ext/sage/10.1/src/sage/structure/coerce.pyx:1269, in sage.structure.coerce.CoercionModel.bin_op() 1267 # We should really include the underlying error. 1268 # This causes so much headache. -> 1269 raise bin_op_exception(op, x, y) 1270 1271 cpdef canonical_coercion(self, x, y):
TypeError: unsupported operand parent(s) for *: 'Full MatrixSpace of 3 by 3 dense matrices over Integer Ring' and 'Full MatrixSpace of 4 by 3 dense matrices over Integer Ring'

Zadanie 2.1


Znajdź macierz XX spełniajacą poniżesze równanie

a.

2X[221401]=[013213]\begin{equation*} 2X - \begin{bmatrix} -2 & 2 & -1 \\ 4 & 0 & 1 \end{bmatrix} = \begin{bmatrix} 0 & 1 & -3 \\ 2 & 1 & 3 \end{bmatrix} \end{equation*}
A=matrix(2,3,[-2,2,-1,4,0,1]) B=matrix(2,3,[0,1,-3,2,1,3]) C=B+A X=C/2 show(C,X)

(234614)(13223122)\displaystyle \left(\begin{array}{rrr} -2 & 3 & -4 \\ 6 & 1 & 4 \end{array}\right) \left(\begin{array}{rrr} -1 & \frac{3}{2} & -2 \\ 3 & \frac{1}{2} & 2 \end{array}\right)

Zadanie 3.1


Wyznaczyć rząd macierzy AA

a. A=[52814510003011241110100104121110014620111312113501112] \begin{equation*} A = \begin{bmatrix} 5 & 28 & 1 & 4 & -5 & 1 & 0 \\ 0 & 0 & -3 & 0 & -1 & 1 & -2 \\ 41 & 1 & 1 & 0 & -1 & 0 & 0 \\ 1 & 0 & 4 & -1 & 2 & -11 & 1 \\ 0 & 0 & -1 & 4 & -6 & -2 & 0 \\ 1 & -1 & 13 & 1 & -2 & 1 & 1 \\ -3 & -5 & 0 & -1 & 1 & -1 & 2 \end{bmatrix} \end{equation*}

Zadanie 4.1


Znajdź rozwiązanie układu:

i.

[1119287654][xyz]=[5101]\begin{bmatrix} 1 & 11 & 9 \\ 2 & 8 & 7 \\ 6 & 5 & 4 \end{bmatrix} \cdot \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 5 \\ 10 \\ 1 \end{bmatrix}
X = matrix(4,4,[1, 2, 10, 11,1/2, 3, 11, -1,-1, 1, -4, 12,14, 22, -3, 3]) Y = matrix(QQ, [[1, 2, 10], [2, 4, 20], [14, 22, -3]]) Z = matrix(QQ, [[1], [2], [-1]]) show(X,Y,Z)

(12101112311111412142233)(1210242014223)(121)\displaystyle \left(\begin{array}{rrrr} 1 & 2 & 10 & 11 \\ \frac{1}{2} & 3 & 11 & -1 \\ -1 & 1 & -4 & 12 \\ 14 & 22 & -3 & 3 \end{array}\right) \left(\begin{array}{rrr} 1 & 2 & 10 \\ 2 & 4 & 20 \\ 14 & 22 & -3 \end{array}\right) \left(\begin{array}{r} 1 \\ 2 \\ -1 \end{array}\right)

A=X.inverse() B=X**2 U = Y.augment(Z, subdivide=True) show(U)

(1210124202142231)\displaystyle \left(\begin{array}{rrr|r} 1 & 2 & 10 & 1 \\ 2 & 4 & 20 & 2 \\ 14 & 22 & -3 & -1 \end{array}\right)

Zadanie 4.2


Z podanego układu równań utwórz macierz uzupełnioną, sprowadź macierz uzupełnioną UU do postaci schodkowej. Znajdź rozwiązanie układu dowolną metodą.

a. {3x1+2x33x4=2x2+2x4+x5=0x1+x3+2x5=3 \begin{equation*} \begin{cases} 3 x_{1} + 2 x_{3} -3 x_{4} = 2 \\ x_{2} + 2 x_{4} + x_{5} = 0 \\ - x_{1} + x_{3} + 2 x_{5} = 3 \end{cases} \end{equation*}

Zadanie 4.3


Rozwiąż układ równań, podaj i narysuj interpretację geometryczną rozwiązania.

i. $$ x [21]\begin{bmatrix} 2 \\ 1 \end{bmatrix}

  • y [12]\begin{bmatrix} -1 \\ 2 \end{bmatrix} = [03]\begin{bmatrix} 0 \\ 3 \end{bmatrix} $$


Zadanie 5.1


Wykonaj następujące rachunki w odpowiednim ciele lub pierścieniu.

a. 3+4(mod5)3 + 4 \pmod{5} b. 24(mod5)2 \cdot 4 \pmod{5} c. 3+(24)(mod5)3 + \left( 2 \cdot 4 \right) \pmod{5} d. 411024(mod13)41^{1024} \pmod{13}

Zadanie 6.1


Oblicz iloczyn permutacji:

a.

(1234525314)(1234545213)\begin{pmatrix} 1 & 2 & 3 & 4 & 5 \\ 2 & 5 & 3 & 1 & 4 \end{pmatrix} \cdot \begin{pmatrix} 1 & 2 & 3 & 4 & 5 \\ 4 & 5 & 2 & 1 & 3 \end{pmatrix}

Zadanie 6


Wyznacz permutację odwrotną do permutacji σ\sigma:

a.

σ=(12344312)\sigma = \begin{pmatrix} 1 & 2 & 3 & 4 \\ 4 & 3 & 1 & 2 \end{pmatrix}

Zadanie 7


Określ parzystość permutacji σ\sigma

a. σ=(1234567835216487) \sigma = \begin{pmatrix} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ 3 & 5 & 2 & 1 & 6 & 4 & 8 & 7 \end{pmatrix}

Zadanie 8


Pokaż tabelkę dla wskazanego działania oraz obiektu. Sprawdź czy działanie jest przemienne.

i. (Z6,+)\left( \mathbb{Z}_{6}, + \right) ii. (Z6,)\left( \mathbb{Z}_{6}, \cdot \right) iii. LaTeX\LaTeX

Zadanie A


Wykonaj obliczenia dla algorytmu PageRank dla zadania z wykładu 1.

a=matrix(3,2,[0,-4,2,4,-6,0]) b=matrix(2,3,[1,3,2,-2,1,2]) c=matrix(3,3,[-1,1,2,0,-2,1,0,0,0]) d=matrix(2,3,[3,-3,0,0,6,3]) show(a+b)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In [3], line 6 3 c=matrix(Integer(3),Integer(3),[-Integer(1),Integer(1),Integer(2),Integer(0),-Integer(2),Integer(1),Integer(0),Integer(0),Integer(0)]) 4 d=matrix(Integer(2),Integer(3),[Integer(3),-Integer(3),Integer(0),Integer(0),Integer(6),Integer(3)]) ----> 6 show(a+b)
File /ext/sage/10.1/src/sage/structure/element.pyx:1226, in sage.structure.element.Element.__add__() 1224 # Left and right are Sage elements => use coercion model 1225 if BOTH_ARE_ELEMENT(cl): -> 1226 return coercion_model.bin_op(left, right, add) 1227 1228 cdef long value
File /ext/sage/10.1/src/sage/structure/coerce.pyx:1269, in sage.structure.coerce.CoercionModel.bin_op() 1267 # We should really include the underlying error. 1268 # This causes so much headache. -> 1269 raise bin_op_exception(op, x, y) 1270 1271 cpdef canonical_coercion(self, x, y):
TypeError: unsupported operand parent(s) for +: 'Full MatrixSpace of 3 by 2 dense matrices over Integer Ring' and 'Full MatrixSpace of 2 by 3 dense matrices over Integer Ring'