Optimization in memory management for topicDocCounts. Extend Randoms with bernouli, striling and Antoniak etc