raise error for invalid pocket size
can provide random generator