Randomly selecting elements without repetition

I assigned energy values to each element in the array as per the program of Verbeia. The program looks like this

Xarray = A @@@ Tuples[Range[0, 1], 3];

energies =
RandomVariate[ExponentialDistribution[1.5], {Length@Xarray}];

f = {#, First@Pick[energies, Xarray, #]} &;

f@Xarray[[5]]


Now I want to randomly select let say 5 elements from this 1000 element array such that no element should repeat. Let { 89,5,79,34,900} be the set of elements I've randomly selected. Now for each element I should get the energies and coordinates automatically. Could anyone do this?

• as per which program by verbeia? Have you looked at RandomSample? Also, what have you tried doing? – rm -rf Jul 5 '12 at 13:49
• @R.M, the one on his previous question, apparently... – J. M. will be back soon Jul 5 '12 at 13:53
• Also, it's good form if you actually accept the answer that has helped you. So far you've asked 3 questions, accepted none and upvoted none. Time to read another faq I'm afraid: mathematica.stackexchange.com/faq#howtoask – Ajasja Jul 5 '12 at 14:24

f /@ RandomSample[Xarray, 5]

{{A[1, 1, 0], 0.666428},