title: What's the efficient way to multiply two arrays and get sum of multiplied values in Ruby?
body: <p>What's the efficient way to multiply two arrays and get sum of multiply values in Ruby?
  I have two arrays in Ruby:</p>
  
  <pre><code>array_A = [1, 2, 1, 4, 5, 3, 2, 6, 5, 8, 9]
  array_B = [3, 2, 4, 2, 5, 1, 3, 3, 7, 5, 4]
  </code></pre>
  
  <p>My aim is to get the sum value of array_A * array_B, i.e., 1*3 + 2*2 + 1*4 + ... + 8*5 + 9*4.</p>
  
  <p>Because I need to calculate them million times in my apps, what's the most efficient way to do such calculations?</p>
  
  <p>It's just like a matrix calcuation: 1* N matrix * N*1 matrix or a vector dot product.</p>