#linear-algebra
2 messages Ā· Page 298 of 1
Both sided invertible? š
how can i go from rank(A) = n to injective
with the transformation T
epic/monic
this is only true if m = n, gta
rank nullity
Isn't the def of an inverse AB=BA=In?...
if m < n, you cannot have rank n
Why would it matter
and if m > n, you have a nontrivial kernel
if m > n, it is injective
you need to rework this part
If we multiply by the inv from the right or the left
so may ppl so may topic lol
wait how?
what size is your matrix
that's the dim of B

okay then how do we go from injective to at least one left inverse
i read some answers online but i just got confused
I can give one informal construction
you can find a nxn matrix (say B') from im(A) -> R^n s.t. B'A = Id, now extend the rows till they have length m
how would you do it in a formal proof
well your (A'A)^-1 A' is a left inverse
just show (A'A) is invertible when rankA = n
<@&286206848099549185> 4b?
my solution: let $e_1,\dots,e_m$ be an orthonormal basis of $V$ with respect to $\langle \cdot, \cdot\rangle_1$. then we have
$$\langle v,w\rangle_1 = \sum a_jb_j$$
and
$$\langle v,w\rangle_2 = \sum a_jb_j |e_j|_2^2$$
now to show every $|e_j|_2$ is the same I derive a contradiction assuming they're different (i.e. if the sum is weighted I construct v,w such that the inner products disagree on orthogonality, which they can't). but this feels like an ugly solution and doesn't give insight. can anyone think of something better?
uli
why would <.,.>_1 = sum ...
It doesn't even say that the spaces are finite dimensional
they are
Nor does it say that your inner product is the dot product
with an orthonormal basis it becomes the dot product
It could very well be u^T M u
depends on how they pick it
They can plug in any symmetric positive definite form
I think you should use only what they provide
ok I'll try without assuming finite-dim, the section is "orthonormal bases" and all the other exercises assume finite-dim so I guess I assumed it
my point is not about finite dim
It's fine if they say it's finite dim
What isn't fine is you writing it as sum_i a_ib_i
it's correct because $\langle e_j, e_j\rangle_1 = 1$
uli
the second one is the one that might be weighted (though you can show it's not)
the following is a perfectly valid inner product <u,v> = u^T G v
I know
G positive definite
we wrote $v = \sum a_j e_j$ and $w = \sum b_j e_j$ so $\langle v,w\rangle_1 = \sum a_jb_j$
expand it out
uli
They never define <v,w>_1 = \sum_i a_i b_i
that isn't a definition it's a consequence oml
a consequence of what
$$
\langle v, w\rangle_1 = \sum_i \sum_j a_jb_j\langle e_i, e_j\rangle
$$
uli
and the orthonormality of $e_i$
uli
^ they never define it like this
I defined e_i
I can define an inner product in an orthonormal basis that includes a non-identity matrix
the orthonormal basis is picked with respect to <*, *>1
So you picked the basis G^{-1/2}?
I'm considering the inner product space (V, <*, *>_1)
we aren't dealing with matrices here just linear maps
yeah I guess, I'm not very familiar with the matrix definition of inner products
but ok, I am starting to get what you mean
anyway the thing I was asking was is there a nice way to show $|e_k|_2 = |e_j|_2$
uli
the way I showed it was assume $|e_k|_2 \ne |e_j|_2$ then exploit the unequal weighting to find $v,w$ such that $\langle v,w\rangle_1 = 0$ and $\langle v,w\rangle_2 \ne 0$ (a contradiction)
uli
we haven't defined matrix sqrts or the matrix defn of inner products btw, though i'd be happy to hear a proof in that form if its intuitive
in matrix form I think the exercise would be: given that $x^TAy = 0$ if and only if $x^TBy = 0$ (where $A,B$ are positive definite) show that $A = cB$ for some scalar $c$
uli
x'(A-B)y=0
you plug in x,y the basis vecs
And you get the entries
Up to a multiplicative factor
^
wait, does that work

it leads to the same thing I ended up with I think
this was kinda silly question its intuitive enough as it is that an unequal weighting implies you can make one zero and the other not
consider orthonormal basis wrt A
I still think there should be a much simpler way
you get that the orthonormal basis is also a orthogonal basis of B, not necessarily of unit length
ooh
I had an idea
define a third inner product $\langle v,w\rangle_3 = \langle v,w\rangle_1 - \langle v,w\rangle_2$
uli
Afaik |ej|^2 = |ek|^2 wrt <>_2 is not true,is it?
Yeah so this doesn't work
that we have to prove separately
I was thinking more along the lines of {v}^{perp} = {w : <v,w>_1 =0 } = { w: <v,w>_2 = 0}
i.e. the orthogonal complement to the span of v wrt both inner products is the same
And any vector can then be decomposed in this
I didn't think of how to continue this though
It should use somewhere that it's for every v
oh wait I'm dumb
In order to get that the constant is tge same
idk how that helps you
true
I mean you could fix one of v,w then apply it to write both in terms of the same norm
it still assumes finite dim though (which is probably correct tho it spooks me he doesn't mention it since he usually does)
you can get $\langle v, w\rangle_1 = \langle v, u\rangle_2$ for all $w \in V$ using Riesz
uli
say v1,..,vn orthonormal basis wrt A the these are orthogonal wrt B so a basis. now say Bv1 = ā ci vi then v1'Bv1 = c1
You can try to pick v1,v2 such that <v1,w>_1 = c1<v1,w>_2 and <v2,w>_1 = c2 <v2,w>_2
And assume c1!= c2
Once you decompose v2 into a part parallel to v1 and orthogonal you can probably get a contradiction
let v2'Bv2=c2 similarly then v1'(Bv2-c1v2)=0
I think the key is that the orthogonal complements to the span of v are the same
aah can't type
Does the following work @gritty swift
Let <v1,w>_1 = c1 <v1, w>_2 and <v2,w>_1=c2<v2,w>_2
from this you have
<v1,v2>_1 = c1<v1,v2>_2 and <v2,v1>_1 = c2<v2,v1>_2 -> c1 = c2
from symmetry of the inner product
For the <v1,w>_1 = c1<v1,w>_2 part I think it suffices that you take a basis with 1 of the vectors being v1
And the others being in the orthogonal complement
it seems like it does
that's a more elegant way of showing it without a contradiction
you get <v1,v2>_1 = c1<v1,v2> from setting w=v2 and the other one from setting w=v1 right (the first line was for all w)
yes
yep I think it works nice
ooh true so it works in infinite dim
Idk about inf
you never assumed you had a spanning list so it should extend
This may or may not break for inf, idk
I mean you're setting c1 = <v1,w>_1 / <v1,w>_2
Yes, but you have to show that it is a unique c1 for any w
which you should be able to do through picking a basis with v1 being 1 of the vectors
And the rest being in the orthogonal complement
So w gets decomposed in these two parts
The orthogonal part resulting in 0
yeah makes sense
I haven't worked out the details though, there may be something missing
guys if you have a linear function and a linear transformation from V ->V.
Is a set of linear independent lets call them (v1,v2,...,vn) still linear indepedent in the field.
(f(v1),f(v2),.....,f(vn))
depends on f
so if f is bijective
I assumed yes.
If f is not bijective its clear for me why it woulnt be the case.
Yes if f is bijective it's all good
Aight thanks Glados
You're welcome
You can use f(sum_i a_i v_i) = f(0) -> sum_i a_i f(v_i) = f(0) = 0
Vectors are lin indep if this holds only for (a1,...,an) = (0,...,0)
So the only way those can become linearly dependent is if f's kernel is nontivial
Because then let b != 0 be a vector from the kernel, and there exists (a1,...,an) != (0,...,0) such that b = \sum_i a_i v_i
But f(sum_i a_i v_i) = sum_i a_i f(v_i) = f(b) = 0
So by definition f(v1),...,f(vn) are then lin dependent
To be more specific, any vector that is in the kernel would become linearly dependent after the map since it goes to 0
Lin indep vectors not in the kernel are mapped to lin indep vectors
i tried using the fact that A^k v = lamda^k v = 0 then lamda = 0
perfect thank you
just making sure, linearly independent subset here means that all vectors in the subset are linearly independent right?
means that the vectors from S1 are linearly independent from S2, S3, ... Sk
and the union of all of them is a subset of linearly independent vectors of V
Can someone provide a straightforward proof for b) preferrably using latex?(I'm checking my solutions)
$(C^TA^T){ij} = \sum_k (C)^T{ik} (A)^T_{kj} = \sum_k C_{ki}A_{jk} = \sum_k A_{jk}C_{ki} = (AC){ji} = (AC)^T{ij}$
criver
hi guys i have an exam tomorrow and a really fast question about linear algebra
can someone come voice with me for a minute or two?
really don't know how to type that in the web
I'd still suggest to try and write it
Oh thank you so much! This is basically what I wrote but I thought the dimensions of A and C would make a difference(e.g. the upper bound of sum)
How so?
The multiplication is defined only if the inner dimension matches
so it's safe to omit it
Now I got it, thank you.
The only thing I can think of to avoid any confusion is to write (D)^T_{ij} as (D^T)_{ij} instead, but I think it's understandable even as I wrote it
$V$ and $W$ are two finite dimensional vector spaces, $dim V = n, dim W = m$. Could somebody help me understand why $dim \mathcal{L}(V, W) = n \cdot m$? My textbook gives a proof, but no intuition behind it.
mate
the set of all linear transformations from $V$ to $W$
mate
theres a correspondence between linear maps V->W and mxn matrices
so the dim of the latter gives the dim of the former
probably just a little unnecessary nitpick, but why is this proof distinguishing between n_i and d_i as if they arenāt equal?
n_i = number of vectors in the ordered basis for E_{lambda_i}, d_i = dim(E_{lambda_i})
they aren't
they haven't assumed the hypotheses of part (b) yet, they've only assumed that T is diagonalizable
they're defining \beta_i here using the same notation as part (b), but they're only proving (a)
š
i read it a bit more in depth (at least i think), only paying attention to the stuff from (a), and i still donāt see how those two arenāt equal
i mean, B_i is very obviously a basis for E_{lambda_i}
why
well, E_{lambda_i} is a subspace of V, so there must be some subset of the set of basis vectors that generate E_{lambda_i}
i'm not convinced
{(1, 0), (0, 1)} is a basis of R^2, but no subset of it generates, say, the line y = x
how can i prove that for a matrix A and orthogonal matrix B, |AB|F = |A|F
so prove that the frobenius norm of AB equals the frobenius norm of A
if you multiply two symmetric matrix, is the end result also symmetric?
only if they commute
this is sqrt trace(A^TA) or something like that, right?
that might help
what does that mean
AB = BA
we dont use trace it was never discussed
otherwise yeah it would be simple
maybe try studying B^tA^t instead and use that B^t, being an orthogonal matrix, should preserve the Euclidean norm of the columns of A^t
then relate that to the Frobenius norm
yeah thats what im trying right now

I think it follows more or less by definition
since the Frobenius norm is just the Euclidean norm on R^{n^2}
for all n?
yeah for n x n matrices
just write the sum in the definition carefully and use this
so for UC = [UC1 UC2 ... UCn] are C1 ... Cn the columns or rows of C
could anyone help with this?
for the other questions, they were all based in \mathbb{R}^n so i could either create a matrix with the given vectors
and try putting it into rref
to see if it is generating or not
but i don't understand how to work with a space like $\mathbb{P}_3$
sean
Ok so if you were in Rāæ, lets say R², how many vectors are needed (at a minimum) to create a spanning set?
2
yep
yes, the space of polynomials of degree at most 3
but the dimension is kinda unclear to me, since the standard basis of the space is 1, x, x^2, x^3
so does that mean its dimension is 4?
What is the definition of dimension?
(and yes its 4)
The dimension of vector space V is the number of vectors in a basis for V
this actually hasn't come up yet in my book
thats the next section
this section is about analyzing the pivots of a matrix in echelon form
so i assume i have to compose some matrix or something to deduce if it is generating or not
,rotate
oh
matrices 
so its just hte number of vectors in its basis?
yes
you could make a matrix of the three polynomials and row-reduce them, no?
the thing is, thats what i'm confused about
do i represent these polynomials as vectors somehow?
the coefficients yes
ax^0 + bx^1 + cx^2 + dx^3
(using the ordered basis of the standard p3 basis)
so for example $x^3 +2x$ is equivalent to the matrix $\begin{pmatrix} 0 \ 2 \ 0 \ 1 \end{pmatrix}$
so x^3 + 2x would be 0 2 0 1
i dont think u want them as columns
but its been a while since i've done raw matrix comps
pretty sure it's as rows
then you perform elementary row operations on the rows to row-reduce to echelon form
sean
ye
anamono would have to probably verify; but I think u put all 3 coefficient entries as rows in the matrix and row reduce; but you wont get the identity since u dont have 4 rows
how do i combine them into one single matrix though? before, i was just putting the given vectors as the columns of a matrix A
^ do this
i dont think you need to have identity, you just show they're linear independent right?
yeah
i forgot condition for span
this thing i'm reading has column vectors
yeah i got that covered from my notes
wait one thing i'm still unsure about is why its a row vector this time
when working in $\mathbb{R}^n$
hmm
sean
i row reduce my matrices when i construct vectors in rows
i wonder if it's something different for columns?
they were $n\times 1$ column vectors
or something im just forgetting
sean
this thing used columns tho
yeah for example, here i just stuffed the four vectors into a matrix so it became $\begin{pmatrix} 1 \ 1 \ 0 \ 0 \ 1 \ 0 \ 0 \ 1 \ 0 \ 1 \ 1 \ 0 \ 0 \ 0 \ 1 \ 1 \end{pmatrix}$
sean
but that only shows linear independence in that example not span
but yeah probably that matrix
for 3.2
this thing claims u need a 1 in every row
so since ur last row on the P3 problem would be 0s its not spanning
i can show that a system of vectors is spanning and/or linearly independent easily
but
i just need the matrix
to represent that system
so my confusion here is: why are these polynomials represented as row vectors here? whats different in $\mathbb{P}_3$ compared to $\mathbb{R}^4$
sean
i think we were just wrong about how to enter them into the matrix
so i think u do make them column vectors
so it'd be 4x3
(4 rows, 3 col)
got it
so they're linearly independent but don't span because the last row doesn't have a pivot
and im pretty sure 3.2 row reduces to the identity
so that would be linearly independent and span; hence a basis
yup
i got that as well
since theres a pivot in each column
they're linearly independent
alright thank you, that was a big help
i'm only 90% sure on this stuff
and i think having pivots in the rows means spans
but idk
yeah it does
from my brief research
pivot in every row = generating (spanning)
Well, I'm new at this, I wanted someone to help me with a question, but seems like it's not going to happen yet, then, can someone tell me please how to solve this or where to find information to solve this?
gaussian elimination or reduced row echelon form with an augmented matrix are some keywords to help you get started
could someone explain to me why $\Bar{v}^T v = ||v||^2$ where v is some non-zero vector
Crown
it works for v = 0 too, so...
the standard norm on $\bC^n$ is $\nrm{v} = \sqrt{\sum_{k=1}^n |v_k|^2} = \sqrt{\sum_{k=1}^n \overline{v_k} v_k}$
Ann
So I've just gone over the section on eigenvalues and linear transformations and I have few questions.
Let T be a transformation from V to V and B be a basis of V. The book defined a B-matrix of T, but I don't seem to understand what the use of it is. Is it just so that we can represent any linear transformation on general vector spaces as a matrix, so as to have a systematic way of computing T(x) by first finding the B-coordinate vector of x, then multiplying by the B-matrix of T, then by converting back the B-coordinate vector of T(x)?
Also, they also discussed how if T is a linear transformation from R^n to R^n with standard matrix A, then if A is diagonalizable, then the B-matrix of T is diagonal, where B is the eigenvector basis given by A. What is the practical significance of this? Is it just saying that if we choose to work in the eigenvector basis that the effect of the transformation is the simplest?
The book defined a B-matrix of T, but I don't seem to understand what the use of it is. Is it just so that we can represent any linear transformation on general vector spaces as a matrix?
that's the idea, yes, at least as long as the vector space is finite-dimensional. representing transformations as matrices has its applications (if you've taken calculus, you may be familiar with the Jacobian matrix of a linear function, which tells you information about its local rate of change)
and being able to do that wrt a basis is essentially the way we "compensate for different coordinate systems"
What is the practical significance of this? Is it just saying that if we choose to work in the eigenvector basis that the effect of the transformation is the simplest?
essentially.
Hm, interesting. I don't fully get it yet, but I'll let it sit for a bit.
Thanks for the info regardless!
isn't linear algebra about things like slope-intercept form and whatever
no it isn't
read the pins
^
addendum: knowing that the eigenbasis always gives us a diagonal matrix is useful for decomposing matrices (we call it the "eigendecomposition")
there are various numerical reasons why decomposing matrices is useful
and this result (at least over ā or ā) eventually generalizes into the spectral theorem
Ah.
it's just one of many canonical ways to factorize a matrix
but if you happen to know the eigenvectors, or can easily compute them, it's a very convenient one
(and also the simplest)
Interesting how there's so many different factorizations with their own uses, like LU, PDP^-1, QR and SVD.
SVD is kind of like an eigendecomposition in that the principle is still trying to find "directions" (ie eigenvector coordinate systems) where the matrix "acts as a scalar"
I haven't learnt SVD yet. Maybe I'll understand when I get there.
on a more elementary level, this fact just gives you another way to think about diagonalizability
OK, I kinda get the ideas now. Thanks a bunch. The state of simultaneously understanding and not understanding is weird.
diagonalizability means that there exists an eigenbasis such that the matrix in that eigenbasis is diagonal
in other words, there exists a "coordinate system" that makes the matrix act "scalar" within that coordinate system
this isnt the most useful intuition like, computationally
but hopefully it makes "diagonalizable" seem a bit less... obscure
Ah, that does make sense.
"it's possible to simplify this transformation's action if we change how we measure"
whereas nondiagonalizable matrices are just fucked
and dont permit a nice simplification
I just understood diagonalizability as something that allows us to compute high powers easily.
"linear"? you mean like coordinatewise scaling maybe?
And this makes sense because repeated actions of multiplication would just be scaling, linking to my previous intuition.
essentially
you dont need to worry too much about the details here, it admittedly gets quite dense in definitions and computations
i find that that's when it takes longest for this stuff to set in
if it's just definitions i can parse that
if it's just computations i can see what the computations are doing
but eigenstuff and diagonalization involves both
so it takes a bit of practice to see the lines
you'll get the hang of it as you work at it
Yeah, I just wanted at least some understanding of why we bother with finding B-matrices of T and I've got that now, so I'm good. Thanks mate!
I have a matrix u of size 3x12. The [x,y] values represent the coordinates of the lamps, [z] represents the height of the lamps. The equation for lightning each lamp, is lightning = x/d², where [d] is the distance from the lamp to the center of a matrix A of size 20x30. I want the lightning of each lamp to be as close to 1 as possible using the gram-Schmidt process and singular value decomposition. Does anyone have a clue? Please send help
wym by "distance from the lamp to the center of a matrix A of size 20x30"?
or maybe someone can help me understand the question:
It is desired that the lighting level be as close as possible to 1.0 in all
squares. Use the least squares method to determine in python the brightness of each lamp using (i) šš
-decomposition via enhanced Gram-Schmidt, respectively. (ii) SVD decomposition.
because I am having difficulties understanding what they want and how to do it
I have a matrix of size 20x30 and xy are the coordinates of the lamps in that matrix
how's this 20x30 then?
then for instance the center of that matrix is xc=10, yc=15, if I have a lamp with coordinates for instance [4,20],
and that lamp has a height of z=8
then I have a distnace from [4,20,8] to [10,15,0]
thank you. can we explain it without m by n matrices?
yes, just find a basis of the former space
someone help me
1.The distance between (2, -1) and (3,y) is 1. Find the value of y.
how do I do this one?
do you know of any formulas for how to find the distance between two points?
this barely qualifies as linear algebra 
can no one help me or throw me a bone 
A parking space of 20m Ć 30m is illuminated via lamps placed in different places and at different heights, as indicated in Figure 1 page 3. The parking space is divided into a rectangular grid of 600 squares each of size 1m Ć 1m. The number š¦š indicates the illumination level squared š, for š = 0,. . . , 599. Let š„š indicates the strength of lamp š. We select units so that the contribution to the lighting in square š from lamp š is š„š / š2 šš, where ššš is the distance in ā3 from the lamp to the center of square š.
(a) State how the illumination level š¦ = (š¦0,..., š¦599) and the powers š„ = (š„0,..., š„11) are related via a linear equation system. Set the coefficient matrix for the system in python.
(b) Make a heatplot showing the illumination level in each square when all lamps are lit with intensity š„š = 20.0.
(c) It is desired that the illumination level be as close as possible to 1.0 in all squares. Use the least squares method to determine in python the brightness of each lamp using (i) šš -decomposition via enhanced Gram-Schmidt, respectively. (ii) SVD decomposition.
I have done a and b
(I think)
but I dont know how to solve c)
this is the figure
can someone throw me a hint or help me understand what to do
the part that takes effort is setting up the system of equations here
I dont understand this "(c) It is desired that the illumination level be as close as possible to 1.0 in all squares. Use the least squares method to determine in python the brightness of each lamp using (i) šš -decomposition via enhanced Gram-Schmidt, respectively. (ii) SVD decomposition."
so, basically what you want is to set up a cost function to minimize
you have an ideal "lighting", let's say, which is a vector with 600 entries that are all 1
on the other hand, you have the actual lighting, which is given by some f:R^number of lamps -> R^600
(assuming you keep the intensities x_i fixed)
no, 600 squares you want to illuminate
oh yeah, that's a lot easier and sensible lol, i misread
there, fixed
so what you want is the sum of intensities at each square to equal 1
i.e. $J_m = \sum_{n=1}^{12} x_n/d_{nm}$
Edd
this is the lighting at the mth square, where d_nm is the distance from each lamp to that square and x_n are the intensities of the lamps
i guess in your image you count from n=0 to n=11, but that makes no difference
what you have to consider is that the lamps are already placed and cannot be moved
this means 1/dnm is a constant
the variables are the x_n
with that in mind, you can notice that the sum can be rewritten as a dot product
1/dnm varies from lamp to lamp
let's say the distances from all lamps to the square m are put into a vector $\boldsymbol{d_m} \in \mathbb{R}^{12}$, and similarly, the unknown intensities are put into a vector $\boldsymbol{x} \in \mathbb{R}^{12}$
Edd
it does, but the quantities are fixed
you won't change them
each dnm is indeed unique, but also constant
now we notice that $J_m = \sum_{n=1}^{12} x_n/d_{nm} = \boldsymbol{d_m}^T \boldsymbol{x}$
Edd
and we want $1 = \boldsymbol{d_m}^T \boldsymbol{x}$
Edd
we notice we have exactly 600 of these equations, since there are 600 squares
we can set each d_m^T vector as a row in a matrix D. (btw in case it wasn't clear from the notation, the entries in each d_m vector are reciprocal distances, not just the distances)
this now gives us the matrix equation $\boldsymbol{1} = \boldsymbol{Dx}$, with $\boldsymbol{1} \in \mathbb{R}^{600}$ and $\boldsymbol{D}^{600 \times 12}$
Edd
now you want to solve this exactly if possible, or approximate it if not
so your goal is to solve $\min_{\boldsymbol{x}} \Vert \boldsymbol{1} - \boldsymbol{Dx} \Vert_2^2$
boldsymbolx
yes.
Edd
then we notice this is a linear least squares problem, which is convex (and strictly so if D has full column rank). this means you can take the gradient and set it to 0, then solve for x
that will give you a (possibly unique) global minimizer
if you have questions about this, it probably means you had parts a and b wrong
btw @broken notch if you could share screenshots of the original problem with me, i would appreciate it. seems like a cute problem to have my students practice their python
the problem is in a diff language
which language
danish

hmm nah, i think with the images and the description you already gave, it would be ok
there are only two problems left
d and e
@lavish jewel 1.-Each row in D is a vector dm^T *x where dm= 1/dmn and x is the intensity vector, in our case is x=[0,1,2,3,4....11], right?
each row in D is only a vector dm^T, without the x
we don't know what x is, and we solve for it
2.-I don't understand how to solve min x||1-Dx||^2
how do I apply gram-Schmidt and sdv to solve the problem?
well, from the other stuff i mentioned, you can take the gradient and set it to 0
the gradient would be D^T (1 - Dx)
or in other words, D^T 1 = D^T D x
and, for example if D^T D x is invertible, you get that x = (D^T D)^-1 D^T 1, which you should recognize as the solution to a least squares problem
(or well, even if not invertible, you can use the SVD method to get a projection onto the row space)
In practice I use a CGNR or LSQR solver for this, but they are specifically asking for svd and QR here. Also the matrix seems to be dense.
To be physically correct they should use the squared distance too because of inverse square law but whatever.
Just fyi:
$\min_x |Dx - b| \implies D^TD x = D^T b$
criver
The equations D^TDx = D^Tb are called the normal equations
how can i use x to apply the svd and the gram-schmidt?
you can google normal equations and you'll get a lot of info
You need do apply QR and SVD to the system matrix D^TD
The right-hand side is y = D^T 1
Having the svd you can compute (D^TD)^{-1}
Similarly having QR you can solve
QRx = y -> Rx = Q^T y
The Rx part is solved as you do triangular matrices (it's sequential)
y = D^T 1 what is 1 here
a vector with 600 1s
is this homework or did you just look it up?
i think you're missing a few things before you're able to solve it
homework
have you seen least squares in class?
a little
I will read up on it again
it should be like this q,s,vt = svd(D^TD), right then we use (q)^-1 D^T =x, right?
@lavish jewel
it is the same with q,r = qr(D^TD), the we use (q)^-1 D^T =x, right?
i don't think that's right
For svd you should get U, S, V such that D^TD = U S V^T
Then (D^TD)^{-1} = V S^{-1} U^T
then x = (D^TD)^{-1} D^T 1
For QR I already explained what you should do
you'll have to check how python returns the S matrix. i seem to recall that, by default, it provides a full SVD and S is a vector
i.e. it might contain zeros you need to remove, and then turn it into a matrix
and possibly truncate the columns of U and rows of V^T
that's more annoying to do than truncating
He'll get zeroes if this is a rank-deficient D
i.e. if there is no unique solution
then the reciproc gives the pseudo-inverse
i'm just saying that doing it this way requires you to iterate over the elements of S
whereas truncating is done by reference and without iteration
it's better practice for larger problems
idk what by reference and without iter means
If it's slow it would be because one coded it slow
that's exactly what i am telling you
if you mean that you do some redundant ops because of 0s, sure, but that's definitely not the bottleneck in an svd
depends on the problem
you're adding an O(n) problem on top of the O(n^3) one
the behavior is surely dominated by that of the O(n^3) SVD and matrix multiplications, but the delay is there
for instance I work with problems where some redundancy is better since it allows more efficient parallelization, but that's way out of scope for the current question
yeah that doesn't make a difference here
tbf, I think the person asking has an issue even with the simpler case
sure, they need a way to find the inverse in the first place, given the output of the svd function
And I would never use svd in practice for the above problem
CGNR/LSQR or Cholesky rather
that's fine, but they are explicitly asked to use it
Yeah, I meant wrt the perf comment
Let $A$ be a bijective linear transformation from $V$ to $W$ and span $(a_1, a_2, \dots a_n) \leq V$. Why $dim A $span $(a_1, a_2, \dots a_n) = dim$ span $(A(a_1), A(a_2) \dots A(a_3))$?
sorry have no idea how to format this correctly.
mate
because A(span(...)) = span(A(...))
or are you asking why dim span (...) = dim span (A(...))
because the map is bijective
Let (v1,...,vm) be a basis for span(a1,...,an)
by the definition of basis these vectors will be linearly indepedent
which means that sum_i b_i v_i = 0 only for (b1,...,bm) = (0,...,0)
now assume that A(v1), ..., A(vm) were linearly dependent
then there would exist (b1,...,bm) such that sum_i bi A(vi) = A(sum_i bi vi)
but if A is bijective, then it is injective, and then A has a trivial kernel
so you get a contradiction and it follows that dim(span(v1,...,vm)) = dim(span(A(v1),...,A(vm))
thank you. i dont understand how did you get a contradiction, could you repeat please?
im lost after "then there would"
but i do understand why A injective iff A has a trivial kernel
there'd be a contradiction because at least one of the b_i's should be non-zero
and that sum should be equal to zero
that's where you get to use injectivity

Does a linear transformation T : VāW transforms V's basis to a W's basis ? Or there are any extra conditions ?
not necessarily, take the zero transformation
a necessary and sufficient condition is that T be an isomorphism
comes directly from $Dx = \text{P}_U(b)$, where $U$ is the column space of $D$ right?
koala
i think this is the more "intuitive" version
Sorry I'm not familiar with isomorphism of linear transformations
bijective linear transformation
what is with the little leaf next to your name @wintry steppe ?
this is a nonogram, its a puzzle in which the numbers on each line represent how many blocks of continuous shaded pixels exist. There must be a white in between every blue "segment". When i go about solving them. Normally i solve them by thinking "hmm, 6 will need its middle 4 blocks colored no matter what so ill do that, then according to this column, that has to be a 1 so it should be white above and below" and so on...
But this feels like linear dependence and something to do with linear algebra, i just cant quite figure out how to apply it to solving these
this is a binary matrix, and im trying to figure out how to solve it mathmatically
my reasoning for wanting to figure this out, is that im building an operating system and this may be a better way of storing black and white photos
It comes from taking the derivative wrt x and setting it to zero
Which gives you an equation for the stationary points
There are research papers on this and it's far from trivial
I would instead suggest to use a readily available codec fir black and white images
ah okay yeah that too
i mean the projection is equivalent as well right?
ill try to show this
That's how you derive it
afaik you define the projection either through the x minimizing the L2 or as the x such that the error is orthogonal
the latter is typically called Galerkin formulation/condition
Can anyone explain linear subspaces to me?....
Specifically how you can prove that a given set is a subset of R^n
There's 3 ways and i only understand the first one
- using the def of a subset (that i understand)
- smthng related to homogeneous linear systems
- smthng related to the span of smthng
For 3, the span of any subset of vectors in $\mathbb{R}^n$ is automatically a subspace of $\mathbb{R}^n$
makatk
I'm assuming by "subset" you mean "subspace"? These are different terms though so you shouldn't conflate the two. Here's what I think you mean by your "three ways". These are three equivalent definitions.
-
A subspace (of the vector space $R^n$ ) is a subset of $R^n$ which is closed under linear combinations (if $v_1, \dots , v_k$ are in the subspace, then $a_1 v_1 + \dotsm + a_n v_n$ is in the subspace, where the ai's are real numbers (scalars) ).
-
A subspace is a set of solutions to a system of linear equations: ${x=(x^1,\dots,x^n) \in R^n ~,~ f_1(x) = 0,~ \dots,~ f_k(x)=0 }$, where the $f_i$'s are linear functions $R^n \to R$, i.e. of the form $f_i(x) = a_{i1}x^1 + \dotsm + a_{in}x^n$. The above set will specify a subspace of dimension $n-k$.
-
A subspace is the "span" of a collection of vectors, where span means take the set of all linear combinations. This is nearly the same as my first definition.
KS
Going through my lin alg textbook and I wanted to show a cool proof I did
The first paragraph is the question
Wyatt The Baguette
oh lol i just had this problem in an assignment
iirc the intuition was "S is an isometry so S* = S^-1 so its just a change of basis"
not sure if this is exactly "linear" algebra, but would anyone know a way to solve the following problem without brute force?
ā ā ā ā
ā1 1 1 0ā ā1ā
ā0 1 1 1ā x = ā2ā
ā ā ā ā
where x_i ā {0, 1}
``` alternatively, if there is a better channel to post this in, please redirect me
could anyone help me fix up this proof?
i'm pretty sure the first two paragraphs are correct (i hope)
but
idk how to prove that if dim V = dim W, V=W
i feel like something needs to be added in that space i have put
but idk what
maybe my approach itself was incorrect
ill look through mse to see if i can find anything
(0,0,1,1) and (0,1,0,1)
Think of that as solving
x_1(1,0) + x_2(1,1) + x_3 (1,1) + x_4 (0,1) =(1,2)
You need the first co ordinate to be 1 so only one of x_1 ,x_2 or x_3 should be 1
You need the 2nd co ordinate to be 2 so exactly 2 out of x_2 ,x_3 or x_4 has to be 1
If you choose x_1 to be 1 you find you don't have a solution
yeah but wouldnt that amount to brute forcing?
This is how I'd prove this: assume $V \neq W$ then $\exists w \in W$ and $ w \not\in V $ then say ${v_1,...,v_n}$ is a basis for $V$ then we also have that ${v_1,...,v_n,w}$ is linearly independent, else $w$ is in $V$, but we have an inequality given a linearly independent set of vectors in a vector space $W$ that is is less than or equal,
$|{v_1,...,v_n,w}| \leq dim(W)$ but if $dim(W) = dim(V) = n$ we would have $n+1 \leq n$ which is not possible, hence there can be no such $w$ and hence they must be equal.
would distinct here mean that each eigenvalue of A has multiplicity 1?
holazach
no it just means no $\lambda_i = \lambda_j$ unless $i = j$
holazach
oh ok thanks, just making sure
no problemo
aren't those two things the same? 
huh
the algebraic multiplicity is the power k so that (lambda - lambda_i)^k divides the char poly
if all of the eigenvalues are different, they have multiplicity 1
I interpret statements like that as say the characteristic polynomial is $(\lambda - \lambda_1)^2(\lambda - \lambda_2)$ then the distinct eigenvalues are $\lambda_1, \lambda_2$ whereas you might say the eigenvalues are $\lambda_1, \lambda_1, \lambda_2$, if you have a n-dimensional operator with n distinct eigenvalues then it does follow each eigenvalue has multiplicity 1, but lacking that you can't say.
alright, i think i fixed it
this is fine right?
its basically what you wrote
holazach
looks good
ah i reread what quantum posted, you're right. it doesn't say they all are distinct. that was my bad for skimming
Brute forcing would be checking all 16 possibilities
Instead of 2^(4) we are checking 4-1 cases
Actually here's a much better approach
x_1+x_2+x_3=1
x_2+x_3+x_4=2
x_4-x_1=1
implies x_1=0 and x_4=1 implies x_2 or x_3 has to be 1
true
@native rampart
is there a common algorithm this follows? or are you going mostly off of just manipulating the equations directly?
Just manipulating
Maybe relevant
could someone help me start the proof stated in the last line? iām clueless on how to start it
What is $x_1',x_2'...$
BYE BYE!
@oblique prairie
nvm derivatives
Prove x(t) is of that form first
Then try multiplying both sides
of
$\sum_{i=1}^k e^{\lambda_i t} z_i = 0$( Proving { $e^{\lambda_i t} z_i | i \in {1,2,3...k} $ } will work I think)
with $(A-\lambda_2)(A-\lambda_3)...(A-\lambda_k)$
This would cancel all the terms except $e^{\lambda_1 t} z_1$
The correct approach would be something along those lines
BYE BYE!
We want to prove a two way implication first start with if $x(t) = \sum_{n=1}^{k} e^{\lambda_it}z_i$ then
$x'(t) = \sum_{n=1}^{k} \lambda_i e^{\lambda_it}z_i$
and since $Az_i = \lambda_i z_i$ we have $x'(t) = Ax(t)$.
then going the other way given $A$ is diagonalizable the direct sum of each eigenspace, $E_{\lambda_1} + E_{\lambda_2} + ... + E_{\lambda_k} = V$ is the space so each vector $x(t)$ for every $t$ can be written as a linear combination of $z_i \in E_{\lambda_i}$ so $x(t) = \sum_{n=1}^{k}c_i(t)z_i$ then if we have $x'(t) = Ax(t)$ then
$\sum_{n=1}^{k}c_i'(t)z_i = \sum_{n=1}^{k}c_i(t)\lambda_i z_i$ given that this linear combination is unique it is a requirement that we have $c_i'(t) = \lambda_i c(t)$ which leads to a solution $c_i(t) =b_i e^{\lambda_i t}$ for some scalar $b_i$ but we can just transform $z_i -> b_i z_i$ and then the result follows
holazach
well, i already proved that those statements are equivalent
i was talking about the line at the bottom of the screenshot
oh wait
Hi how are you all doing, I'm just into linear algebra, I'm having confusion finding NPC (non pivot column)
For example,
[ 1 4 0 4 0]
[0 0 1 0 0]
There are no NPC's right?
there are non pivot columns, columns 1 and 3 are pivot columns so 2 and 4 and 5 will be non pivot columns
Thanks man
np
Least squares via QR (š“, š)
Requirements: the columns of š“ are linearly independent
1 Calculate a thin šš
decomposition š“ = šš
2 Calculate šš š
3 Solve š
š„ = šš š via back substitution
what do they mean by thin
if $P \geq 0$ (entrywise) and $\rho(P) < s$ then $sI - P$ is non-singular M matrix (this part is easy to see) but how do I show that if $\rho(P) = s$ then $sI-P$ is singular (M matrix)
looks similar to stochastic matrix that if spectral radius is s then s is an eigen value
could find some help from there
https://en.wikipedia.org/wiki/PerronāFrobenius_theorem found something
that's the one i had in mind when i suggested looking at stochastic matrices
but all i know is that it exists š
I only need the statement for now
yes I stumbled onto this from a completely different context
to show that if H is non-singular M-matrix and B and BH^-1 both are Z-matrix then BH^-1 is non-singular M matrix <=> BH^-1 is non-singular M matrix
though again I only needed the statement
@lavish jewel
im still stuck on this problem from yesterday perhaps you can tell me if I am correct?
import numpy.linalg as la
import matplotlib.pyplot as plt
import numpy as np
#Define the coordinate of the lamps
x=np.array([ 4, 3, 19, 16, 9, 5, 18, 16, 12, 12, 2, 13])
y=np.array([ 20, 2, 4, 16, 28, 11, 13, 25, 12, 23, 15, 4])
z=np.array([2.8, 3, 3, 3, 3.4, 3.5, 3.6, 3.8, 4, 4, 4.5, 3.6])
#We define the center of the of the square, e.g. matrix A
xc=15
yc=10
zc=0
#We compute the distance from the center [xc,yc,zc] to [x,y,z] coordinates of each lamp
xxc = x-xc
yyc = y-yc
zzc = z-zc
#The ligthning square from each lamp is calculated by dividing the intensities xi
# with the square of the distance in R³ to each lamp from the center.
xi=np.array([0.001, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
#Vector that contain the reciprocal distance from the lamps to the center.
dm = xi/(xxc**2 + yyc**2 + zzc**2)
b=np.ones(shape=(12,1))
#Create and populate matrix D of size 12x12 with the vector dm
D = np.zeros((12,12))
for i in range(12):
for j in range(12):
D[i][j]=dm[j]
#Now we need to solve 1-D * x with:
# Least squares via SVD (D, š)
# 1 Calculate a reduced SVD D = šĪ£š š
# 2 Calculate š š š
# 3 Solve Ī£š¦ = š š š
# 4 Set š„ = šš¦
u, s, vt = np.linalg.svd(D)
s= np.diag(s) @ np.diag(1/s)
utb = np.matmul(u.T,b)
sinv= la.inv(s)
y = np.matmul(sinv,utb)
x = np.matmul(vt.T,y)
Asvd=np.matmul(D[0],x)
print(np.sum(Asvd))
how to do 4b
What have you tried
The solution is the minimal polynomial has to be either x or x^2(why)
In the former case,A is just 0 matrix
In the later case, pick any x such that Ax!=0
And x,Ax form a basis
Writing A in that basis gives you the answer
Let k* be a linear form from the space of polynomials of degree less than 3 to R such that k* (q) = q(0). If B is a basis for that vector space, how to find B*?
try writing a polynomial of the prescribed order and see what happens when you evaluate at 0
in particular, what happens to terms that have the variable present in them?
they disappear
hm
if B = {b1, b2, b3} then we can write
q = Ab1 + Bb2 + Cb3
and i would expect that k* (b1) returns A, k* (b2) returns B, k* (b3) returns C
is that correct?
i would expect k*(b_i) to be either 0 or the coefficient c_i
depending on what b_i is
can you show what exactly the problem statement is btw?
so
k* : P2 --> R
k* (q) = q(0)
i need to write k* as a linear combination of vectors in B*. and B = {1, 2-x, 2-x^2}
there we go, that makes it a lot easier that doing it in general
to give a hint
since it's a linear form, what rank does the linear transformation have?
what shape should the corresponding matrix have?
i think rank = 1 because k* is not 0?
yeah
and your matrix would be of size 1 x 3, just a row vector
what i would do is to split the problem up into easier problems
if the basis were nice and simple like the canonical basis {1,x,x^2}, then k* would be a lot easier to describe, right?
so we could do that first
and then, write a change of basis matrix that takes vectors in the B basis and maps them to the canonical basis
then the overall transformation is the composition of these two, i.e. apply k* to the vectors that have been transformed from the B basis to the canonical one
If V = {x + y | x ā span{u}and y ā span{v}}, where u and v are two fixed
non-zero vectors in R3, then V is a subspace.
can someone help guide me on how to show if this is True or False?
thank you for your time. i can express a2x^2 + a1x + a0 as a linear combination of vectors in B but not sure if that helps.
that's precisely what the change for basis from B to the canonical one is š
i got
$a_{2}x^2 + a_{1}x + a_{0} = (a_{0} + 2a_{1} + 2a_{2}) + (-a_{1})(2-x) + (-a_{2})(2-x^2)$
is my matrix
$\begin{pmatrix} a_{0} + 2a_{1} + 2a_{2} \-a_{1} \ -a_{2} \end{pmatrix}$?
mate
hello there, i'm a bit confused about this example
how exactly did they determine the number of free variables?
nevermind, they are x^2 and x right?
you can solve one of the variables in terms of the others say $ax^2 + bx + (-a -b)$ then the free variables are $a,b$
holazach
oh okay, thank you
is there a relationship between the geometric product and its reverse? such as $(AB)^\dag = B^\dag A^\dag$... im trying to prove or disprove this myself so any "hints" would be cool, if such a relationship exists (probably does)
koala
well reverse(A) = (-1)^(grade(A)(grade(A)-1)/2) A so nothing super exciting using the fact scalar multiplication commutes
so, i'm trying to understand this "the plane xy are all the points perpendicular to the Z axis. Therefore, we could say that they are the points (x,y,z) such that (x,y,z).(0,0,1) = 0, (0,0,1) being the normal to the plane "
i don't understand why (x,y,z).(0,0,1) = 0, isn't it (x,y,z).(0,0,1) = z ?
The xy-plane consists of all the points (x,y,z) such that z = (x,y,z).(0,0,1) = 0.
isn't (x,y,z).(0,0,1) = (x.0)+(y.0)+(1.z) = 0 + 0 + z = z?
The point (x,y,z) lies on the xy-plane if and only if z = 0.
points without z=0 are the points that have floated off the xy plane
right
A parking space of 20m Ć 30m is illuminated via lamps placed in different places and at different heights, as indicated in Figure 1 page 3.
The car park is divided into a rectangular grid of 600 squares each of size 1m Ć 1m. The number š¦š indicates the illumination level squared š, for š = 0,. . . , 599. Let š„š indicate the power of lamp š. We select units so that the contribution to the lighting in square š from lamp š is š„š / š2šš, where ššš is the distance in ā3 from the lamp to the center of square š.
(a) State how the illumination level š¦ = (š¦0,..., š¦599) and the powers š„ = (š„0,..., š„11) are related via a linear equation system. Set the coefficient matrix for the system in python. (You must estimate the coordinates of the location of each lamp from the diagram.)
please can someone help me with problem a) I am having a real hard time understanding what to do
figure
$M_{ji} = 1/d^2_{ij}$ should be 600x12 matrix and then the system is $Mx = y$
holazach
where dij is the distance from the center to the cell right
y would be 600x1?
what about z
Yes, Yes, what is z?
z is the height
the d_ij has the distance in R^3, wouldn't that already be included?
import numpy as np
import matplotlib.pyplot as plt
center_x = 12/2
center_y = 600/2
M = np.zeros((600,12))
for i in range(600):
for j in range(12):
if(i==center_x and j==center_y):
M[i][j]=1
else:
M[i][j]=1/((i-center_x)**2 +(j-center_y)**2)
fig, ax = plt.subplots(figsize =(1, 100))
plt.imshow(M, cmap = "hot")
plt.colorbar()
ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')
plt.tight_layout()
plt.show()
looks weird, is it something like this?
I populate the 600 by 12 matrix
do I populate the matrix M like this?
what is y?
I will have to know y and A right
Okay this is probably a super simple question but for life of me I can't figure out why S is not a subspace of W
like, I don't understand why you can't just for example do (0,1) * 3 and get (0,3) which is also an element of R^2 is there something very big I'm missing? Because my lecturer brought this up as an example for why it's not closed under scalar multiplication (unless I misheard him?)
@sour flame For S to be a subspace, we need to make sure the following conditions are satisfied: For any v in S, cv is in S, c is a scalar and for any v,w in S, v + w is in S. If you multiply (0,1) by 3, you get (0,3) and (0,3) is not in S. You can also do (0,1) + (1,1) = (1,2) which is not in S.
Way too many things are not in S, so I feel like you're not getting the intuition right
oh wait okay for some reason I was thinking about all linear combinations of the things in S was a subspace of W rather than S itself
thanks for the clarification
š I was staring at this for 15 minutes for no reason
do not confuse a set with its span
@lavish jewel
will this be correct reasoning?
We already went over this
Let (M^TM) =USV^T
Then (M^TM)^{-1}= V S^{-1} U^T
So the solution is x = (M^TM)^{-1}M^T 1 = VS^{-1}U^TM^T 1
You get the normal equations M^TM x = M^T 1 by differentiating |Mx - 1|^2 wrt x and setting the derivative to be equal to zero (i.e. the equations for the stationary points)
@spare widget When you say (M^TM) =USV^T is it the same as: usv^t = sdv(M^TM)
in the equation VS^{-1}U^TM^T 1 , what is 1?
x will be the size 600x12, so by multiplying M^T*x^T I get Mx of size 12x12 so I guess if I take one row it is the solution to x, right?
Yes it's the svd. 1 is a column vector of 1s. Idk what your last question is about.
ok I think I figured it out thanks for helping š
Hey, sorry if this is a bit of a stupid question, but for (c), do I just let $\mathbf{x}_0 = (1, 0)$ and compute $\mathbf{x}_2 = P^2\mathbf{x}_0$?
PhenomPlasma
š i have a question regarding matrices corresponding to a map f:R^2ā>R^3 . f is referring to two basis V={v,u} und W={x,y,z}
M(f)= ( 3 2, 1 0, 2 -1)
and the task is to transform M(f) so that it refers to the standard bases of R^2,3
to my actual question: i would like to find the map f from M(f) by having each column of M(f) as the solution of two equations
specifically: f(v)=f(2,7)= (3, 1, 2) and f(u)=f(1,4)=( 2,0,-1)
for the first column of f we had the system of equations like this:
2λ+7μ=3 and λ+4μ=2
leading to: λ=1 μ=-2
yes
if i do this for every column i get f(a,b)=(a-2b, 4a-b, 15a-4b)
is this form f unique??
what do you mean by 2-digit rounding in solving systems of equations?
For example, use Gauss-Jordan Elimination method and 2-digit rounding in solving systems of equation
ups, i meant row and not column xD maybe thats clear now
so basically M(f)=(f(v),f(u)) ,f(v)/f(u) being column vectors with the values that you can see in the text above and i want to get f
in the way as i referred in the text above, will the result will be the right one?
or i have the totally wrong approach the hole time D:
say i have this implicit equation for a line y = 2x + 1, how do i make it into a vectorial equation? my first approach was saying something like (x, 2x+1) = (x,2x) + (0,1) = x(1,2) + (0,1) but this is wrong when i compare it to some exercise from a book i'm using
that's correct
there's more than one way to do it though
so maybe that's why you think it's wrong
show some examples of what they give as the answer
for instance another way entirely is write it as -2x+y=1 and then you can recognize the dot product (-2,1) dot (x,y)=1
a quick understanding question: if k is an element of ker(f) with f being a homomorphismn would g(k), g being also a homomorphismn also be in the kernel of f?
if k=0 surely but im not sure if that statement holds for any k
nope, imagine f projects on the x axis and g projects on the y axis
damn, i want to show g(f(k))=f(g(k))=0 is there a trick im missing? g(f(k))=0 follows quickly since f(k)=0 and g(0)=0 but im not confident baout f(g(k))
is that true?
I'm thinking f projects on the x axis and g rotates by 90 degrees, that'd be a counterexample
maybe I'm not paying enough attention to something here
hold on, i didnt read the task correctly, i have to show the existence of a g, element of Hom(V=R^n) such that the equality holds
identity š¤£
i mean yes
am i tarded?
ah hold on again, g is unequal to zero
i thought they mentioned it so that you have to guess that you have to play with the kernel of f
hmm
it's weird, i was doing some exercise where i did the same method and the result wasn't the same, i verified it with graphing software and it wasn't the same
this one #help-17 message
yes
awesome
Thanks!
How would I properly denote the fact that two vectors make up the columns of a matrix?
Col(A) = vec1, vec2?
i would use A=(u,v) and specifacally mentioning that the vectors u,v are columns by showing the dimension
a friend of mine shared his solution and i thought you might be interested, one can construct g such there are k_i =g(v_i) so that some of the k_iās are the base of the kernel of f while others are in the image
yo so kinda noob question
but after i find rref and find that the vectors are linear dependent
how can i find what combination of those vectors give zero vector
Well you could solve the system of equations
Like say a1,a2,a3 are the vectors and b_n constants then: b_1a_1 + b_2a_2 + b_3a_3 = 0(vector) this would just make a 3x3 system that you could solve for b_n
ok but i did solve them, now the problem is to actually get the b_ns
my final matrix is ([1 0 3 0] , [0 1 5 0] , [0 0 0 0]) where [] is a row
what do i do from here @hoary void
okay i got it nvm
this question is about a linear application
and asks for which a's the v vector is in the image of the application
but you shouldnt be supposed to multiply the matrix with the vector since its 4 columns 3 rows
i'm very confused about this and i have an exam tommorw
someone can help out?
(4 column matrix, 3 rows vector)
even the statement says the function takes vectors from R^4
yea but
how can you do the row x column product
if the number of the columns of the first doesnt equal the number of the rows of the second?
then that problem makes no sense
since the application its literally
Av
but i can't do that
we agree or am i missing something?
because i think i am
well either the question is wrong or you're missing something
and that's for sure
but
you should notice
if i'm missing something
right?
idk this is just fucking my mind
the question shouldnt really be wrong
cause its a exam simulation for all class given days ago and nobody complained
its just so weird
they don't answer yet if youre wondering
Wait, what's wrong? v is a vector in R³ and it wants you to find the values of a such that v is in the range of the transformation. So you can just row reduce [A v] and find the values of a that make the system consistent.
import numpy as np
x = np.array([-1, 1])[:, np.newaxis]
y = np.array([1, -1])[:, np.newaxis]
b = np.array([1, 1, 0])[:, np.newaxis]
A = np.array([[-1,0],[0,1],[1,-1]])
if ((A@(x+y)+b == A@x + A@y+b).all() and (A@(5*x)+b == 5*A@(x)+b).all()):
print("It is linear")
is this correct?
I need to check if it is linear
are you forced to check it for linearity with a program and forbidden from doing so by hand?
I can do it by hand
but it is numerical linear algebra
that is why I am using python
bcs the exam will be in pytohn
there's no need to use any programming here
L as written here is obviously not linear: L(0) is not 0!
and you don't need a computer to tell you that, surely.
that's the definition of linearity yes
but you should know a thing or two about linear maps
such as: any linear map sends zero to zero
hmm
so a map that sends zero to something other than zero cannot be linear no matter what
what is [:, np.newaxis]?
...
you think?
so you are using things whose function you yourself are not fully aware of.
I mean
why, then, are you confused that you are getting bullshit results?
garbage goes in, garbage comes out.
it is (3,1)
also it looks like your calculation is bad anyway
you have L(x) = Ax + b, sure
and then L(x+y) = A(x+y)+b, but L(x)+L(y) = (Ax+b)+(Ay+b) not Ax+Ay+b as you wrote!
and once again!
this stuff shouldn't require a computer!
a computer can't prove linearity like that anyway!
the best you can do is demonstrate some examples of linearity being satisfied for some particular inputs!
do not rely on computers for that which can and should be done by hand!
what do you mean, "need"?
has your teacher said explicitly that EVERY SINGLE EXERCISE HAS TO be done in python and any non-python solution will be REJECTED OUT OF HAND?
even these?
ok now it works
the teacher wont see this
these are just exercises
but I like to practice
in python bcs the exam is in python
so why use python for things that don't require it...
you're not answering my question either
"the exam is in python"
has your teacher said this, yes or no
who gives a shit.
it sounds like you are just learning the very basics of linear algebra, and the 'numerical' part has not yet really come up.
if you're at the level where you're trying to verify whether or not a map is linear, you're not doing any numerics.
I do
it sounds like you are just learning the very basics of linear algebra, and the 'numerical' part has not yet really come up.
if you're at the level where you're trying to verify whether or not a map is linear, you're not doing any numerics.
you are NOT yet doing any numerics. you aren't trying to get any approximate solutions. you're not doing things like finding eigenshit numerically.
I did the first one
by hand
and said cba
I dont see a reason to do it by hand if I know how to do it by hand
this exercise can be done in one line
L(0) != 0
that's it
no need for any python shit.
it's going to take 10 times more effort to write a python program than to just do some observations yourself.
and a program really will not help you with that at all.
i think trying to do everything programmatically will really muddle your vision even further.
ignore this advice at your peril, i suppose.
yeah that's kind of Ann's point, you're too busy distracted by programming stuff instead of the linear algebra stuff itself
do things by hand unless there's good reason to do it programmatically.
to do the logic on paper, and then code the logic afterwards
good code starts on paper
if you need two dense 10x10 matrices multiplied fsr, obviously nobody is forcing you to do it manually. that's what computers are for. they're glorified calculators.
doing it on paper would take way longer
and I dont have that kind of time
I also have other exercises and homework
do you want to write shit code?
if you want to pump out thousands of lines of shit code you don't need any paper
but shit code, unsurprisingly, is shit.
the logic, not the matrix multiplication
if you are doing something that actually takes many computations like an iterative method of some kind, that's something for computers to do - but yeah, as edd said, first write out the formulas on paper.
yea I know I usually do that
well then do that
but you dont need that to check if it is linear
you do, as evidenced by you writing the linearity conditions incorrectly in your example.
more of a typo
my question was about if it was correct to say Ax + b
bcs in the slides of my teacher he doesnt write Ax+b in his examples
I probably formulated the question badly 
yes you did.
Anyway hello
it keeps brining up calculus on the browser lol
Lol dw
for example let's say i have the point X = (-1,-2,0) in the plane of pi: x-y+z=0 and i want to solve for the orthogonal projection
so this was the problem
Sure


