Open Menu
AllLocalCommunitiesAbout
lotide
AllLocalCommunitiesAbout
Login

Explain yourselves, comp sci.

⁨524⁩ ⁨likes⁩

Submitted ⁨⁨1⁩ ⁨year⁩ ago⁩ by ⁨fossilesque@mander.xyz⁩ to ⁨science_memes@mander.xyz⁩

https://mander.xyz/pictrs/image/287fdf0a-10a5-4dc1-846e-78afae840c09.jpeg

source

Comments

Sort:hotnewtop
  • SpaceNoodle@lemmy.world ⁨1⁩ ⁨year⁩ ago

    It’s a dynamically-sized list of objects of the same type stored contiguously in memory.

    source
    • fossilesque@mander.xyz ⁨1⁩ ⁨year⁩ ago

      Image

      source
      • ipha@lemm.ee ⁨1⁩ ⁨year⁩ ago

        It’s like a fancy list.

        source
        • -> View More Comments
      • Fosheze@lemmy.world ⁨1⁩ ⁨year⁩ ago

        It’s a dynamically-sized list of objects of the same type stored contiguously in memory.

        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.

        source
        • -> View More Comments
      • SpaceNoodle@lemmy.world ⁨1⁩ ⁨year⁩ ago

        Many things like each other lined up in a row, and you can take some away or put more in.

        source
      • mindbleach@sh.itjust.works ⁨1⁩ ⁨year⁩ ago

        It’s how you want an array to work.

        source
    • Leate_Wonceslace@lemmy.dbzer0.com ⁨1⁩ ⁨year⁩ ago

      No, it’s an n-tuple with certain algebraic properties.

      source
      • KidnappedByKitties@lemm.ee ⁨1⁩ ⁨year⁩ ago

        This is such an understated but useful description in this context. It’s also how I understood algebra for applied matrix computation.

        source
        • -> View More Comments
      • GnomeKat@lemmy.blahaj.zone ⁨1⁩ ⁨year⁩ 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.

        source
        • -> View More Comments
    • conquer4@lemmy.world ⁨1⁩ ⁨year⁩ ago

      So an ArrayList?

      source
      • joyjoy@lemm.ee ⁨1⁩ ⁨year⁩ 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.

        source
        • -> View More Comments
  • yardy_sardley@lemmy.ca ⁨1⁩ ⁨year⁩ ago

    Did nobody else’s CS department require a bunch of linear algebra courses? A vector is an element of vector space.

    source
    • droans@lemmy.world ⁨1⁩ ⁨year⁩ ago

      That is quite possibly the least helpful answer you could give.

      source
      • kureta@lemmy.ml ⁨1⁩ ⁨year⁩ ago

        Also the most correct :)

        source
      • Cryophilia@lemmy.world ⁨1⁩ ⁨year⁩ ago

        Q: what is a vector? A: it is a vector

        source
    • baseless_discourse@mander.xyz ⁨1⁩ ⁨year⁩ ago

      Set is just objects in the category of Set.

      source
    • sexy_peach@beehaw.org ⁨1⁩ ⁨year⁩ ago

      We do and we know this. Maybe programmers would give that answer

      source
    • stoly@lemmy.world ⁨1⁩ ⁨year⁩ ago

      My university requires two for the CS program, as I recall.

      source
  • sanosuke001@lemmynsfw.com ⁨1⁩ ⁨year⁩ ago

    What do you mean? A vector is a direction and magnitude!

    source
    • deaf_fish@lemm.ee ⁨1⁩ ⁨year⁩ ago

      Maybe they mean std::vector in C++?

      source
      • NorthWestWind@lemmy.world ⁨1⁩ ⁨year⁩ ago

        It’s a terrible name. The math answer is what I would give.

        source
        • -> View More Comments
    • Eatspancakes84@lemmy.world ⁨1⁩ ⁨year⁩ 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.

      source
    • SorryQuick@lemmy.ca ⁨1⁩ ⁨year⁩ 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.

      source
    • solarbabies@lemmy.world ⁨1⁩ ⁨year⁩ ago

      Yes, and as linear algebra teaches, to convert a vector from direction and magnitude to a list of numbers (components), follow these steps:

      1. Let the magnitude of the vector be represented by the symbol |A| or A.
      2. Let the direction of the vector be represented by the angle θ, which is measured counterclockwise from the positive x-axis.
      3. The x-component of the vector is given by: Ax = |A| cos(θ)
      4. 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)

      source

      source
  • model_tar_gz@lemmy.world ⁨1⁩ ⁨year⁩ 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.

    source
    • MonkderDritte@feddit.de ⁨1⁩ ⁨year⁩ ago

      Singularities, too.

      /dev/null

      source
    • NegativeInf@lemmy.world ⁨1⁩ ⁨year⁩ ago

      Tensors are easy!

      source
      • model_tar_gz@lemmy.world ⁨1⁩ ⁨year⁩ ago

        It’s just a fancy list of fancy lists! :D

        source
  • RustyEarthfire@lemmy.world ⁨1⁩ ⁨year⁩ ago

    Image

    source
  • muntedcrocodile@lemm.ee ⁨1⁩ ⁨year⁩ ago

    Well mathematically its an n by 1 matrix.

    source
    • chonglibloodsport@lemmy.world ⁨1⁩ ⁨year⁩ 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.

      source
      • muntedcrocodile@lemm.ee ⁨1⁩ ⁨year⁩ 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?

        source
        • -> View More Comments
      • Pulptastic@midwest.social ⁨1⁩ ⁨year⁩ ago

        Wouldn’t N by M be a tensor? Magnitude and direction only need one entry per DOF.

        source
        • -> View More Comments
  • cerement@slrpnk.net ⁨1⁩ ⁨year⁩ ago

    you just need to car and cdr your cons cell …

    source
  • onlinepersona@programming.dev ⁨1⁩ ⁨year⁩ 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.

    Anti Commercial-AI license

    source
    • 01101000_01101001@mander.xyz ⁨1⁩ ⁨year⁩ ago

      NO

      source
      • onlinepersona@programming.dev ⁨1⁩ ⁨year⁩ ago

        YES

        source
        • -> View More Comments
  • joyjoy@lemm.ee ⁨1⁩ ⁨year⁩ ago

    I asked my math friend. He said a vector is magnitude plus velocity.

    source
    • GnomeKat@lemmy.blahaj.zone ⁨1⁩ ⁨year⁩ ago

      It should be magnitude plus orientation, not velocity. Velocity itself is a vector quantity

      source
  • Kaboom@reddthat.com ⁨1⁩ ⁨year⁩ 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.

    source
    • holomorphic@lemmy.world ⁨1⁩ ⁨year⁩ 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.

      source
      • Lojcs@lemm.ee ⁨1⁩ ⁨year⁩ ago

        It still can be, just not on infinite precision as nothing can.

        source
        • -> View More Comments
  • Adalast@lemmy.world ⁨1⁩ ⁨year⁩ ago

    As a mathematician this genuinely hurts. Lol.

    source
  • kaffiene@lemmy.world ⁨1⁩ ⁨year⁩ ago

    This might hit harder if it weren’t for the fact that words very can have multiple senses

    source