Each dot shown in Figure 4B, D is a probability but is also the mean of the distribution of larvae undergoing a run-to-turn transition if we consider each larvae undergoing this transition as 1 and larvae not undergoing this transition as 0. Then, we have a distribution for each point in the cyan and black curves shown; each of those distributions can be compared with the distribution before the light stimulus is presented. Since we have sufficient data such that np >= 5 and n(1 − p) >= 5 in all cases (n is the number of samples, and p is the probability of undergoing a transition), we conducted a z-test to compare the distribution at each time point after opotgenetic stimulation with the baseline distribution. We show the p-values for each point in the case of Gr21a and Or45a in (A). All the p-values lower than 0.05 are shown; we note that Gr21a larvae become significantly different than their baseline behavior 0.5 s before than Or45a larvae, in addition, Or45a larvae stay at values different from their baseline behavior for at least 0.75 s longer than Gr21a larvae. In the case of Or42a and Gr2a, we conducted the same analysis (B middle) and obtained that Gr2a behavior becomes significantly different than baseline at least 1.75 s before Or42a. However, in the case of Or42a, adaptation is only partial: Or42a larvae reach steady-state values of P(r → t) at different levels when red lights are ON or when red lights are OFF because of that we also computed the z-test between Or42a after lights are turn OFF as compared to the distribution at the steady-state condition with lights ON. With this consideration, we obtained a very small difference between Gr2a and Or42a rising time (B bottom). As observed, the distribution of Or42a larvae stayed at values significantly higher than the value of P(r → t) with lights ON.