I wrote this to simulate m random walks of n steps
Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n; Tb[n_, m_] := Table[Li[n], {i, 1, m}]; y = table[10, 10] The walker has to start at (0) I don't know how to adjust the function to get that. And I have to write a function that finds the average position after n steps and the average of the square of the distance between the walker after n steps and the origin without using Mean or StandardDeviation. We can take n=10 and m=10
For the average position I wrote that but I don't get the same result as when I use Mean ( and I think I have to do that in one function)
averagepos[n_] := Total[y]/n; Total[averagepos[n]] The teacher gave us in a notebook
ytest = y[[All, 10]]; Mean[ytest] And I don't get the same thing for Mean[ytest] and Mean[y] what does the y[[All, 10]] mean ? ForFor the average of the square of the distance walker-origin I don't get what I should calculate.