Generate a random array