Skip to main content
deleted 180 characters in body
Source Link
ferrou
  • 125
  • 5

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.

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 ? For the average of the square of the distance walker-origin I don't get what I should calculate.

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]] 

For the average of the square of the distance walker-origin I don't get what I should calculate.

deleted 2 characters in body
Source Link
ferrou
  • 125
  • 5

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,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 ? For the average of the square of the distance walker-origin I don't get what I should calculate.

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,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 ? For the average of the square of the distance walker-origin I don't get what I should calculate.

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 ? For the average of the square of the distance walker-origin I don't get what I should calculate.

deleted 3 characters in body; edited tags
Source Link
Karsten7
  • 27.7k
  • 5
  • 76
  • 138

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,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[]Mean or StandardDeviation[]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]Mean[ytest] and Mean[y]Mean[y] what does the y[[All, 10]]y[[All, 10]] mean ? For the average of the square of the distance walker-origin I don't get what I should calculate

Thanks.

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,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 ? For the average of the square of the distance walker-origin I don't get what I should calculate

Thanks

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,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 ? For the average of the square of the distance walker-origin I don't get what I should calculate.

added 168 characters in body
Source Link
ferrou
  • 125
  • 5
Loading
deleted 3 characters in body
Source Link
ferrou
  • 125
  • 5
Loading
Source Link
ferrou
  • 125
  • 5
Loading