Search code examples
randomwolfram-mathematicanormal-distribution

I have to generate 10000 numbers which are the result of 12 random numbers subtracted by 0.5 and then added together


I'm stuck here, and can't generate a do loop that repeats this operation 10k times and result in a list or array

{((RandomVariate[TruncatedDistribution[{0, 1}, NormalDistribution[]], 
 12])) - 0.5}

Solution

  • Do does things but it doesn't generate output. E.g.

    Do[{1, 2, 3}, 2]
    

    - no output -

    Have it add to a list though...

    alist = {};
    
    Do[alist = Join[alist, {1, 2, 3}], 2]
    
    alist
    

    {1, 2, 3, 1, 2, 3}