this post was submitted on 19 Oct 2024
728 points (98.7% liked)

Science Memes

11021 readers
3640 users here now

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don't throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 28 points 3 weeks ago* (last edited 3 weeks ago) (10 children)

MATLAB is for matrix calcs. Matrix indices start at 1, fight me. Given a matrix X of m x n size, you write

Matlab has many issues, amongst other accessibility (which can be remedied by piracy), closed-software, but as a program designed to do computational matrix manipulation, starting at index 1 is literally correct. This is how you learn matrix indices in intro linear algebra. How is it make sense then you use a software to assist computation and start indexing at 0, while you write the equations and indices on a piece of paper you start at 1. CS majors go home.

[–] [email protected] 4 points 3 weeks ago (4 children)

Is there a reason for the convention other than that's how most people count? (Which is a perfectly fine reason, I'm just curious)

[–] [email protected] 4 points 3 weeks ago (2 children)

When you say the first element of a matrix, first implies one and not zero. This is how linear algebra was invented (on paper, by a human mathematician), taught, and passed down to fellow humans.

Starting indexes at zero stem from the lineage of C programming and binary nature of computer. For example,

Computer memory addresses have 2^N cells addressed by N bits. Now if we start counting at 1, 2^N cells would need N+1 address lines. The extra-bit is needed to access exactly 1 address. (1000 in the above case.). Another way to solve it would be to leave the last address inaccessible, and use N address lines.

This is why, math and physics people who learn linear algebra and matrix calculus learn to index at 1 (on a piece of paper) while computer science programmers index at 0.

[–] [email protected] 1 points 3 weeks ago

There is no general convention in mathematics and linear algebra to index from 1. It highly depends on the department and person and it’s becoming more common to index from 0.

load more comments (1 replies)
load more comments (2 replies)
load more comments (7 replies)