Basic Algebra Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Calculate the magnitude(lenght) of a vector! How in math and how with numpy shortcut?

A

Squareroot of: a12 + an2

numpy: from numpy import linalg as LA
LA.norm(vectorname)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to calculate the distance between two vectors? How in math and how in numpy?

A

Squareroot of: (q1-p1)2 + (q2-p2)2

LA.norm(a-b)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How are matrices represented in Python. Are they for example a list?

How matrcies are created in numpy?

A

It is represented as a list in a list with a list being a row
A=[ [8,8,8,]
[7,7,7]
[6,5,3] ]

you use arrays.
l = np.arrange(9)
[0,1,2,3,4,5,6,7,8]
l.reshape(3,3)

[ [0,1,2,]
[3,4,5]
[6,7,8] ]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a n x k matrix?

A

A matrix which has n rows and k columns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly