I'm trying to play with central limit theorem using Mathematica, so I wrote the following code,
f[x_] := UnitBox[x];
For[i = 1, i < 4, i++,
f[x_] := Convolve[UnitBox[z], f[z], z, x];
]
Plot[f[x],{x,-3,3}]
hoping to produce a 3-fold convolution of the original function, but only to produce the following error notifications:
$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of UnitBox[z].
$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of UnitBox[z].
$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of UnitBox[z].
General::stop: Further output of $RecursionLimit::reclim2 will be suppressed during this calculation.
but I don't know how to comprehend this. What exactly is wrong with the code?


