Did nobody else’s CS department require a bunch of linear algebra courses? A vector is an element of vector space.
Explain yourselves, comp sci.
Submitted 7 months ago by fossilesque@mander.xyz to science_memes@mander.xyz
https://mander.xyz/pictrs/image/287fdf0a-10a5-4dc1-846e-78afae840c09.jpeg
Comments
yardy_sardley@lemmy.ca 7 months ago
droans@lemmy.world 7 months ago
That is quite possibly the least helpful answer you could give.
kureta@lemmy.ml 7 months ago
Also the most correct :)
Cryophilia@lemmy.world 7 months ago
Q: what is a vector? A: it is a vector
baseless_discourse@mander.xyz 7 months ago
Set is just objects in the category of Set.
sexy_peach@beehaw.org 7 months ago
We do and we know this. Maybe programmers would give that answer
stoly@lemmy.world 7 months ago
My university requires two for the CS program, as I recall.
sanosuke001@lemmynsfw.com 7 months ago
What do you mean? A vector is a direction and magnitude!
deaf_fish@lemm.ee 7 months ago
Maybe they mean std::vector in C++?
NorthWestWind@lemmy.world 7 months ago
It’s a terrible name. The math answer is what I would give.
Eatspancakes84@lemmy.world 7 months ago
The only correct answer for a 101 introduction. It’s an incredible powerful intuition even in contexts where vectors are seemingly used as a list of numbers.
SorryQuick@lemmy.ca 7 months ago
You can also define a vector by the equivalent “sides of the right triangle”. In 2D, the x,y coordinates. In computer science, vectors are n-tuples, so they represent a math/physics vector but in n-dimensions.
solarbabies@lemmy.world 7 months ago
Yes, and as linear algebra teaches, to convert a vector from direction and magnitude to a list of numbers (components), follow these steps:
- Let the magnitude of the vector be represented by the symbol |A| or A.
- Let the direction of the vector be represented by the angle θ, which is measured counterclockwise from the positive x-axis.
- The x-component of the vector is given by: Ax = |A| cos(θ)
- The y-component of the vector is given by: Ay = |A| sin(θ)
The vector can now be represented as a list of numbers: A = (Ax, Ay)
For example, if a vector has a magnitude of 5 units and a direction of 30° counterclockwise from the positive x-axis, its components would be:
Ax = 5 cos(30°) ≈ 4.33 units Ay = 5 sin(30°) ≈ 2.50 units
The vector can now be written as A = (4.33, 2.50)
model_tar_gz@lemmy.world 7 months ago
Ooh, do tensors next!
You should ask your biologist friend and your physicist friend and your compsci friend to debate about what vectors are. Singularities, too.
MonkderDritte@feddit.de 7 months ago
Singularities, too.
/dev/null
NegativeInf@lemmy.world 7 months ago
Tensors are easy!
model_tar_gz@lemmy.world 7 months ago
It’s just a fancy list of fancy lists! :D
RustyEarthfire@lemmy.world 7 months ago
muntedcrocodile@lemm.ee 7 months ago
Well mathematically its an n by 1 matrix.
chonglibloodsport@lemmy.world 7 months ago
Not always. Any m by n matrix is also a vector. Polynomials are vectors. As are continuous functions.
A vector is an element of a vector space over a field. These are sets which which a few operations, vector addition and scalar multiplication, and obey some well known rules, such as the existence of a zero vector (identity for vector addition), associativity and commutativity of vector addition, distributivity of scalar multiplication over vector sums, that sort of thing!
These basic properties give rise to more elaborate concepts such as linear independence, spanning sets, and the idea of a basis, though not all vector spaces have a finite basis.
muntedcrocodile@lemm.ee 7 months ago
How are polynomials vectors how does that work?
Say u have polynomial f(x)= a + bx + cx^2 + dx^3
How is that represented as a vector? Or is it just one of those maths well technically things? Cos as far as I’m aware √g = π = e = 3.
Are differential eqs also vectors?
Pulptastic@midwest.social 7 months ago
Wouldn’t N by M be a tensor? Magnitude and direction only need one entry per DOF.
cerement@slrpnk.net 7 months ago
you just need to
car
andcdr
yourcons
cell …onlinepersona@programming.dev 7 months ago
It’s an array.
First time I heard of vectors in comp-sci was in C++. The naming still doesn’t make sense to me.
01101000_01101001@mander.xyz 7 months ago
joyjoy@lemm.ee 7 months ago
I asked my math friend. He said a vector is magnitude plus velocity.
GnomeKat@lemmy.blahaj.zone 7 months ago
It should be magnitude plus orientation, not velocity. Velocity itself is a vector quantity
Kaboom@reddthat.com 7 months ago
A vector is a list of numbers, at its most basic. You can add a lot of extra functionality to it, but at its core, its just a list.
holomorphic@lemmy.world 7 months ago
Functions from the reals to the reals are an example of a vector space with elements which can not be represented as a list of numbers.
Lojcs@lemm.ee 7 months ago
It still can be, just not on infinite precision as nothing can.
Adalast@lemmy.world 7 months ago
As a mathematician this genuinely hurts. Lol.
kaffiene@lemmy.world 7 months ago
This might hit harder if it weren’t for the fact that words very can have multiple senses
SpaceNoodle@lemmy.world 7 months ago
It’s a dynamically-sized list of objects of the same type stored contiguously in memory.
fossilesque@mander.xyz 7 months ago
Image
ipha@lemm.ee 7 months ago
It’s like a fancy list.
Fosheze@lemmy.world 7 months ago
dynamically-sized: The size of it can change as needed.
list: It stores multiple things together.
object: A bit of programmer defined data with.
of the same type: all the objects in the list are the same kind of object
stored contigiously in memory: if you think of memory as a bookshelf then all the objects on the list would be stored right next to each other on the bookshelf rather than spread across the bookshelf.
SpaceNoodle@lemmy.world 7 months ago
Many things like each other lined up in a row, and you can take some away or put more in.
mindbleach@sh.itjust.works 7 months ago
It’s how you want an array to work.
Leate_Wonceslace@lemmy.dbzer0.com 7 months ago
No, it’s an n-tuple with certain algebraic properties.
KidnappedByKitties@lemm.ee 7 months ago
This is such an understated but useful description in this context. It’s also how I understood algebra for applied matrix computation.
GnomeKat@lemmy.blahaj.zone 7 months ago
Its the algebraic properties that are important, not all vectors are n-tuples, eg the set of polynomials of degree less than n.
You need a basis to coordinate a vector, you can work with vectors without doing that and just deal with the algebraic properties. The coordinate representation is dependent on the basis chosen and isn’t fundamental to the vector. So calling them n-tuples isn’t technically correct.
You can turn them into a set of coordinates if you have a basis, but the fact that you can do that is because of the algebraic properties so it’s those properties which define what a vector is.
conquer4@lemmy.world 7 months ago
So an ArrayList?
joyjoy@lemm.ee 7 months ago
No. ArrayList is thread safe and implements the connections API. Vector doesn’t. Though if you’re using Java, there’s almost no instance where you would want to use a Vector instead of ArrayList.