  We study the spontaneous folding of a 2D template of microscopic panels into
a 3D pyramid, driven by thermal fluctuations. Combining numerical simulations
and analytical calculations, we find that the total folding time is a
non-monotonic function of the number of faces, with a minimum for five faces.
The motion of each face is consistent with a Brownian process and folding
occurs through a sequence of irreversible binding events that close edges
between pairs of faces. The first edge closing is well-described by a
first-passage process in 2D, with a characteristic time that decays with the
number of faces. By contrast, the subsequent edge closings are all
first-passage processes in 1D and so the time of the last one grows
logarithmically with the number of faces. It is the interplay between these two
different sets of events that explains the non-monotonic behavior. Implications
in the self-folding of more complex structures are discussed.
