How about creating the left half and using its image for the right half.
sigma = .25; L = 300; mu = 1; n = 1000;
left = Table[{k,RandomVariate[NormalDistribution[mu, Exp[-(2*Pi*k*sigma/L)^2]]]}, {k, n/2}];
right = Reverse[left] /. {x_, y_} -> {n - x, y}; (*imaging*)
full = Join[Most[left], right];
ListPlot[full, Frame -> True]

Adding extra elements
Let say you want to put the element x1
[say, (0,0)] at the beginning or end. You can simply put it during the Join
.
x1={0,0.0}; x2={n+1,0.0}; (*first and last element in (k,f(k)) format*)
full=Join[{x1},Most[left], right,{x2}];
Note that when using join, you don't use a single element x1
, rather a list containing a single element {x1}
.
for n=8
it looks like
$
\begin{array}{l l}
0 & 0.00000 \\
1 & 1.47757 \\
2 & 2.29881 \\
3 & 1.46615 \\
4 & 1.34819 \\
5 & 1.46615 \\
6 & 2.29881 \\
7 & 1.47757 \\
9 & 0.00000 \\
\end{array}
$
And your list now has n+1
element. This is because the axis of reflection goes through 4
. If you want even number of element then use n+1
for right
and omit Most
in final
.
right = Reverse[left] /. {x_, y_} -> {n + 1 - x, y};
full = Join[left, right];
And the result for n=8
after adding the zeros
x1 = {0, 0.0}; x2 = {n + 1, 0.0};
full = Join[{x1}, left, right, {x2}];
$
\begin{array}{ll}
0 & 0.00000 \\
1 & 0.380134 \\
2 & 1.48306 \\
3 & 0.509712 \\
4 & 1.76137 \\ \hline
5 & 1.76137 \\
6 & 0.509712 \\
7 & 1.48306 \\
8 & 0.380134 \\
9 & 0.00000 \\
\end{array}
$
Now 4
and 5
has same element and number of elements in your final list iss n+2
.