yes, your suggestions are very helpful. I meant to write a script to manipulate the PCR process, however, when the total molecules after amplification are larger than 1e8, randomly select the position among the reads becomes very hard.
If there any method to quick index the numbers? such as, if I have 1~1e8 index, i want to randomly choose the position, the code in perl should be int(rand(1e8))+1, however, it seems it will cost large mem and time for this step.