Some fireflies synchronize their flashes when swarming in large groups.

To test whether your recorded fireflies blink in sync, upload a short video below.

This app tracks the number of flashes in each frame and applies statistical analysis to estimate whether they are synchronous. See below for more details.

Based on statistical analysis, this collective flashing display is

Details — flashes per frame statistics:

mean:

variance:

Z-value:

Synchronous fireflies (or "lightning bugs") tend to all blink together on the same beat. In contrast, most fireflies flash on their own time, with no coordination with their peers.

Only a few species have been documented to flash in sync.
In North America,
*Photinus carolinus*
and
*Photuris frontalis*
(eastern US),
as well as
*Photinus knulli*
(southern Arizona) are known to synchronize.
Another famous species is *Pteroptyx malaccae*, in southeastern Asia.
There might be other species capable of synchrony, but evidence is lacking.
That's because identifying synchrony is difficult and requires specific conditions.

Firefly synchrony usually requires a high density of active fireflies. That's because if they are too far apart, they are not able to interact to coordinate their flashes. You also need to be at the right place at the right time: watch the right species during the short season of its emergence.

The exact function of firefly synchrony remains a scientific puzzle. Firefly flashes are part of a courtship dialog between advertising males and receptive females. Some males possibly synchronize in order to help females identify them (minimize visual clutter from others). Other ecological functions have been proposed, but not tested.

There are actually various patterns of synchrony. Some are more precise than others. Some exhibit secondary modulations. You can find more information on this page.

Simple question, yet hard to answer. Indeed, take a minute to think about it: how would you design a test that could give you a 'random' or 'synchronous' verdict based on a video of flashes? Below is my approach.

Synchrony means that flashes tend to occur at the same time.
However, several flashes can happen at the same time merely by accident.
So a better definition would be to say that concurrent flashes are *more frequent* than they would be *if they were independent*.

The hypothesis that flashes are independent is called the "null hypothesis". Based on the data at hands (here, the number of flashes per frame), we can test whether the null hypothesis is likely or not. To do this accurately, we need a statistical model and math to implement it. More details below.

And of course we need data, in the form of a video recording of the collective display.

Recording firefly flashes is tricky because their bioluminescence is very dim. However, modern phone cameras can capture flashes under the right conditions. For best recordings, make sure to be close enough, to increase the camera's light sensitivity (if possible), to avoid light pollution in the background, and to keep your phone steady.

It's possible that your recording will look totally dark with no blinks. But flashes might still be there. To check, upload your clip below, and select a low brightness threshold (say, 10).

This app analyzes short video recordings of fireflies flashes.
Specifically, it does two things:

1) it locates flashes in each frame of the video;

2) it applies a statistical test to determine whether the collective display is likely to be synchronized.

To locate flashes in an image, it simply looks for bright spots on a dark background. You can change how bright the spots have to be by changing the threshold value on the slider above.

Based on the statistics of the number of flashes per frame, it calculates a likelihood that they may be synchronized. The details of this analysis are below.

The null hypothesis proposes that firefly flashes are uncorrelated. One way to frame this idea into a statistical model is to consider that the number of flashes per frame follows a Poisson distribution. For a Poisson distribution, the mean number of flashes is equal to its variance, which is essentially a measure of the fluctuations around the mean.

Thus, the app calculates both the mean and the variance. If they are too far apart, the null hypothesis is rejected, and the display is likely to be synchronous.

But how far apart should the mean and variance be for the difference to be significant? There are various ways to interpret the difference. Here, I use a parameter called the Z-value, based on a list of tests proposed in this paper. The Z-value should typically be between -2 and 2 for a process described by a Poisson distribution. When it is beyond these boundaries, the app returns "likely synchronous".

Further details and explanations can be found in
our paper on *Photinus knulli*.