  Observations of solar and stellar flares have revealed the presence of power
law dependences between the flare energy and the time interval between flares.
Various models have been proposed to explain these dependences, and to explain
the numerical value of the power law indices. Here, we propose a model in which
convective flows in granules force the foot-points of coronal magnetic loops,
which are frozen-in to photospheric gas, to undergo a random walk. In certain
conditions, this can lead to a twist in the loop, which drives the loop
unstable if the twist exceeds a critical value. The possibility that a solar
flare is caused by such a twist-induced instability in a loop has been in the
literature for decades. Here, we quantify the process in an approximate way
with a view to replicating the power-law index. We find that, for relatively
small flares, the random walk twisting model leads to a rather steep power law
slope which agrees very well with the index derived from a sample of 56,000+
solar X-ray flares reported by the GOES satellites. For relatively large
flares, we find that the slope of the power law is shallower. The empirical
power law slopes reported for flare stars also have a range which overlaps with
the slopes obtained here. We suggest that in the coolest stars, a significant
change in slope should occur when the frozen-flux assumption breaks down due to
low electrical conductivity.
