I want to define the pdf function that is the convolution of n uniform [0,1] pdfs using the Nest function/process. I realize I can use a for-like loop to accomplish this, but I am trying to expand my horizons and understand Mathematica and programming better... I want to use Nest but cannot figure out what I am doing wrong (probably something simply, but I have spent 2+ hours trying to get below to work):
ClearAll[U, UConv];
U[x_] = PDF[UniformDistribution[], x];
Convolve[U[x], U[x], x, y]
UConv[w_] := {Convolve[U[x], w[[1]][x], x, w[[2]]], w[[2]]};
Nest[UConv, {U, y}, 2]
I was hoping/expecting that Nest[UConv, {U, y}, 2] gives the same result as Convolve[U[x], U[x], x, y], but it doesn't. I cannot even figure out how to interpret Nest[UConv, {U, y}, 2]'s result! Any hints, help, or suggestions would be greatly appreciated. ds