title: simple 1D example showing convolution vs correlation to test commutative/associative property
body: <p>So I've known this fact that convolution has commutative/associative property while correlation does not but never really written out a simple example to test this out. (proofs in equation forms exist out there)</p>
  <p>I was just trying this simple example:</p>
  <pre><code>Image : [1 0 -1 0 1 0 1 1]
  A kernel = [-1 0 1]
  B kernel = [-1 0 1]
  </code></pre>
  <p>Using convolution, I * (A * B) should equal (I * A) * B, but when I tried this they were not equal.. which confused me a lot. would anyone be able to help out? maybe I made a human error in doing computation.. but they should be equal right? (assuming borders are treated as 0s)</p>
  <p>And using correlation, the same should not be equal as I understand.. which they dont, but then, my convolution did not either so lol (but it should!)</p>
  <p>Any help would be appreciated.</p>
  <p>also,
  A*B (convolution) would be [0 -2 0] right?
  and AxB (cross correlation) would be [0 2 0]?</p>