function exercise6(S) A = zeros(S) for i=1:S A[rem(rand(Uint32),S)+1]=rand() end end [@time exercise6(2^i) for i=20:28]