title: Why does increasing size of hashtable decrease the number of collisions?
body: <p>From what I have read online, there are two ways of decreasing the number of collisions:</p>
  
  <ol>
  <li>Use a better hash function</li>
  <li>Increase the size of your hashtable</li>
  </ol>
  
  <p>I can understand the first reason but I cannot seem to get my head around the second. </p>
  
  <p>If lets say I have 5 keys all whose hashes are the same. Lets say we are using chaining for collision resolution. All 5 keys will form a chain starting from the index that equals the hash value. Now, lets say I double the size of the table and rehash all the 5 keys. The 5 keys will <em>still</em> hash to the same index and will <em>still</em> form a change of size 5. How did increasing the size of hash table decrease collisions?</p>