jeudi 6 octobre 2016

Random data generator with specified number of items

I would like to generate an array such that I can specify the number of item in the output. For example, I want to create a (1x10) random array of 1 and 0, but the result should contain 3 zeros, the randomness comes from the appearance of zeros in the array.

What is the easiest way to generate such array ?




Aucun commentaire:

Enregistrer un commentaire