title: J Verb Rank and addition
body: <p>I have a 2x3 array </p>
  
  <pre><code>a =. 2 3 $  2 3
     a
  2 3 2
  3 2 3
  </code></pre>
  
  <p>And I want to add all the elements together using +/ to get 15.</p>
  
  <p>So </p>
  
  <pre><code>+/a
  5 5 5
  </code></pre>
  
  <p>Hmmm. This is clearly adding columns. I know that +/ rank is _ _ _ (i.e. infinity) and a is rank 2. I can't translate this into imagining why it adds columns, unfortunately. (I am reading "J for C Programmers")</p>
  
  <p>So just for fun I did:</p>
  
  <pre><code>+/"1 a
  7 8
  </code></pre>
  
  <p>So now it's adding rows. Clearly I changed the rank of +/ to 1, which is less then 2 (the rank of a) which means... I don't know. Why am I now adding rows by switching form infinity to 1? </p>
  
  <p>What about</p>
  
  <pre><code>+/"0 a
  2 3 2
  3 2 3
  </code></pre>
  
  <p>So now we are just adding single cells with nothing so we get an array equal to the original a. Again I don't know why, although I can just about muddle through an argument to get here: verb rank is less than a (the noun) rank, so we use this value, which is zero, so we add 0-cells, ie. we add each cell in turn individually.</p>
  
  <p>And once more for luck:</p>
  
  <pre><code>+/"2 a
  5 5 5
  </code></pre>
  
  <p>And I'm adding columns again. I don't know the mechanism which is choosing which rows/columns/cells get added as the verb rank is changed. We're adding columns but form my point of view, we could just as easily be adding rows.</p>
  
  <p>I would like this explained if possible. As I said I'm reading some literature but I'm still finding it tough. </p>