So, conventionally, entries in a matrix are referred to as $A_{ij}$ - $i$th row, $j$th column.

For historical reasons (least partially due to Cobol naming restrictions based on what I've read, but I could be wrong), variable names for for loops will also be i and, for nested loops, j:

for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 20; j++) {

Is this resemblance purely coincidental, or was one "borrowed" from the other? If one was "borrowed," which one came first?

  • 1
    $\begingroup$ Mostly, it comes from the fact that $i$ comes before $j$ in the alphabet and $i$ is the first letter of the word index. $\endgroup$ – Michael Burr Oct 25 '17 at 23:10
  • $\begingroup$ To emphasize the subscript notation, in every example and every lecture I ever do on or related to the topic, I always use R before C. You will never hear me say "rows and columns" in the other order if I can help it (unless it is to emphasize a particular property or is otherwise necessary). So, the players in the game are Rob and Charles, or it is the Rumrunners and the Coastgard, or Robbers and Cops. $\endgroup$ – JMoravitz Oct 25 '17 at 23:14
  • $\begingroup$ @MichaelBurr How does the fact that $i$ comes before $j$ explain why $A_{ij}$ isn't the entry in the $i^{\text{th}}$ column, $j^{\text{th}}$ row? $\endgroup$ – bof Oct 25 '17 at 23:15
  • $\begingroup$ Matrices were around long before Cobol (or even Fortran). $\endgroup$ – Robert Israel Oct 25 '17 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.