Calculating average space waste in array
I have an array of size 256 (index ranging [0, 255]), where each array element is an 8 byte integer. Now I am randomly generating the indexes of this array and incrementing the values stored at that index. After the end of the trials, the indexes that still have value 0 would be considered as memory wastage. For this I believe the average memory loss will be 128×8 bytes (on an average the array would be half filled). Is my understanding correct?