<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.1 20151215//EN"  "JATS-archivearticle1.dtd"><article article-type="research-article" dtd-version="1.1" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><front><journal-meta><journal-id journal-id-type="nlm-ta">elife</journal-id><journal-id journal-id-type="publisher-id">eLife</journal-id><journal-title-group><journal-title>eLife</journal-title></journal-title-group><issn pub-type="epub" publication-format="electronic">2050-084X</issn><publisher><publisher-name>eLife Sciences Publications, Ltd</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">58144</article-id><article-id pub-id-type="doi">10.7554/eLife.58144</article-id><article-categories><subj-group subj-group-type="display-channel"><subject>Research Article</subject></subj-group><subj-group subj-group-type="heading"><subject>Ecology</subject></subj-group></article-categories><title-group><article-title>Inversion of pheromone preference optimizes foraging in <italic>C. elegans</italic></article-title></title-group><contrib-group><contrib contrib-type="author" corresp="yes" id="author-188374"><name><surname>Dal Bello</surname><given-names>Martina</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0003-3706-2929</contrib-id><email>dalbello@mit.edu</email><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="fn" rid="con1"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" id="author-59657"><name><surname>Pérez-Escudero</surname><given-names>Alfonso</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0002-4782-6139</contrib-id><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="other" rid="fund1"/><xref ref-type="other" rid="fund6"/><xref ref-type="other" rid="fund2"/><xref ref-type="fn" rid="con2"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" id="author-201385"><name><surname>Schroeder</surname><given-names>Frank C</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">http://orcid.org/0000-0002-4420-0237</contrib-id><xref ref-type="aff" rid="aff3">3</xref><xref ref-type="fn" rid="con3"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" corresp="yes" id="author-6428"><name><surname>Gore</surname><given-names>Jeff</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0003-4583-8555</contrib-id><email>gore@mit.edu</email><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="other" rid="fund3"/><xref ref-type="other" rid="fund4"/><xref ref-type="fn" rid="con4"/><xref ref-type="fn" rid="conf1"/></contrib><aff id="aff1"><label>1</label><institution>Physics of Living Systems Group, Department of Physics, Massachusetts Institute of Technology</institution><addr-line><named-content content-type="city">Cambridge</named-content></addr-line><country>United States</country></aff><aff id="aff2"><label>2</label><institution>Centre de Recherches sur la Cognition Animale (CRCA), Centre de Biologie Intégrative (CBI), Université de Toulouse; CNRS; UPS</institution><addr-line><named-content content-type="city">Toulouse</named-content></addr-line><country>France</country></aff><aff id="aff3"><label>3</label><institution>Boyce Thompson Institute and Department of Chemistry and Chemical Biology, Cornell University</institution><addr-line><named-content content-type="city">New York</named-content></addr-line><country>United States</country></aff></contrib-group><contrib-group content-type="section"><contrib contrib-type="editor"><name><surname>Celani</surname><given-names>Antonio</given-names></name><role>Reviewing Editor</role><aff><institution>ICTP</institution><country>Italy</country></aff></contrib><contrib contrib-type="senior_editor"><name><surname>Rutz</surname><given-names>Christian</given-names></name><role>Senior Editor</role><aff><institution>University of St Andrews</institution><country>United Kingdom</country></aff></contrib></contrib-group><pub-date date-type="publication" publication-format="electronic"><day>06</day><month>07</month><year>2021</year></pub-date><pub-date pub-type="collection"><year>2021</year></pub-date><volume>10</volume><elocation-id>e58144</elocation-id><history><date date-type="received" iso-8601-date="2020-04-22"><day>22</day><month>04</month><year>2020</year></date><date date-type="accepted" iso-8601-date="2021-06-09"><day>09</day><month>06</month><year>2021</year></date></history><permissions><copyright-statement>© 2021, Dal Bello et al</copyright-statement><copyright-year>2021</copyright-year><copyright-holder>Dal Bello et al</copyright-holder><ali:free_to_read/><license xlink:href="http://creativecommons.org/licenses/by/4.0/"><ali:license_ref>http://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>This article is distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution License</ext-link>, which permits unrestricted use and redistribution provided that the original author and source are credited.</license-p></license></permissions><self-uri content-type="pdf" xlink:href="elife-58144-v1.pdf"/><abstract><p>Foraging animals have to locate food sources that are usually patchily distributed and subject to competition. Deciding when to leave a food patch is challenging and requires the animal to integrate information about food availability with cues signaling the presence of other individuals (e.g., pheromones). To study how social information transmitted via pheromones can aid foraging decisions, we investigated the behavioral responses of the model animal <italic>Caenorhabditis elegans</italic> to food depletion and pheromone accumulation in food patches. We experimentally show that animals consuming a food patch leave it at different times and that the leaving time affects the animal preference for its pheromones. In particular, worms leaving early are attracted to their pheromones, while worms leaving later are repelled by them. We further demonstrate that the inversion from attraction to repulsion depends on associative learning and, by implementing a simple model, we highlight that it is an adaptive solution to optimize food intake during foraging.</p></abstract><kwd-group kwd-group-type="author-keywords"><kwd>pheromones</kwd><kwd>optimal foraging</kwd><kwd>behavioral plasticity</kwd><kwd>associative learning</kwd><kwd>pheromone valence</kwd></kwd-group><kwd-group kwd-group-type="research-organism"><title>Research organism</title><kwd><italic>C. elegans</italic></kwd></kwd-group><funding-group><award-group id="fund1"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100004410</institution-id><institution>European Molecular Biology Organization</institution></institution-wrap></funding-source><award-id>ALTF 818-2014</award-id><principal-award-recipient><name><surname>Pérez-Escudero</surname><given-names>Alfonso</given-names></name></principal-award-recipient></award-group><award-group id="fund2"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/501100000854</institution-id><institution>Human Frontier Science Program</institution></institution-wrap></funding-source><award-id>LT000537/2015</award-id><principal-award-recipient><name><surname>Pérez-Escudero</surname><given-names>Alfonso</given-names></name></principal-award-recipient></award-group><award-group id="fund3"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100000002</institution-id><institution>National Institutes of Health</institution></institution-wrap></funding-source><award-id>P40 OD010440</award-id><principal-award-recipient><name><surname>Gore</surname><given-names>Jeff</given-names></name></principal-award-recipient></award-group><award-group id="fund4"><funding-source><institution-wrap><institution>Schmidt Family Foundation</institution></institution-wrap></funding-source><principal-award-recipient><name><surname>Gore</surname><given-names>Jeff</given-names></name></principal-award-recipient></award-group><award-group id="fund6"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/501100004794</institution-id><institution>Centre National de la Recherche Scientifique</institution></institution-wrap></funding-source><award-id>Momentum</award-id><principal-award-recipient><name><surname>Pérez-Escudero</surname><given-names>Alfonso</given-names></name></principal-award-recipient></award-group><funding-statement>The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.</funding-statement></funding-group><custom-meta-group><custom-meta specific-use="meta-only"><meta-name>Author impact statement</meta-name><meta-value>Worms' attraction to pheromones turns into repulsion when a food patch is depleted, helping them avoid already exploited territories and search for new food sources.</meta-value></custom-meta></custom-meta-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>Foraging for food is among the most critical activities for an animal's survival (<xref ref-type="bibr" rid="bib7">Calhoun et al., 2014</xref>). It is also among the most challenging, because food is usually patchily distributed in space and time, and other individuals are attempting to find and consume the same resources (<xref ref-type="bibr" rid="bib1">Abu Baker and Brown, 2014</xref>; <xref ref-type="bibr" rid="bib16">Driessen and Bernstein, 1999</xref>; <xref ref-type="bibr" rid="bib50">Stephens and Krebs, 1987</xref>).</p><p>An important factor, which has been the focus of considerable effort in models of foraging behavior, is for how long to exploit a food patch. At any given time, an individual feeding in a food patch has to choose between leaving to search for a better patch or staying. Leaving incurs the cost of exploring an unknown territory, while staying results in the cost of feeding in a depleting food patch. Most models addressing this ‘dilemma’ involve patch assessment by individuals and postulate that the leaving time depends on local estimates of foraging success (<xref ref-type="bibr" rid="bib8">Charnov, 1976</xref>; <xref ref-type="bibr" rid="bib37">Oaten, 1977</xref>; <xref ref-type="bibr" rid="bib50">Stephens and Krebs, 1987</xref>). As such, foragers are predicted to depart from a food patch when the instantaneous intake rate drops below the average intake rate expected from the environment, a phenomenon that has been observed in several animals, from insects (<xref ref-type="bibr" rid="bib56">Wajnberg et al., 2008</xref>) to birds (<xref ref-type="bibr" rid="bib12">Cowie, 1977</xref>; <xref ref-type="bibr" rid="bib30">Krebs et al., 1974</xref>) and large mammals (<xref ref-type="bibr" rid="bib44">Searle et al., 2005</xref>). The presence of other animals, however, affects individual foraging success so that different leaving times can be expected (<xref ref-type="bibr" rid="bib3">Aubert-Kato et al., 2015</xref>; <xref ref-type="bibr" rid="bib11">Couzin et al., 2005</xref>; <xref ref-type="bibr" rid="bib21">Giraldeau and Caraco, 2000</xref>; <xref ref-type="bibr" rid="bib28">Karpas et al., 2017</xref>).</p><p>Once an animal leaves a food patch, it will have to explore the environment to locate new sources of food. Since natural habitats are usually saturated with many different non-specific chemical cues, animals use pheromones and other odors to orientate their searches (<xref ref-type="bibr" rid="bib60">Wyatt, 2014</xref>). This, however, implies determining whether pheromones point toward a resource supporting growth and reproduction or an already exploited one. To acquire this knowledge, animals have to learn from experience. In the context of social foraging, it has been shown that individuals might need to rely only on the most recent experience (<xref ref-type="bibr" rid="bib32">Krebs and Inman, 1992</xref>). As such, the valence (positive or negative signal) of pheromones acquired during the most recent feeding activity is crucial for the success of the foraging process. While this has been shown in bumblebees feeding on transient resources (<xref ref-type="bibr" rid="bib4">Ayasse and Jarau, 2014</xref>), we still do not know whether it is important for other animals feeding in groups. Moreover, it is not clear if the ability to use associative learning—the capacity to learn and remember the features of the environment that are associated with positive or aversive stimuli (<xref ref-type="bibr" rid="bib2">Ardiel and Rankin, 2010</xref>)—to change the valence of pheromones could improve foraging success.</p><p>The nematode <italic>Caenorhabditis elegans</italic> is a powerful model system to investigate how information about food availability and pheromones can shape foraging in patchy habitats. <italic>C. elegans</italic> feeds in large groups on ephemeral bacterial patches growing on decomposing plant material, a habitat that can be mimicked in a petri dish (<xref ref-type="bibr" rid="bib20">Frézal and Félix, 2015</xref>; <xref ref-type="bibr" rid="bib43">Schulenburg and Félix, 2017</xref>). Importantly, <italic>C. elegans</italic> can evaluate population density inside food patches using a suite of pheromones, belonging to the family of ascarosides, which are continuously excreted by worms (<xref ref-type="bibr" rid="bib22">Greene et al., 2016</xref>; <xref ref-type="bibr" rid="bib33">Ludewig and Schroeder, 2013</xref>). Finally, it has been shown that pheromones and food availability control the leaving times of foraging worms. In particular, the rate at which individuals abandon the patch increases when food becomes scarce and pheromones are at high concentrations (<xref ref-type="fig" rid="fig1">Figure 1A</xref>; <xref ref-type="bibr" rid="bib23">Harvey, 2009</xref>; <xref ref-type="bibr" rid="bib36">Milward et al., 2011</xref>).</p><fig-group><fig id="fig1" position="float"><label>Figure 1.</label><caption><title>Worms leaving at different times from a food patch exhibit opposite preferences for pheromones.</title><p>(<bold>A</bold>) During the feeding process, worms remaining in the food patch experience different environmental conditions. At the beginning, food is still abundant and pheromones have already accumulated. By the end, food is scarce and pheromone concentration is even higher. (<bold>B</bold>) In the behavioral assay, as animals feed and leave from a food patch, they are presented with the choice between a spot containing the pheromone blend and a spot containing a control solvent. In the two spots, sodium azide is added in order to anesthetize the animals and prevent them from leaving the chosen spot. (<bold>C</bold>) Individual worms leave the food patch at different times. The average number of worms that abandoned the food patch at each hour is shown (mean worm count ± SEM across replicates, n. experiments = 2). (<bold>D</bold>) Animals leaving the food patch earlier prefer the pheromone blend while those leaving later, when the food is almost depleted, avoid the pheromone blend. In the plot, chemotaxis index is calculated on the number of naive MY1 young adult hermaphrodites that, at each hour, reach the two spots (mean CI ± SEM across replicates, n. experiments = 2). The red region in each plot approximately indicates when food in the patch is exhausted.</p><p><supplementary-material id="fig1sdata1"><label>Figure 1—source data 1.</label><caption><title>Choice after food assay data.</title></caption><media mime-subtype="plain" mimetype="text" xlink:href="elife-58144-fig1-data1-v1.txt"/></supplementary-material></p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-58144-fig1-v1.tif"/></fig><fig id="fig1s1" position="float" specific-use="child-fig"><label>Figure 1—figure supplement 1.</label><caption><title>Layout of plates for chemotaxis assays.</title><p>(<bold>A</bold>) Choice after food assay: 100 mm petri dish filled with 25 ml of NGM. In blue, the spot with 20 μl of the pheromone blend, in gray the spot with 20 μl of the control solvent and in brown the food patch, 15 μl of a diluted <italic>E. coli</italic> OP50 culture. In the pheromone and control spots, 2 μl of 0.5 M sodium azide was added in order to anesthetize the animals once they reached the spots. Since the anesthetic action of sodium azide lasts for about 2 hr in this set-up, another 1 μl was added two hours after the beginning of the assay in both spots. (<bold>B</bold>) Chemotaxis assay: 60 mm petri dish filled with 10 ml of NGM. In blue, the spot with 20 μl of either pheromone blend or pure synthetic ascarosides; in gray the spot with 20 μl of control solvent. In both spots, 1 μl of Na azide 0.5M is added to paralyze the worms once they reached the cue. Worms are placed equidistant from the two spots.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-58144-fig1-figsupp1-v1.tif"/></fig></fig-group><p>In the present study, we experimentally investigated the behavioral responses of <italic>C. elegans</italic> to food depletion and pheromone accumulation in food patches. We confirmed that individual worms consuming a food patch leave at different times, and we found that worms leaving early have a preference for worm-secreted pheromones while those leaving late avoid the pheromones. A simple foraging model suggests that these two behaviors may optimize foraging success in the presence of competitors. Finally, using a series of behavioral assays altering worm exposure to food and pheromones, we demonstrate that associative learning underpins the change in pheromone preference.</p></sec><sec id="s2" sec-type="results"><title>Results</title><sec id="s2-1"><title>The leaving time from a food patch affects the preference for pheromones of a <italic>C. elegans</italic> natural isolate</title><p>To investigate <italic>C. elegans</italic> behavioral responses to food depletion, we developed an assay to simultaneously assess patch-leaving behavior and pheromone preference over time (see Materials and methods section and <xref ref-type="fig" rid="fig1">Figure 1B</xref>). We used young adult hermaphrodites of the natural isolate MY1 (Lingen, Germany) to assess behavioral patterns that could be as close as possible to those exhibited by <italic>C. elegans</italic> in its natural habitat. In our assay, a small patch of bacteria is gradually depleted by feeding animals (about 5 hr). At equal distances from the food patch there are two spots, one of which contains a pheromone blend. Shortly after worms leave the food patch, they make a decision by choosing between the two spots (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1</xref>). This assay mimics a foraging activity in which animals decide first when to leave a food patch and later whether to follow a pheromone cue, which is indicative of the presence of others. In these experiments, the pheromone blend is obtained by collecting and filtering the supernatant of well-fed worms maintained in a liquid culture (<xref ref-type="bibr" rid="bib9">Choe et al., 2012</xref>; <xref ref-type="bibr" rid="bib23">Harvey, 2009</xref>; <xref ref-type="bibr" rid="bib59">White et al., 2007</xref>). In agreement with previous results (<xref ref-type="bibr" rid="bib36">Milward et al., 2011</xref>), we found that feeding animals abandon the food patch at very different times, with some worms leaving at the beginning while others staying until the food patch is depleted (<xref ref-type="fig" rid="fig1">Figure 1C</xref>). In addition, the leaving time affects worms’ preference for their pheromones, with individuals leaving the food patch early (first three hours) going to the pheromone blend (positive chemotaxis index, <xref ref-type="fig" rid="fig1">Figure 1D</xref>) while worms leaving the food patch later avoiding it (negative chemotaxis index, <xref ref-type="fig" rid="fig1">Figure 1D</xref>). <italic>C. elegans</italic> responses to food depletion, therefore, include an inversion in pheromone preference dependent on the leaving time from the food patch.</p></sec><sec id="s2-2"><title>A simple model shows that the inversion of the preference for pheromones can be a strategy to optimize foraging</title><p>Inside rotting fruits and stems where <italic>C. elegans</italic> forage, bacterial food is patchily distributed (<xref ref-type="bibr" rid="bib20">Frézal and Félix, 2015</xref>; <xref ref-type="bibr" rid="bib43">Schulenburg and Félix, 2017</xref>). We might then expect that the timing of dispersal from existing food patches and the strategies that optimize food intake are crucial for worm survival. A natural question then arises: can the behaviors we observed in our experiments provide any benefit to <italic>C. elegans</italic> foraging? We addressed this question with a simple theoretical model exploring the optimality of the inversion in pheromone preference in the context of foraging in a heterogeneous environment. This model uses the tools of Game Theory to find the strategy that maximizes the food eaten by a worm, taking into account that other worms will also follow the same strategy. This strategy is called Evolutionary Stable Strategy, and should have been selected by evolution (<xref ref-type="bibr" rid="bib35">Maynard Smith, 1982</xref>).</p><p>Our model considers one unoccupied and two occupied food patches (<xref ref-type="fig" rid="fig2">Figure 2A</xref>). Initially, <inline-formula><mml:math id="inf1"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> worms are in patch 1, and <inline-formula><mml:math id="inf2"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> worms are in patch 2 (<xref ref-type="fig" rid="fig2">Figure 2A</xref>). We assume by convention that <inline-formula><mml:math id="inf3"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>≥</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>, so patch 1 is initially overcrowded and patch 2 is undercrowded. Worms have three possible choices: (1) <italic>remain</italic> in their current food patch, (2) <italic>switch</italic> to another occupied food patch, and (3) <italic>disperse</italic> away from the occupied patches, in search for an unoccupied one. <italic>Switching</italic> means that a worm will leave its initial food patch and follow pheromone cues in order to find another occupied food patch. <italic>Dispersing</italic> means that the worm will leave its current food patch and avoid pheromones to maximize the probability of finding an unoccupied food patch. We assume that unoccupied food patches are hard to find, because they are not marked by pheromones and may be on average further away. Therefore, dispersal will not be advantageous until the occupied food patches are nearly depleted. A proof of this result, which closely resembles the marginal value theorem (<xref ref-type="bibr" rid="bib8">Charnov, 1976</xref>), can be found in the supplement; here we will simply assume that worms will not <italic>disperse</italic> until the occupied food patches are depleted. Therefore, initially the individuals will choose between <italic>remaining</italic> or <italic>switching</italic>.</p><fig-group><fig id="fig2" position="float"><label>Figure 2.</label><caption><title>A simple model predicts that worms can optimize foraging by a change in pheromone preference over time.</title><p>(<bold>A</bold>) Schematic of model predictions (only three identical food patches are depicted). Initially, two patches are unequally populated by <italic>C. elegans</italic> individuals (overcrowded and undercrowded food patch) while a third one is unoccupied. The release of pheromones by worms makes the occupied patches easier to find compared to the unoccupied one. During the first phase, worms equalize occupancy in the occupied patches. Then, all worms stay in their patches until food becomes scarce. In this last phase, worms benefit from dispersing to the unoccupied patch avoiding pheromone cues. This would be favored by a change in pheromone preference. (<bold>B</bold>) Expected payoff for each strategy (Remain, <inline-formula><mml:math id="inf4"><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mtext>Remain</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula>, in black; Switch <inline-formula><mml:math id="inf5"><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mtext>Switch</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula>, in color as a function of the fraction of individuals that switch (<inline-formula><mml:math id="inf6"><mml:mi>p</mml:mi></mml:math></inline-formula>). In the absence of cost, switching is always advantageous (blue line), so the equilibrium switching probability is <inline-formula><mml:math id="inf7"><mml:msubsup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula> (blue dot). A switching cost shifts the equilibrium probability to an intermediate value (orange dot). Lines computed with <xref ref-type="disp-formula" rid="equ3 equ4">Equations 3a and 3b</xref> with parameters <inline-formula><mml:math id="inf8"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>9</mml:mn></mml:math></inline-formula>, <inline-formula><mml:math id="inf9"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula>, <inline-formula><mml:math id="inf10"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula>. (<bold>C</bold>) Probability to switch in equilibrium (<inline-formula><mml:math id="inf11"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula>), as a function of switching cost c and the initial fraction of worms in patch 1(<inline-formula><mml:math id="inf12"><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>)</mml:mo></mml:math></inline-formula>).</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-58144-fig2-v1.tif"/></fig><fig id="fig2s1" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 1.</label><caption><title>Benefit that individuals obtain from switching at time <inline-formula><mml:math id="inf13"><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>, with respect to individuals that remain , versus the probability of switching.</title><p>Blue: Cost <inline-formula><mml:math id="inf14"><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>. Orange: Cost <inline-formula><mml:math id="inf15"><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0.05</mml:mn></mml:math></inline-formula>. For both curves, <inline-formula><mml:math id="inf16"><mml:mi>K</mml:mi><mml:mo>=</mml:mo><mml:mn>5</mml:mn></mml:math></inline-formula>, <inline-formula><mml:math id="inf17"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi/><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mn>15</mml:mn></mml:math></inline-formula>, <inline-formula><mml:math id="inf18"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0.1</mml:mn></mml:math></inline-formula> and <inline-formula><mml:math id="inf19"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1.1</mml:mn></mml:math></inline-formula>.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-58144-fig2-figsupp1-v1.tif"/></fig><fig id="fig2s2" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 2.</label><caption><title>Benefit that individuals obtain from switching at time <inline-formula><mml:math id="inf20"><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>, with respect to individuals that remain, versus the probability of switching when patches have equal or different sizes.</title><p>Blue: Cost <inline-formula><mml:math id="inf21"><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>. Orange: Cost <inline-formula><mml:math id="inf22"><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0.05</mml:mn></mml:math></inline-formula>. For all cases, <inline-formula><mml:math id="inf23"><mml:mi>K</mml:mi><mml:mo>=</mml:mo><mml:mn>5</mml:mn></mml:math></inline-formula>, <inline-formula><mml:math id="inf24"><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mn>15</mml:mn></mml:math></inline-formula>, <inline-formula><mml:math id="inf25"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0.1</mml:mn></mml:math></inline-formula> and <inline-formula><mml:math id="inf26"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1.1</mml:mn></mml:math></inline-formula>. Results are averaged across 100 simulations, with each of the 15 individuals starting at a random food patch in every simulation. (<bold>A</bold>) All food patches have size 1 (curves computed using <xref ref-type="disp-formula" rid="equ17">Equation S12</xref>). (<bold>B</bold>) Food patches have different sizes. For each simulation, the 5 sizes are drawn from a uniform distribution between 0 and 2 (curves computed using <xref ref-type="disp-formula" rid="equ21">Equation S16</xref>).</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-58144-fig2-figsupp2-v1.tif"/></fig></fig-group><p>We assess now the consequences of switching. We assume that the choice between switching or remaining cannot depend on the worm’s initial patch, because worms cannot know whether they start in the overcrowded or the undercrowded patch. Indeed, even if an individual can assess the density of its conspecifics in its current food patch, it does not have reliable information about the density of the other patch. As such, all worms have a probability <italic>p</italic> of switching, regardless of their initial patch. Also, worms that decide to switch may return to their original patch before finding the other one, so worms that switch have a probability ½ of ending up in either food patch. Therefore, the number of worms in the <inline-formula><mml:math id="inf27"><mml:mi>i</mml:mi></mml:math></inline-formula>-th food patch after the switch will be<disp-formula id="equ1"><label>(1)</label><mml:math id="m1"><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:mo>,</mml:mo></mml:math></disp-formula>where the first term represents the worms that started in the <inline-formula><mml:math id="inf28"><mml:mi>i</mml:mi></mml:math></inline-formula>-th patch and remained there, and the second term represents the worms that switched and ended up in the <inline-formula><mml:math id="inf29"><mml:mi>i</mml:mi></mml:math></inline-formula>-th patch (regardless of their initial patch). After the switch, worms exploit their chosen food patch until it’s exhausted. The food in each patch is shared evenly among the worms exploiting it, so if each food patch contains <inline-formula><mml:math id="inf30"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> units of food, each worm in the <inline-formula><mml:math id="inf31"><mml:mi>i</mml:mi></mml:math></inline-formula>-th patch will eat<disp-formula id="equ2"><label>(2)</label><mml:math id="m2"><mml:msub><mml:mrow><mml:mi>G</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac></mml:mrow></mml:mfrac></mml:math></disp-formula>units of food. We can now ask: Is switching on average more advantageous than remaining? Does it depend on the cost of switching or on the initial distribution of worms in the two food patches?</p><p>To test if switching is more advantageous than remaining, we calculate the payoff for each strategy. The payoff depends on the food intake achieved in each patch (<xref ref-type="disp-formula" rid="equ2">Equation 2</xref>) and the probability for each worm to end up in either of the two occupied food patches after switching or remaining. We assume that worms that switch have a probability ½ of ending in either food patch, while worms that remain have a probability <inline-formula><mml:math id="inf32"><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math></inline-formula> of being in the <inline-formula><mml:math id="inf33"><mml:mi>i</mml:mi></mml:math></inline-formula>-th food patch. The expected payoff for <italic>remaining</italic> then is<disp-formula id="equ3"><label>(3a)</label><mml:math id="m3"><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mtext>Remain</mml:mtext></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mi mathvariant="normal"/></mml:mrow></mml:mrow><mml:mfrac><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac></mml:mrow></mml:mfrac><mml:mi/><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>The payoff for <italic>switching</italic> is instead<disp-formula id="equ4"><label>(3b)</label><mml:math id="m4"><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mtext>Switch</mml:mtext></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:mi mathvariant="normal"/></mml:mrow></mml:mrow><mml:mfrac><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac></mml:mrow></mml:mfrac><mml:mo>-</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo></mml:math></disp-formula>where <inline-formula><mml:math id="inf34"><mml:mi>c</mml:mi></mml:math></inline-formula> is the cost of switching.</p><p>If both the switching probability and the cost are low (<inline-formula><mml:math id="inf35"><mml:mi>p</mml:mi><mml:mo>≈</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>,<inline-formula><mml:math id="inf36"><mml:mi>c</mml:mi><mml:mo>≈</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>), the expected payoff is higher for switching than for remaining. This happens because every individual has a higher probability of being in the overcrowded patch than in the undercrowded one and therefore has an incentive to switch. The difference between the two payoffs diminishes as the probability of switching increases, but if switching is costless all worms should switch in order to perfectly equalize their distribution across the two food patches (<xref ref-type="fig" rid="fig2">Figure 2B</xref>, blue). In contrast, when switching is costly, the equilibrium is reached when only a fraction of the population switches (<xref ref-type="fig" rid="fig2">Figure 2B</xref> orange). This equilibrium fraction (<inline-formula><mml:math id="inf37"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula>) depends both on the cost of switching and on the initial imbalance in patch occupancy (<xref ref-type="fig" rid="fig2">Figure 2C</xref>).</p><p>Our model recapitulates the two key experimental observations highlighted in <xref ref-type="fig" rid="fig1">Figure 1</xref>: First, a fraction of worms will switch at the beginning, leaving the food patch before it is depleted and following pheromones to reach another occupied food patch. Second, once the food patches are depleted all worms will disperse, avoiding depleted food patches by reversing their preference for pheromones (which now mark depleted food patches). Here, we have illustrated these results with a simplified model, with two identical food patches and in which worms can only switch or disperse at particular times. A more general model in which individuals can move at any time between any number of food patches of equal or different sizes gives the same Evolutionary Stable Strategy (see Appendix 1).</p><p>Our theoretical results show what features of <italic>C. elegans</italic> environment may lead to the evolution of the observed behaviors, regardless of how the behaviors are implemented. In particular, the inversion in pheromone preference may be triggered by several different factors, and our model cannot distinguish between them. In the following, we will examine experimental evidence related to these mechanisms.</p></sec><sec id="s2-3"><title>The change in pheromones preference is likely due to associative learning</title><p>As anticipated, our model does not encode any specific mechanism underpinning the inversion of pheromone preference. The most parsimonious explanation is that animals leaving the patch earlier might differ from worms leaving later simply due to their feeding status. Indeed, early-leaving worms abandon the food patch when food is still abundant and therefore, they are more likely to be well-fed. By contrast, worms leaving later—when the food is scarce—are more likely to be famished. However, worms leaving earlier are also exposed to pheromones in the presence of abundant food, while worms leaving later experience high levels of pheromones in association with scarce food. These conditions are analogous to those that have been shown to support associative learning in <italic>C. elegans</italic> (<xref ref-type="bibr" rid="bib2">Ardiel and Rankin, 2010</xref>). Similarly to the well-known case of associative learning with salt (<xref ref-type="bibr" rid="bib25">Hukema et al., 2008</xref>; <xref ref-type="bibr" rid="bib41">Saeki et al., 2001</xref>), in our experiment worms could be initially attracted to pheromones because of the positive association with the presence of food. Attraction could later turn into repulsion if worms start associating pheromones with food scarcity.</p><p>To distinguish between the change in pheromone preference being caused by feeding status alone or by associative learning, we performed experiments in which young adult hermaphrodites were conditioned for five hours in the four scenarios corresponding to the combinations of ± <italic>food</italic> and ± <italic>pheromone blend</italic> (see Conditioning experiments in the Materials and methods section). After conditioning, animals were assayed for chemotaxis to the pheromone blend (<xref ref-type="fig" rid="fig3">Figure 3A</xref>). We found that worms go to the pheromone blend when they are conditioned with <italic>+food + pheromone blend</italic> whereas they avoid it when they are conditioned with <italic>– food +pheromone blend</italic> (<xref ref-type="fig" rid="fig3">Figure 3B</xref>, blue and yellow bars, chemotaxis index of CI<sub>++</sub> = 0.38 ± 0.07 vs CI<sub>-+</sub> = – 0.15 ± 0.04). Interestingly, worms conditioned without the pheromone blend do not exhibit a particular preference for their pheromones (<xref ref-type="fig" rid="fig3">Figure 3B</xref>, red and turquoise bars, chemotaxis index for the <italic>+ food – pheromone blend</italic> and the <italic>– food – pheromone blend</italic> scenarios are 0 ± 0.07 and – 0.02 ± 0.06, respectively). Worms therefore exhibit attraction when pheromones are paired with abundant food and aversion when pheromones are associated with absence of food. Otherwise, <italic>C. elegans</italic> does not show a specific preference for pheromones. These findings are consistent with the hypothesis that the <italic>C. elegans</italic> preference for the pheromone blend changes due to associative learning.</p><fig-group><fig id="fig3" position="float"><label>Figure 3.</label><caption><title>Changes in pheromone preference depend upon associative learning.</title><p>(<bold>A</bold>) MY1 individuals grow at high density and with plenty of food until young adult. Animals are then transferred to conditioning plates, where they spend 5 hr. Conditioning scenarios are four: + <italic>food + pheromone blend; – food + pheromone blend; + food – pheromone blend; – food – pheromone blend</italic>. To prevent uncontrolled pheromone accumulation, the conditioning scenarios without added pheromone blend had to be repeated at low worm density. Worms are then assayed for chemotaxis to the pheromone blend. (<bold>B</bold>) MY1 individuals are not generally attracted the pheromone blend unless it is paired with abundant food. Chemotaxis index is shown for the four different conditioning scenarios: + <italic>food + pheromone blend</italic> (blue bar); <italic>– food + pheromone blend</italic> (yellow bar); + <italic>food – pheromone blend</italic> (red bar); <italic>– food – pheromone blend</italic> (turquoise bar). As a comparison, chemotaxis index is shown for the <italic>+ food – pheromone blend scenario</italic> and the <italic>– food – pheromone blend</italic> scenarios with conditioning done at normal animal density (Panel B, inset). Points indicate the outcome of each independent replicated experiments (n = 4 and n = 3 for experiments with worms at low population density) while bars indicate the CI ± SEM across independent experiments.</p><p><supplementary-material id="fig3sdata1"><label>Figure 3—source data 1.</label><caption><title>Conditioning with pheromones data.</title></caption><media mime-subtype="plain" mimetype="text" xlink:href="elife-58144-fig3-data1-v1.txt"/></supplementary-material></p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-58144-fig3-v1.tif"/></fig><fig id="fig3s1" position="float" specific-use="child-fig"><label>Figure 3—figure supplement 1.</label><caption><title>Attraction toward two ascarosides, ascr#5 and icas#9, can be turned into repulsion.</title><p>(<bold>A</bold>) Schematic of the conditioning experiment. Worms grow at high density and with plenty of food until they are young adults. Animals are then transferred to conditioning plates, where they spend 5 hr, before being assayed for chemotaxis to the pure ascaroside. (<bold>B</bold>) Chemotaxis index (CI) is shown for the four different conditioning scenarios: <italic>+ food + ascaroside</italic> (blue bars); <italic>– food + ascaroside</italic> (yellow bars); <italic>+ food – ascaroside</italic> (red bars); <italic>– food – ascaroside</italic> (turquoise bars). Points indicate the outcome of each independent replicated experiment (n = 4 for each ascaroside) while bars indicate the CI ± SEM across independent experiments. If attraction is turned into repulsion by the feeding status only, we expect the blue and red bars not to differ and the CI to be positive, while the yellow and turquoise bars not to differ and the CI to be either negative or equal to zero. In the experiment with ascr#5 (on the left), the CI is positive in the <italic>+ food + ascaroside</italic> and the <italic>+ food– ascaroside</italic> scenarios, but it differs in the two conditions without food, being negative in the <italic>– food + ascaroside</italic> scenario and not differing from zero in the <italic>– food – ascaroside</italic> scenario. These results are consistent with a combination of associative learning and feeding status driving the change in preference for ascr#5. In the experiment with icas#9 (on the right), the CI in the two conditions with food does not differ, mostly because of the large variability among the repetitions of the <italic>+ food – ascaroside</italic> scenario (red points). The CI in the two conditions without food is instead negative. The most parsimonious explanation for the change in preference for icas#9 is the different feeding status rather than associative learning, although the accumulation of secreted pheromones during the conditioning period (due to the high worm density in the conditioning plates) may once again obscure the evidence of associative learning (as in the inset of <xref ref-type="fig" rid="fig3">Figure 3</xref>).</p><p><supplementary-material id="fig3s1sdata1"><label>Figure 3—figure supplement 1—source data 1.</label><caption><title>Conditioning with ascarosides data.</title></caption><media mime-subtype="plain" mimetype="text" xlink:href="elife-58144-fig3-figsupp1-data1-v1.txt"/></supplementary-material></p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-58144-fig3-figsupp1-v1.tif"/></fig></fig-group><p>Conditioning in the two scenarios without pheromone blend added had to be performed at low worm density due to uncontrolled pheromone accumulation. Indeed, when conditioned at high worm density, animals in the <italic>+food – pheromone blend</italic> scenario are still exposed to the pheromones that they keep excreting during the 5 hr conditioning period (<xref ref-type="bibr" rid="bib42">Sakai et al., 2013</xref>) and therefore exhibit attraction to the pheromone blend, albeit variable (CI<sub>+-</sub> = 0.25 ± 0.07, <xref ref-type="fig" rid="fig3">Figure 3B</xref> inset, red bar). Worms conditioned in <italic>– food – pheromone blend</italic> display no significant attraction to the pheromone (CI<sub>--</sub>=0.10 ± 0.15, <xref ref-type="fig" rid="fig3">Figure 3B</xref> inset, turquoise bar). The variation here is even bigger, likely due to the fact that the pheromone cocktail produced by starved worms can be different from the pheromone blend we used, which was obtained from well-fed worms (<xref ref-type="bibr" rid="bib27">Kaplan et al., 2011</xref>).</p><p>In addition to a cocktail of ascaroside pheromones, the pheromone blend contains other products of worm metabolism, compounds deriving from the decomposition of dead worms and bacteria, and perhaps other unknown substances. Worms could in principle learn and change preference for any of these compounds and thus forage efficiently as indicated by our model. To probe whether specific pheromones are involved in the foraging optimization, we asked two questions: 1. Can <italic>C. elegans</italic> attraction to ascarosides be turned into repulsion? 2. Can <italic>C. elegans</italic> learn with ascarosides? To address these questions, we conducted the conditioning experiments (see Materials and methods) with two synthetic ascarosides, ascr#5 and icas#9, instead of the pheromone blend. We found that <italic>C. elegans</italic> can change its preference for both ascarosides (<xref ref-type="fig" rid="fig3s1">Figure 3—figure supplement 1</xref>), suggesting that ascaroside pheromones are likely contributing to the response to the pheromone blend found previously. However, these experiments were performed at high worm density, meaning that accumulation of secreted pheromones during the conditioning period prevents a definitive quantification of the relative importance of associative learning versus feeding status (as in <xref ref-type="fig" rid="fig3">Figure 3</xref> inset with the pheromone blend). Nonetheless, these results show that <italic>C. elegans</italic> can alter its preference for ascarosides, highlighting the flexible role of pheromones in foraging optimization.</p><p>To provide further support that the <italic>C. elegans</italic> preference for pheromones can change through associative learning, we asked whether the change in preference occurs also via the association with a repellent compound, namely glycerol (<xref ref-type="bibr" rid="bib25">Hukema et al., 2008</xref>). To answer this question, we performed another conditioning experiment in which young adult hermaphrodites were conditioned for 1 hr in four different scenarios deriving from all the possible combinations of ± <italic>repellent</italic> (glycerol) and ± <italic>pheromone blend</italic>. During conditioning, animals were free to dwell in a plate seeded with <italic>E. coli</italic> OP50, and therefore, they were always exposed to a high concentration of bacterial food. Here, uncontrolled pheromone accumulation was not an issue thanks to the short conditioning period. After conditioning, worms were tested for chemotaxis to the pheromone blend (<xref ref-type="fig" rid="fig4">Figure 4A</xref>).</p><fig id="fig4" position="float"><label>Figure 4.</label><caption><title>Pheromone preference changes due to association with the presence or absence of a repellent compound (glycerol).</title><p>(<bold>A</bold>) MY1 individuals grow at high density and with plenty of food until young adult. Animals are then transferred to conditioning plates, where they spend 1 hr. Conditioning scenarios are four: + <italic>pheromone blend – repellent; + pheromone blend + repellent; – pheromone blend – repellent; – pheromone blend + repellent</italic>. Bacterial food is always abundant to prevent confounding effects due to the feeding status of animals. The short conditioning time prevents uncontrolled pheromone accumulation. Worms are then assayed for chemotaxis to the pheromone blend. (<bold>B</bold>) MY1 individuals are not attracted to the pheromone blend unless it is present and paired with food. Association with the repellent disrupts worm preference for pheromones gained in the presence of abundant food. Chemotaxis index is shown for the four different conditioning scenarios: + <italic>pheromone blend – repellent</italic> (blue bar); +<italic>pheromone blend + repellent</italic> (yellow bar); <italic>– pheromone blend – repellent</italic> (red bar); <italic>– pheromone blend + repellent</italic> (turquoise bar). Points indicate the outcome of each independent replicated experiments (n = 5) while bars indicate the CI ± SEM across independent experiments.</p><p><supplementary-material id="fig4sdata1"><label>Figure 4—source data 1.</label><caption><title>Conditioning with pheromones &amp; repellent data.</title></caption><media mime-subtype="plain" mimetype="text" xlink:href="elife-58144-fig4-data1-v1.txt"/></supplementary-material></p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-58144-fig4-v1.tif"/></fig><p>We found that the preference for the pheromone blend, which is retained in the <italic>– repellent + pheromone blend</italic> scenario (<xref ref-type="fig" rid="fig4">Figure 4B</xref>, blue bar, CI<sub>-+</sub>=0.26 ± 0.04), is lost in the <italic>+ repellent + pheromone blend</italic> condition (<xref ref-type="fig" rid="fig4">Figure 4B</xref>, yellow bar, CI <sub>++</sub> = 0.04 ± 0.03). Again, when animals were conditioned in the absence of pheromones, they do not show any particular preference for the pheromone blend (CI = 0.01 ± 0.05 for + <italic>repellent – pheromone blend</italic> and CI = – 0.05 ± 0.08 for <italic>– repellent – pheromone blend,</italic> <xref ref-type="fig" rid="fig4">Figure 4B</xref> red and turquoise bars). In other words, animals do not exhibit a particular preference for pheromones, except when they are exposed to pheromones and food (in the absence of the repellent). Exposure to the repellent in the presence of food and pheromones is required to disrupt attraction. The outcome of this experiment provides further support that <italic>C. elegans</italic> can change its preference for the pheromone cocktail it produces through associative learning.</p></sec></sec><sec id="s3" sec-type="discussion"><title>Discussion</title><p>We have assessed the response of <italic>C. elegans</italic> to food depletion and how this influences worms’ response to their pheromones. In agreement with previous studies, our findings indicate that worms exhibit different leaving times when feeding in groups on transient bacterial food patches. Interestingly, the leaving time affects <italic>C. elegans</italic> preference for its pheromones, with animals leaving early being attracted to their pheromones and worms leaving later being repelled by them. We showed that this inversion from attraction to repulsion depends on associative learning and appears to be an adaptive solution to optimize food intake during foraging.</p><p>Our model shows that a change from pheromone attraction to repulsion is required to optimize food intake when three different factors are combined. First, food patches that give diminishing returns, and should be abandoned when the environment provides a better average intake rate. This first factor has been thoroughly studied both theoretically and experimentally in the context of optimal foraging and the marginal value theorem (<xref ref-type="bibr" rid="bib8">Charnov, 1976</xref>; <xref ref-type="bibr" rid="bib31">Krebs et al., 1978</xref>; <xref ref-type="bibr" rid="bib37">Oaten, 1977</xref>; <xref ref-type="bibr" rid="bib50">Stephens and Krebs, 1987</xref>; <xref ref-type="bibr" rid="bib57">Watanabe et al., 2014</xref>), and in this respect, our model simply reproduces previous results. A recent paper on <italic>C. elegans</italic> foraging contradicts this general assumption of diminishing returns, showing a near-linear depletion of food patches (<xref ref-type="bibr" rid="bib15">Ding et al., 2020</xref>). This result was obtained in laboratory conditions, with very rich and uniform food patches, which may not reflect natural ones, but at least indicates that the general assumption of diminishing returns is relatively easy to break, and opens the question of whether more care should be put in assessing the conditions in which current optimal foraging models are applicable.</p><p>The second factor is competition for limited resources, which in our model creates the need to switch between pheromone-marked food patches in order to distribute the individuals more evenly. This redistribution closely resembles the Ideal Free Distribution, which postulates that animals should distribute across patches proportionally to the resources available at each source (<xref ref-type="bibr" rid="bib6">Bautista et al., 1995</xref>; <xref ref-type="bibr" rid="bib19">Fretwell and Lucas, 1969</xref>; <xref ref-type="bibr" rid="bib24">Houston and McNamara, 1987</xref>; <xref ref-type="bibr" rid="bib29">Kennedy and Gray, 1993</xref>). However, here, our model does depart from previous studies. The Ideal Free Distribution applies to cases in which the benefit per unit time decreases with the number of individuals exploiting the same resource. This is the case for habitat choice (<xref ref-type="bibr" rid="bib19">Fretwell and Lucas, 1969</xref>), or if the instantaneous feeding rate decreases with the number of feeders (<xref ref-type="bibr" rid="bib24">Houston and McNamara, 1987</xref>). It is not, however, the case in many foraging scenarios, including the one represented by our model (and implicitly by most optimal foraging models), in which animals can feed unimpeded by each other. In these cases, a higher number of animals simply means that the resource is depleted faster. Therefore, simply adding competition to standard optimal foraging models will not change their results qualitatively. Animals will stay in each food source until the food is so scarce that the instantaneous feeding rate falls below the environment's average. This will happen earlier for more crowded food sources, but animals will never need to switch across food sources before they are depleted.</p><p>The third key factor in our model is non-stationarity: we assume that all pheromone-marked food patches will be depleted at roughly the same time. This fact creates the need to switch before the current patch is depleted, because by then most of the benefit from undercrowded (but pheromone-marked) food patches will be gone. This non-stationary environment has received less attention than the previous factors. It is typical of species with boom-and-bust life cycles such as <italic>C. elegans</italic> (<xref ref-type="bibr" rid="bib20">Frézal and Félix, 2015</xref>), but may also be applicable to other cases, such as migratory species (which arrive synchronously to a relatively virgin landscape), fast-dispersing invader species or, in general, species that occupy a non-stationary ecological niche.</p><p>It is interesting to note that the Evolutionary Stable Strategy found by our model does not give any benefit at the level of the species, and may even be deleterious. If we compute the average expected payoff across the whole population using the same rational as for <xref ref-type="disp-formula" rid="equ3">Equation 3</xref>, we get <inline-formula><mml:math id="inf38"><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mtext>all</mml:mtext></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>2</mml:mn><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mo>-</mml:mo><mml:mi>p</mml:mi><mml:mi>c</mml:mi></mml:math></inline-formula>. Therefore, increasing the probability of switching (<inline-formula><mml:math id="inf39"><mml:mi>p</mml:mi></mml:math></inline-formula>) has no effect on this population-level payoff when it’s costless, and decreases it when it’s costly. This Evolutionary Stable Strategy therefore emerges from intraspecific competition: Individuals benefit from paying the cost of switching to prevent being outcompeted by other individuals within the population, even if the end result is deleterious for the population as a whole.</p><p><italic>C. elegans</italic> individuals use stimuli coming from the environment (smells, tastes, temperature, oxygen, and carbon dioxide levels) and from other individuals (pheromones) to efficiently navigate their habitat. An important evolutionary adaptation in this regard is that the <italic>C. elegans</italic> preference for each of these stimuli can change through experience, including acclimation (<xref ref-type="bibr" rid="bib18">Fenk and de Bono, 2017</xref>) and associative learning phenomena (<xref ref-type="bibr" rid="bib2">Ardiel and Rankin, 2010</xref>; <xref ref-type="bibr" rid="bib10">Colbert and Bargmann, 1995</xref>; <xref ref-type="bibr" rid="bib40">Rankin, 2004</xref>). We have identified associative learning as the most plausible phenomenon underpinning the change in pheromone preference. During feeding, worms learn to give a positive or negative preference to pheromones depending on the context in which they experience them, in particular the presence or absence of food (<xref ref-type="bibr" rid="bib60">Wyatt, 2014</xref>). A similar learning process occurs in bumblebees that, in their natural habitat, do not land or probe flowers that have been recently visited and marked by chemical footprints left by themselves or other bees. It has been shown that only experienced foragers, that is those that learnt to associate the chemical footprints with the absence of nectar in marked flowers, can successfully avoid them and increase their overall nectar intake (<xref ref-type="bibr" rid="bib4">Ayasse and Jarau, 2014</xref>). This suggests that associative learning based on pairing pheromones or similar chemical signals with food availability might be frequently observed in animals feeding in groups, not only eusocial insects, as a strategy to increase food intake.</p><p>We have shown that dispersal of feeding stages of <italic>C. elegans</italic> from occupied patches is regulated by the recent experience of food availability and pheromones, which indicates, at any time, whether it is better to follow the scent of pheromones or to avoid it. A mechanism based on the synergistic interaction between food and pheromones also regulates <italic>C. elegans</italic> dispersal over longer time scales and, in general, its boom-and-bust life cycle (<xref ref-type="bibr" rid="bib17">Edison, 2009</xref>; <xref ref-type="bibr" rid="bib20">Frézal and Félix, 2015</xref>). Indeed, scarce food and high concentration of pheromones promote the entry into a resting stage (the dauer larva), allowing worms to survive unfavorable seasons and disperse to uncolonized rotten material, where abundant food, in turn, resumes development to adulthood (<xref ref-type="bibr" rid="bib20">Frézal and Félix, 2015</xref>). Our findings establish an interesting parallel between mechanisms promoting dispersal over short and long temporal scales and highlight the important role that non-dauer stages play in exploiting transient bacterial patches. They also point to the emergence of interesting group dynamics promoted by this synergistic interaction between food and pheromones, adding to the wealth of studies addressing aggregation behaviors in <italic>C. elegans</italic> (<xref ref-type="bibr" rid="bib14">Ding et al., 2019</xref>; <xref ref-type="bibr" rid="bib22">Greene et al., 2016</xref>; <xref ref-type="bibr" rid="bib53">Sugi et al., 2019</xref>).</p><p>Although we could not exclude the influence of the worms’ feeding status in driving the change of preference for specific ascaroside pheromones, we showed that <italic>C. elegans</italic> attraction to two ascarosides can be turned into repulsion. Ascr#5 and icas#9 are potent signaling cues that are usually detected in <italic>C. elegans</italic> exudates (<xref ref-type="bibr" rid="bib55">von Reuss et al., 2012</xref>), but other ascarosides can be abundant and the list of newly discovered compounds of the worm metabolism acting as signaling molecules is continuously expanding (<xref ref-type="bibr" rid="bib55">von Reuss et al., 2012</xref>). The ability to assign a positive or negative preference to the pheromone blend through associative learning might depend also on other byproducts of worm metabolism or derive from the presence of multiple ascaroside molecules acting synergistically (<xref ref-type="bibr" rid="bib48">Srinivasan et al., 2012</xref>). More studies are required to establish a link between associative learning and the composition of the pheromone blend, which is known to vary among developmental stages (<xref ref-type="bibr" rid="bib27">Kaplan et al., 2011</xref>), sexes (<xref ref-type="bibr" rid="bib26">Izrayelit et al., 2012</xref>) and strains (<xref ref-type="bibr" rid="bib13">Diaz et al., 2014</xref>), ultimately allowing the discovery of novel roles for <italic>C. elegans</italic> pheromones (<xref ref-type="bibr" rid="bib54">Viney and Harvey, 2017</xref>).</p><p>As a final remark, our results suggest that <italic>C. elegans</italic> preference for pheromones might not be innate, as it was previously stated (<xref ref-type="bibr" rid="bib22">Greene et al., 2016</xref>; <xref ref-type="bibr" rid="bib34">Macosko et al., 2009</xref>; <xref ref-type="bibr" rid="bib39">Pungaliya et al., 2009</xref>; <xref ref-type="bibr" rid="bib45">Simon and Sternberg, 2002</xref>; <xref ref-type="bibr" rid="bib48">Srinivasan et al., 2012</xref>; <xref ref-type="bibr" rid="bib47">Srinivasan et al., 2008</xref>) and question what it means to be a naive worm (see also <xref ref-type="bibr" rid="bib58">Webster and Rutz, 2020</xref>). Worms that we call ‘naive’ are directly assayed for chemotaxis after being simultaneously exposed to both bacterial food and ascaroside pheromones, which are continuously excreted by the animals during their growth (<xref ref-type="bibr" rid="bib27">Kaplan et al., 2011</xref>). Hence, it is possible that the attraction that ‘naive’ worms exhibit is due to the positive association with food that they learn to make during growth on the plate.</p><p>In conclusion, our study establishes a link between learning and social signals, providing a framework for further analysis unravelling the neuronal origin of the observed behaviors. However, the experiments presented here were performed with the natural isolate MY1. Thus, it remains to be tested if the same responses occur in the canonical lab strain N2, whose social behavior has changed due to laboratory domestication (<xref ref-type="bibr" rid="bib51">Sterken et al., 2015</xref>), and in other natural strains with a social life more similar to MY1 (<xref ref-type="bibr" rid="bib22">Greene et al., 2016</xref>). Nonetheless, by working with a natural isolate rather than N2, we could provide insights into the ecological significance of the inversion in the preference for pheromones and respond to the pressing need to further our knowledge of <italic>C. elegans</italic> ecology (<xref ref-type="bibr" rid="bib38">Petersen et al., 2015</xref>).</p></sec><sec id="s4" sec-type="materials|methods"><title>Materials and methods</title><sec id="s4-1"><title>Strains and culture conditions</title><p>We used a <italic>Caenorhabditis elegans</italic> strain recently isolated from the wild, MY1 (Lingen, Germany). The strain has been obtained from the Caenorhabditis Genetic Centre (CGC). Animals were grown at 21–23°C (room temperature) on nematode growth media (NGM) plates (100 mm) seeded with 200 μl of a saturated culture of <italic>E. coli</italic> OP50 bacteria (<xref ref-type="bibr" rid="bib52">Stiernagle, 2006</xref>). As for OP50 culture, a single colony was inoculated into 5 ml of LB medium and grown for 24 hr at 37°C.</p></sec><sec id="s4-2"><title>Pheromones</title><p>We obtained the crude pheromone blend by growing worms in liquid culture for 9 days (at room temperature and shaking at 250 rpm) (<xref ref-type="bibr" rid="bib55">von Reuss et al., 2012</xref>). Individuals from one plate were washed and added to a 1-l flask with 150 ml of S-medium inoculated with concentrated <italic>E. coli</italic> OP50 pellet made from 1 l of an overnight culture. Concentrated <italic>E. coli</italic> OP50 pellet was added any time the food supply was low, that is when the solution was no longer visibly cloudy (<xref ref-type="bibr" rid="bib52">Stiernagle, 2006</xref>). The pheromone blend was then obtained by collecting the supernatant and filter-sterilizing it twice. A new pheromone blend was produced every 3 months. Pure synthetic ascarosides (ascr#5 and icas#9) were obtained from the Schroeder lab and kept at −20°C in ethanol. Each time an experiment was performed, an aqueous solution at the desired molar concentration was prepared (10 μM for ascr#5 and 10 pM for icas#9). The control solvent for the pheromone blend is S-medium, while the control solvent for the pure ascarosides is an aqueous solution with the same amount of ethanol present in the ascaroside aqueous solution (<xref ref-type="bibr" rid="bib48">Srinivasan et al., 2012</xref>).</p></sec><sec id="s4-3"><title>Choice after food assay</title><p>It is a chemotaxis assay modified from <xref ref-type="bibr" rid="bib5">Bargmann and Horvitz, 1991</xref> and <xref ref-type="bibr" rid="bib41">Saeki et al., 2001</xref>, performed on naive worms that encounter a food patch before making the choice between the pheromone blend and the control solvent. We used 100 mm NGM plates in which we deployed 20 μl of the pheromone blend, 20 μl of control solvent and 15 μl of a diluted OP50 <italic>E. coli</italic> culture at equal distance from each other (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1A</xref>). In the pheromone and control spots, 2 μl of 0.5 M sodium azide was added in order to anesthetize the animals once they reached the spots. Since the anesthetic action of sodium azide lasts for about 2 hr in this set-up, another 1 μl was added two hours after the beginning of the assay in both spots. naive animals were placed close to the bacteria spot, so that they stop and feed in the patch before chemotaxis toward the two cues. Worms are left to wander freely on the assay plate for 5 hr. The number of worms around the two spots was counted every hour and the chemotaxis index was calculated based on the number of new worms that reached the two spots during each hour.</p></sec><sec id="s4-4"><title>Chemotaxis assay</title><p>Chemotaxis assay has been performed in 60 mm NGM plates, in which worms are given the choice between pheromone (either 20 μl of the pheromone blend or 20 μl of a pure ascaroside in aqueous solution) and a control solvent (20 μl) (<xref ref-type="bibr" rid="bib5">Bargmann and Horvitz, 1991</xref>; <xref ref-type="bibr" rid="bib41">Saeki et al., 2001</xref>). The two spots are deployed ~3 cm apart from each other (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1B</xref>). Shortly before the start of the assay, 1 μl of 0.5 M sodium azide is added to both spots in order to anesthetize the animals once they reach the spots. Animals, either naive or trained, are placed equidistant from the two spots and left to wander on the assay plate for 1 hr at room temperature (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1B</xref>). The average number of worms in each experiment is indicated in the figure captions. The assay plates were then cooled at 4°C and the number of worms around each spot was counted using a lens. The chemotaxis index is then calculated as <inline-formula><mml:math id="inf40"><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mi/><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mi/><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math></inline-formula>, where <inline-formula><mml:math id="inf41"><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> is the number of worms within 1 cm of the center of the pheromone spot, while <inline-formula><mml:math id="inf42"><mml:msub><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> is the number of worms within 1 cm of the center of the control spot. The number of independent experiments (performed in different days) is indicated in each figure caption. For each experiment, we usually performed 10 replicated assays for each scenario. The average number of worms used in each replicated assay across all experiments is ~ 50.</p></sec><sec id="s4-5"><title>Conditioning experiments</title><p>Hermaphrodite individuals of the MY1 strain are grown until they become young adults in NGM plates seeded with 200 μl of saturated <italic>E. coli</italic> OP50 bacteria. Then, animals are washed off the plates with wash buffer (M9 + 0.1% triton), transferred to an Eppendorf tube and washed twice by spinning down the worms and replacing the supernatant with fresh wash buffer each time. After that, animals are transferred to conditioning plates. In the first series of experiments, the four different scenarios derive from all the possible combinations of ± <italic>food</italic> and ± <italic>pheromone blend</italic>. Plates are prepared ~16 hr before the training starts, so that bacteria can grow and form a lawn. NGM plates are seeded with ±200 μl of saturated <italic>E. coli</italic> OP50 culture and ±200 μl of pheromone blend. Animals spend 5 hr in the conditioning plates at room temperature before being assayed for chemotaxis to the pheromone blend.</p><p>In the series of experiments with the repellent, the four different scenarios derive from all the possible combinations of ± <italic>repellent</italic> (glycerol) and ± <italic>pheromone blend</italic>. Conditioning plates are prepared ~1 before the start of the experiment and are NGM plates seeded with 200 μl of saturated <italic>E. coli</italic> OP50 culture ± 0.5 M glycerol and ±200 μl of pheromone blend. To keep the concentration constant, when the pheromone blend was not added, we dilute OP50 with μl of S-medium. Animals stay in the conditioning plates for one hour at room temperature before being assayed for chemotaxis to the pheromone blend.</p><p>In the experiments with pure ascarosides <italic>ascr#5</italic> and <italic>icas#9</italic>, the four different scenarios derive from all the possible combinations of ± <italic>food</italic> and ± <italic>pure ascaroside</italic> (in aqueous solution) and are prepared as the experiment with food and the pheromone blend. However, the concentration of ascaroside that was added in the conditioning plate was higher than the concentration at which the worms were tested for chemotaxis (for <italic>ascr#5</italic> was 10 μM, while for <italic>icas#9</italic> was 10 pM icas#9) to compensate for the diffusion of the ascaroside throughout the agar in the conditioning plates. Ascr#5 was added at a concentration of 100 μM onto conditioning plates, while icas#9 was added at a concentration of 1 μM. Worms spent 5 hr in the conditioning plates at room temperature, after which they are assayed for pheromone chemotaxis.</p></sec></sec></body><back><ack id="ack"><title>Acknowledgements</title><p>The authors thank Sreekanth Chalasani and three anonymous reviewers for their constructive feedback on the paper; the members of the Gore lab for comments on the earlier versions of the manuscript; Ying K Zhang for assistance with the synthesis of ascarosides and Jonathan Friedman for feedback on the model. The <italic>C. elegans</italic> strain we used was provided by the CGC, which is funded by NIH Office of Research Infrastructure Programs (P40 OD010440). This work was supported by NIH and the Schmidt Foundation. APE was funded by EMBO Postdoctoral Fellowship Grant ALTF 818–2014, Human Frontier Science Foundation Postdoctoral Fellowship Grant LT000537/2015, and a CNRS Momentum grant.</p></ack><sec id="s5" sec-type="additional-information"><title>Additional information</title><fn-group content-type="competing-interest"><title>Competing interests</title><fn fn-type="COI-statement" id="conf1"><p>No competing interests declared</p></fn></fn-group><fn-group content-type="author-contribution"><title>Author contributions</title><fn fn-type="con" id="con1"><p>Conceptualization, Data curation, Formal analysis, Visualization, Writing - original draft</p></fn><fn fn-type="con" id="con2"><p>Conceptualization, Formal analysis, Funding acquisition, Writing - original draft</p></fn><fn fn-type="con" id="con3"><p>Resources, Writing - original draft</p></fn><fn fn-type="con" id="con4"><p>Conceptualization, Supervision, Funding acquisition, Writing - original draft</p></fn></fn-group></sec><sec id="s6" sec-type="supplementary-material"><title>Additional files</title><supplementary-material id="transrepform"><label>Transparent reporting form</label><media mime-subtype="pdf" mimetype="application" xlink:href="elife-58144-transrepform-v1.pdf"/></supplementary-material></sec><sec id="s7" sec-type="data-availability"><title>Data availability</title><p>All data generated or analysed during this study are included in the manuscript and supporting files. Source data files have been provided for Figure 1, Figure 3, Figure 3—figure supplement 1 and Figure. 4.</p></sec><ref-list><title>References</title><ref id="bib1"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Abu Baker</surname> <given-names>MA</given-names></name><name><surname>Brown</surname> <given-names>JS</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Foraging in space and time structure an African small mammal community</article-title><source>Oecologia</source><volume>175</volume><fpage>521</fpage><lpage>535</lpage><pub-id pub-id-type="doi">10.1007/s00442-014-2926-6</pub-id><pub-id pub-id-type="pmid">24648024</pub-id></element-citation></ref><ref id="bib2"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ardiel</surname> <given-names>EL</given-names></name><name><surname>Rankin</surname> <given-names>CH</given-names></name></person-group><year iso-8601-date="2010">2010</year><article-title>An elegant mind: learning and memory in <italic>Caenorhabditis elegans</italic></article-title><source>Learning &amp; Memory</source><volume>17</volume><fpage>191</fpage><lpage>201</lpage><pub-id pub-id-type="doi">10.1101/lm.960510</pub-id><pub-id pub-id-type="pmid">20335372</pub-id></element-citation></ref><ref id="bib3"><element-citation publication-type="confproc"><person-group person-group-type="author"><name><surname>Aubert-Kato</surname> <given-names>N</given-names></name><name><surname>Witkowski</surname> <given-names>O</given-names></name><name><surname>Ikegami</surname> <given-names>T</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>The hunger games: embodied agents evolving foraging strategies on the frugal-greedy spectrum</article-title><conf-name>Artificial Life Conference Proceedings</conf-name><fpage>357</fpage><lpage>364</lpage><pub-id pub-id-type="doi">10.1162/978-0-262-33027-5-ch065</pub-id></element-citation></ref><ref id="bib4"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ayasse</surname> <given-names>M</given-names></name><name><surname>Jarau</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Chemical ecology of bumble bees</article-title><source>Annual Review of Entomology</source><volume>59</volume><fpage>299</fpage><lpage>319</lpage><pub-id pub-id-type="doi">10.1146/annurev-ento-011613-161949</pub-id><pub-id pub-id-type="pmid">24160431</pub-id></element-citation></ref><ref id="bib5"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bargmann</surname> <given-names>CI</given-names></name><name><surname>Horvitz</surname> <given-names>HR</given-names></name></person-group><year iso-8601-date="1991">1991</year><article-title>Chemosensory neurons with overlapping functions direct chemotaxis to multiple chemicals in <italic>C. elegans</italic></article-title><source>Neuron</source><volume>7</volume><fpage>729</fpage><lpage>742</lpage><pub-id pub-id-type="doi">10.1016/0896-6273(91)90276-6</pub-id><pub-id pub-id-type="pmid">1660283</pub-id></element-citation></ref><ref id="bib6"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bautista</surname> <given-names>LM</given-names></name><name><surname>Alonso</surname> <given-names>JC</given-names></name><name><surname>Alonso</surname> <given-names>JA</given-names></name></person-group><year iso-8601-date="1995">1995</year><article-title>A Field Test of Ideal Free Distribution in Flock-Feeding Common Cranes</article-title><source>The Journal of Animal Ecology</source><volume>64</volume><elocation-id>747</elocation-id><pub-id pub-id-type="doi">10.2307/5853</pub-id></element-citation></ref><ref id="bib7"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Calhoun</surname> <given-names>AJ</given-names></name><name><surname>Chalasani</surname> <given-names>SH</given-names></name><name><surname>Sharpee</surname> <given-names>TO</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Maximally informative foraging by <italic>Caenorhabditis elegans</italic></article-title><source>eLife</source><volume>3</volume><elocation-id>e04220</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.04220</pub-id></element-citation></ref><ref id="bib8"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Charnov</surname> <given-names>EL</given-names></name></person-group><year iso-8601-date="1976">1976</year><article-title>Optimal foraging, the marginal value theorem</article-title><source>Theoretical Population Biology</source><volume>9</volume><fpage>129</fpage><lpage>136</lpage><pub-id pub-id-type="doi">10.1016/0040-5809(76)90040-X</pub-id><pub-id pub-id-type="pmid">1273796</pub-id></element-citation></ref><ref id="bib9"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Choe</surname> <given-names>A</given-names></name><name><surname>von Reuss</surname> <given-names>SH</given-names></name><name><surname>Kogan</surname> <given-names>D</given-names></name><name><surname>Gasser</surname> <given-names>RB</given-names></name><name><surname>Platzer</surname> <given-names>EG</given-names></name><name><surname>Schroeder</surname> <given-names>FC</given-names></name><name><surname>Sternberg</surname> <given-names>PW</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Ascaroside signaling is widely conserved among nematodes</article-title><source>Current Biology</source><volume>22</volume><fpage>772</fpage><lpage>780</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2012.03.024</pub-id><pub-id pub-id-type="pmid">22503501</pub-id></element-citation></ref><ref id="bib10"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Colbert</surname> <given-names>HA</given-names></name><name><surname>Bargmann</surname> <given-names>CI</given-names></name></person-group><year iso-8601-date="1995">1995</year><article-title>Odorant-specific adaptation pathways generate olfactory plasticity in <italic>C. elegans</italic></article-title><source>Neuron</source><volume>14</volume><fpage>803</fpage><lpage>812</lpage><pub-id pub-id-type="doi">10.1016/0896-6273(95)90224-4</pub-id><pub-id pub-id-type="pmid">7718242</pub-id></element-citation></ref><ref id="bib11"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Couzin</surname> <given-names>ID</given-names></name><name><surname>Krause</surname> <given-names>J</given-names></name><name><surname>Franks</surname> <given-names>NR</given-names></name><name><surname>Levin</surname> <given-names>SA</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>Effective leadership and decision-making in animal groups on the move</article-title><source>Nature</source><volume>433</volume><fpage>513</fpage><lpage>516</lpage><pub-id pub-id-type="doi">10.1038/nature03236</pub-id><pub-id pub-id-type="pmid">15690039</pub-id></element-citation></ref><ref id="bib12"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Cowie</surname> <given-names>RJ</given-names></name></person-group><year iso-8601-date="1977">1977</year><article-title>Optimal foraging in great tits (Parus major)</article-title><source>Nature</source><volume>268</volume><fpage>137</fpage><lpage>139</lpage><pub-id pub-id-type="doi">10.1038/268137a0</pub-id></element-citation></ref><ref id="bib13"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Diaz</surname> <given-names>SA</given-names></name><name><surname>Brunet</surname> <given-names>V</given-names></name><name><surname>Lloyd-Jones</surname> <given-names>GC</given-names></name><name><surname>Spinner</surname> <given-names>W</given-names></name><name><surname>Wharam</surname> <given-names>B</given-names></name><name><surname>Viney</surname> <given-names>M</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Diverse and potentially manipulative signalling with ascarosides in the model nematode <italic>C. elegans</italic></article-title><source>BMC Evolutionary Biology</source><volume>14</volume><elocation-id>46</elocation-id><pub-id pub-id-type="doi">10.1186/1471-2148-14-46</pub-id><pub-id pub-id-type="pmid">24618411</pub-id></element-citation></ref><ref id="bib14"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ding</surname> <given-names>SS</given-names></name><name><surname>Schumacher</surname> <given-names>LJ</given-names></name><name><surname>Javer</surname> <given-names>AE</given-names></name><name><surname>Endres</surname> <given-names>RG</given-names></name><name><surname>Brown</surname> <given-names>AE</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Shared behavioral mechanisms underlie <italic>C. elegans</italic> aggregation and swarming</article-title><source>eLife</source><volume>8</volume><elocation-id>e43318</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.43318</pub-id><pub-id pub-id-type="pmid">31021320</pub-id></element-citation></ref><ref id="bib15"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ding</surname> <given-names>SS</given-names></name><name><surname>Romenskyy</surname> <given-names>M</given-names></name><name><surname>Sarkisyan</surname> <given-names>KS</given-names></name><name><surname>Brown</surname> <given-names>AEX</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Measuring <italic>Caenorhabditis elegans</italic> Spatial Foraging and Food Intake Using Bioluminescent Bacteria</article-title><source>Genetics</source><volume>214</volume><fpage>577</fpage><lpage>587</lpage><pub-id pub-id-type="doi">10.1534/genetics.119.302804</pub-id><pub-id pub-id-type="pmid">31911453</pub-id></element-citation></ref><ref id="bib16"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Driessen</surname> <given-names>G</given-names></name><name><surname>Bernstein</surname> <given-names>C</given-names></name></person-group><year iso-8601-date="1999">1999</year><article-title>Patch departure mechanisms and optimal host exploitation in an insect parasitoid</article-title><source>Journal of Animal Ecology</source><volume>68</volume><fpage>445</fpage><lpage>459</lpage><pub-id pub-id-type="doi">10.1046/j.1365-2656.1999.00296.x</pub-id></element-citation></ref><ref id="bib17"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Edison</surname> <given-names>AS</given-names></name></person-group><year iso-8601-date="2009">2009</year><article-title><italic>Caenorhabditis elegans</italic> pheromones regulate multiple complex behaviors</article-title><source>Current Opinion in Neurobiology</source><volume>19</volume><fpage>378</fpage><lpage>388</lpage><pub-id pub-id-type="doi">10.1016/j.conb.2009.07.007</pub-id><pub-id pub-id-type="pmid">19665885</pub-id></element-citation></ref><ref id="bib18"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Fenk</surname> <given-names>LA</given-names></name><name><surname>de Bono</surname> <given-names>M</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>Memory of recent oxygen experience switches pheromone valence in <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>114</volume><fpage>4195</fpage><lpage>4200</lpage><pub-id pub-id-type="doi">10.1073/pnas.1618934114</pub-id><pub-id pub-id-type="pmid">28373553</pub-id></element-citation></ref><ref id="bib19"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Fretwell</surname> <given-names>SD</given-names></name><name><surname>Lucas</surname> <given-names>HL</given-names></name></person-group><year iso-8601-date="1969">1969</year><article-title>On territorial behavior and other factors influencing habitat distribution in birds</article-title><source>Acta Biotheoretica</source><volume>19</volume><fpage>16</fpage><lpage>36</lpage><pub-id pub-id-type="doi">10.1007/BF01601953</pub-id></element-citation></ref><ref id="bib20"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Frézal</surname> <given-names>L</given-names></name><name><surname>Félix</surname> <given-names>M-A</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title><italic>C. elegans</italic> outside the petri dish</article-title><source>eLife</source><volume>4</volume><elocation-id>e05849</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.05849</pub-id></element-citation></ref><ref id="bib21"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Giraldeau</surname> <given-names>L-A</given-names></name><name><surname>Caraco</surname> <given-names>T</given-names></name></person-group><year iso-8601-date="2000">2000</year><source>Social Foraging Theory</source><publisher-loc>New Jersey, United States</publisher-loc><publisher-name>Princeton University Press</publisher-name></element-citation></ref><ref id="bib22"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Greene</surname> <given-names>JS</given-names></name><name><surname>Brown</surname> <given-names>M</given-names></name><name><surname>Dobosiewicz</surname> <given-names>M</given-names></name><name><surname>Ishida</surname> <given-names>IG</given-names></name><name><surname>Macosko</surname> <given-names>EZ</given-names></name><name><surname>Zhang</surname> <given-names>X</given-names></name><name><surname>Butcher</surname> <given-names>RA</given-names></name><name><surname>Cline</surname> <given-names>DJ</given-names></name><name><surname>McGrath</surname> <given-names>PT</given-names></name><name><surname>Bargmann</surname> <given-names>CI</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Balancing selection shapes density-dependent foraging behaviour</article-title><source>Nature</source><volume>539</volume><fpage>254</fpage><lpage>258</lpage><pub-id pub-id-type="doi">10.1038/nature19848</pub-id><pub-id pub-id-type="pmid">27799655</pub-id></element-citation></ref><ref id="bib23"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Harvey</surname> <given-names>SC</given-names></name></person-group><year iso-8601-date="2009">2009</year><article-title>Non-dauer larval dispersal in <italic>Caenorhabditis elegans</italic></article-title><source>Journal of Experimental Zoology. Part B, Molecular and Developmental Evolution</source><volume>312B</volume><fpage>224</fpage><lpage>230</lpage><pub-id pub-id-type="doi">10.1002/jez.b.21287</pub-id></element-citation></ref><ref id="bib24"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Houston</surname> <given-names>AI</given-names></name><name><surname>McNamara</surname> <given-names>JM</given-names></name></person-group><year iso-8601-date="1987">1987</year><article-title>Switching between resources and the ideal free distribution</article-title><source>Animal Behaviour</source><volume>35</volume><fpage>301</fpage><lpage>302</lpage><pub-id pub-id-type="doi">10.1016/S0003-3472(87)80241-5</pub-id></element-citation></ref><ref id="bib25"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hukema</surname> <given-names>RK</given-names></name><name><surname>Rademakers</surname> <given-names>S</given-names></name><name><surname>Jansen</surname> <given-names>G</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>Gustatory plasticity in <italic>C. elegans</italic> involves integration of negative cues and NaCl taste mediated by serotonin, dopamine, and glutamate</article-title><source>Learning &amp; Memory</source><volume>15</volume><fpage>829</fpage><lpage>836</lpage><pub-id pub-id-type="doi">10.1101/lm.994408</pub-id><pub-id pub-id-type="pmid">18984564</pub-id></element-citation></ref><ref id="bib26"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Izrayelit</surname> <given-names>Y</given-names></name><name><surname>Srinivasan</surname> <given-names>J</given-names></name><name><surname>Campbell</surname> <given-names>SL</given-names></name><name><surname>Jo</surname> <given-names>Y</given-names></name><name><surname>von Reuss</surname> <given-names>SH</given-names></name><name><surname>Genoff</surname> <given-names>MC</given-names></name><name><surname>Sternberg</surname> <given-names>PW</given-names></name><name><surname>Schroeder</surname> <given-names>FC</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Targeted metabolomics reveals a male pheromone and sex-specific ascaroside biosynthesis in <italic>Caenorhabditis elegans</italic></article-title><source>ACS Chemical Biology</source><volume>7</volume><fpage>1321</fpage><lpage>1325</lpage><pub-id pub-id-type="doi">10.1021/cb300169c</pub-id><pub-id pub-id-type="pmid">22662967</pub-id></element-citation></ref><ref id="bib27"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kaplan</surname> <given-names>F</given-names></name><name><surname>Srinivasan</surname> <given-names>J</given-names></name><name><surname>Mahanti</surname> <given-names>P</given-names></name><name><surname>Ajredini</surname> <given-names>R</given-names></name><name><surname>Durak</surname> <given-names>O</given-names></name><name><surname>Nimalendran</surname> <given-names>R</given-names></name><name><surname>Sternberg</surname> <given-names>PW</given-names></name><name><surname>Teal</surname> <given-names>PE</given-names></name><name><surname>Schroeder</surname> <given-names>FC</given-names></name><name><surname>Edison</surname> <given-names>AS</given-names></name><name><surname>Alborn</surname> <given-names>HT</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Ascaroside expression in <italic>Caenorhabditis elegans</italic> is strongly dependent on diet and developmental stage</article-title><source>PLOS ONE</source><volume>6</volume><elocation-id>e17804</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pone.0017804</pub-id><pub-id pub-id-type="pmid">21423575</pub-id></element-citation></ref><ref id="bib28"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Karpas</surname> <given-names>ED</given-names></name><name><surname>Shklarsh</surname> <given-names>A</given-names></name><name><surname>Schneidman</surname> <given-names>E</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>Information socialtaxis and efficient collective behavior emerging in groups of information-seeking agents</article-title><source>PNAS</source><volume>114</volume><fpage>5589</fpage><lpage>5594</lpage><pub-id pub-id-type="doi">10.1073/pnas.1618055114</pub-id><pub-id pub-id-type="pmid">28507154</pub-id></element-citation></ref><ref id="bib29"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kennedy</surname> <given-names>M</given-names></name><name><surname>Gray</surname> <given-names>RD</given-names></name></person-group><year iso-8601-date="1993">1993</year><article-title>Can Ecological Theory Predict the Distribution of Foraging Animals? A Critical Analysis of Experiments on the Ideal Free Distribution</article-title><source>Oikos</source><volume>68</volume><fpage>158</fpage><lpage>166</lpage><pub-id pub-id-type="doi">10.2307/3545322</pub-id></element-citation></ref><ref id="bib30"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Krebs</surname> <given-names>JR</given-names></name><name><surname>Ryan</surname> <given-names>JC</given-names></name><name><surname>Charnov</surname> <given-names>EL</given-names></name></person-group><year iso-8601-date="1974">1974</year><article-title>Hunting by expectation or optimal foraging? A study of patch use by chickadees</article-title><source>Animal Behaviour</source><volume>22</volume><fpage>953</fpage><lpage>IN3</lpage><pub-id pub-id-type="doi">10.1016/0003-3472(74)90018-9</pub-id></element-citation></ref><ref id="bib31"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Krebs</surname> <given-names>JR</given-names></name><name><surname>Kacelnik</surname> <given-names>A</given-names></name><name><surname>Taylor</surname> <given-names>P</given-names></name></person-group><year iso-8601-date="1978">1978</year><article-title>Test of optimal sampling by foraging great tits</article-title><source>Nature</source><volume>275</volume><fpage>27</fpage><lpage>31</lpage><pub-id pub-id-type="doi">10.1038/275027a0</pub-id></element-citation></ref><ref id="bib32"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Krebs</surname> <given-names>JR</given-names></name><name><surname>Inman</surname> <given-names>AJ</given-names></name></person-group><year iso-8601-date="1992">1992</year><article-title>Learning and foraging: individuals, groups, and populations</article-title><source>The American Naturalist</source><volume>140 Suppl 1</volume><fpage>S63</fpage><lpage>S84</lpage><pub-id pub-id-type="doi">10.1086/285397</pub-id><pub-id pub-id-type="pmid">19426027</pub-id></element-citation></ref><ref id="bib33"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ludewig</surname> <given-names>A</given-names></name><name><surname>Schroeder</surname> <given-names>FC</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>Ascaroside signaling in <italic>C. elegans</italic></article-title><source>WormBook</source><volume>22</volume><fpage>1</fpage><lpage>22</lpage><pub-id pub-id-type="doi">10.1895/wormbook.1.155.1</pub-id></element-citation></ref><ref id="bib34"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Macosko</surname> <given-names>EZ</given-names></name><name><surname>Pokala</surname> <given-names>N</given-names></name><name><surname>Feinberg</surname> <given-names>EH</given-names></name><name><surname>Chalasani</surname> <given-names>SH</given-names></name><name><surname>Butcher</surname> <given-names>RA</given-names></name><name><surname>Clardy</surname> <given-names>J</given-names></name><name><surname>Bargmann</surname> <given-names>CI</given-names></name></person-group><year iso-8601-date="2009">2009</year><article-title>A hub-and-spoke circuit drives pheromone attraction and social behaviour in <italic>C. elegans</italic></article-title><source>Nature</source><volume>458</volume><fpage>1171</fpage><lpage>1175</lpage><pub-id pub-id-type="doi">10.1038/nature07886</pub-id><pub-id pub-id-type="pmid">19349961</pub-id></element-citation></ref><ref id="bib35"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Maynard Smith</surname> <given-names>J</given-names></name></person-group><year iso-8601-date="1982">1982</year><source>Evolution and the Theory of Games</source><publisher-loc>Cambridge</publisher-loc><publisher-name>Cambridge University Press</publisher-name></element-citation></ref><ref id="bib36"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Milward</surname> <given-names>K</given-names></name><name><surname>Busch</surname> <given-names>KE</given-names></name><name><surname>Murphy</surname> <given-names>RJ</given-names></name><name><surname>de Bono</surname> <given-names>M</given-names></name><name><surname>Olofsson</surname> <given-names>B</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Neuronal and molecular substrates for optimal foraging in <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>108</volume><fpage>20672</fpage><lpage>20677</lpage><pub-id pub-id-type="doi">10.1073/pnas.1106134109</pub-id><pub-id pub-id-type="pmid">22135454</pub-id></element-citation></ref><ref id="bib37"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Oaten</surname> <given-names>A</given-names></name></person-group><year iso-8601-date="1977">1977</year><article-title>Optimal foraging in patches: a case for stochasticity</article-title><source>Theoretical Population Biology</source><volume>12</volume><fpage>263</fpage><lpage>285</lpage><pub-id pub-id-type="doi">10.1016/0040-5809(77)90046-6</pub-id><pub-id pub-id-type="pmid">564087</pub-id></element-citation></ref><ref id="bib38"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Petersen</surname> <given-names>C</given-names></name><name><surname>Dirksen</surname> <given-names>P</given-names></name><name><surname>Schulenburg</surname> <given-names>H</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Why we need more ecology for genetic models such as <italic>C. elegans</italic></article-title><source>Trends in Genetics</source><volume>31</volume><fpage>120</fpage><lpage>127</lpage><pub-id pub-id-type="doi">10.1016/j.tig.2014.12.001</pub-id><pub-id pub-id-type="pmid">25577479</pub-id></element-citation></ref><ref id="bib39"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pungaliya</surname> <given-names>C</given-names></name><name><surname>Srinivasan</surname> <given-names>J</given-names></name><name><surname>Fox</surname> <given-names>BW</given-names></name><name><surname>Malik</surname> <given-names>RU</given-names></name><name><surname>Ludewig</surname> <given-names>AH</given-names></name><name><surname>Sternberg</surname> <given-names>PW</given-names></name><name><surname>Schroeder</surname> <given-names>FC</given-names></name></person-group><year iso-8601-date="2009">2009</year><article-title>A shortcut to identifying small molecule signals that regulate behavior and development in <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>106</volume><fpage>7708</fpage><lpage>7713</lpage><pub-id pub-id-type="doi">10.1073/pnas.0811918106</pub-id><pub-id pub-id-type="pmid">19346493</pub-id></element-citation></ref><ref id="bib40"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Rankin</surname> <given-names>CH</given-names></name></person-group><year iso-8601-date="2004">2004</year><article-title>Invertebrate learning: what can't a worm learn?</article-title><source>Current Biology</source><volume>14</volume><fpage>R617</fpage><lpage>R618</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2004.07.044</pub-id><pub-id pub-id-type="pmid">15296777</pub-id></element-citation></ref><ref id="bib41"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Saeki</surname> <given-names>S</given-names></name><name><surname>Yamamoto</surname> <given-names>M</given-names></name><name><surname>Iino</surname> <given-names>Y</given-names></name></person-group><year iso-8601-date="2001">2001</year><article-title>Plasticity of chemotaxis revealed by paired presentation of a chemoattractant and starvation in the nematode <italic>Caenorhabditis elegans</italic></article-title><source>Journal of Experimental Biology</source><volume>204</volume><fpage>1757</fpage><lpage>1764</lpage><pub-id pub-id-type="doi">10.1242/jeb.204.10.1757</pub-id><pub-id pub-id-type="pmid">11316496</pub-id></element-citation></ref><ref id="bib42"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sakai</surname> <given-names>N</given-names></name><name><surname>Iwata</surname> <given-names>R</given-names></name><name><surname>Yokoi</surname> <given-names>S</given-names></name><name><surname>Butcher</surname> <given-names>RA</given-names></name><name><surname>Clardy</surname> <given-names>J</given-names></name><name><surname>Tomioka</surname> <given-names>M</given-names></name><name><surname>Iino</surname> <given-names>Y</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>A sexually conditioned switch of chemosensory behavior in <italic>C. elegans</italic></article-title><source>PLOS ONE</source><volume>8</volume><elocation-id>e68676</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pone.0068676</pub-id><pub-id pub-id-type="pmid">23861933</pub-id></element-citation></ref><ref id="bib43"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Schulenburg</surname> <given-names>H</given-names></name><name><surname>Félix</surname> <given-names>MA</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>The Natural Biotic Environment of <italic>Caenorhabditis elegans</italic></article-title><source>Genetics</source><volume>206</volume><fpage>55</fpage><lpage>86</lpage><pub-id pub-id-type="doi">10.1534/genetics.116.195511</pub-id><pub-id pub-id-type="pmid">28476862</pub-id></element-citation></ref><ref id="bib44"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Searle</surname> <given-names>KR</given-names></name><name><surname>Thompson Hobbs</surname> <given-names>N</given-names></name><name><surname>Shipley</surname> <given-names>LA</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>Should I stay or should I go? Patch departure decisions by herbivores at multiple scales</article-title><source>Oikos</source><volume>111</volume><fpage>417</fpage><lpage>424</lpage><pub-id pub-id-type="doi">10.1111/j.0030-1299.2005.13918.x</pub-id></element-citation></ref><ref id="bib45"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Simon</surname> <given-names>JM</given-names></name><name><surname>Sternberg</surname> <given-names>PW</given-names></name></person-group><year iso-8601-date="2002">2002</year><article-title>Evidence of a mate-finding cue in the hermaphrodite nematode <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>99</volume><fpage>1598</fpage><lpage>1603</lpage><pub-id pub-id-type="doi">10.1073/pnas.032225799</pub-id><pub-id pub-id-type="pmid">11818544</pub-id></element-citation></ref><ref id="bib46"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Smith</surname> <given-names>JM</given-names></name><name><surname>Maynard Smith</surname> <given-names>J</given-names></name></person-group><year iso-8601-date="1974">1974</year><article-title>The theory of games and the evolution of animal conflicts</article-title><source>Journal of Theoretical Biology</source><volume>47</volume><fpage>209</fpage><lpage>221</lpage><pub-id pub-id-type="doi">10.1016/0022-5193(74)90110-6</pub-id><pub-id pub-id-type="pmid">4459582</pub-id></element-citation></ref><ref id="bib47"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Srinivasan</surname> <given-names>J</given-names></name><name><surname>Kaplan</surname> <given-names>F</given-names></name><name><surname>Ajredini</surname> <given-names>R</given-names></name><name><surname>Zachariah</surname> <given-names>C</given-names></name><name><surname>Alborn</surname> <given-names>HT</given-names></name><name><surname>Teal</surname> <given-names>PE</given-names></name><name><surname>Malik</surname> <given-names>RU</given-names></name><name><surname>Edison</surname> <given-names>AS</given-names></name><name><surname>Sternberg</surname> <given-names>PW</given-names></name><name><surname>Schroeder</surname> <given-names>FC</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>A blend of small molecules regulates both mating and development in <italic>Caenorhabditis elegans</italic></article-title><source>Nature</source><volume>454</volume><fpage>1115</fpage><lpage>1118</lpage><pub-id pub-id-type="doi">10.1038/nature07168</pub-id><pub-id pub-id-type="pmid">18650807</pub-id></element-citation></ref><ref id="bib48"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Srinivasan</surname> <given-names>J</given-names></name><name><surname>von Reuss</surname> <given-names>SH</given-names></name><name><surname>Bose</surname> <given-names>N</given-names></name><name><surname>Zaslaver</surname> <given-names>A</given-names></name><name><surname>Mahanti</surname> <given-names>P</given-names></name><name><surname>Ho</surname> <given-names>MC</given-names></name><name><surname>O'Doherty</surname> <given-names>OG</given-names></name><name><surname>Edison</surname> <given-names>AS</given-names></name><name><surname>Sternberg</surname> <given-names>PW</given-names></name><name><surname>Schroeder</surname> <given-names>FC</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>A modular library of small molecule signals regulates social behaviors in <italic>Caenorhabditis elegans</italic></article-title><source>PLOS Biology</source><volume>10</volume><elocation-id>e1001237</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pbio.1001237</pub-id><pub-id pub-id-type="pmid">22253572</pub-id></element-citation></ref><ref id="bib49"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Stephens</surname> <given-names>D</given-names></name><name><surname>Krebs</surname> <given-names>J</given-names></name></person-group><year iso-8601-date="1986">1986</year><source>Foraging Theory</source><publisher-loc>New Jersey, United States</publisher-loc><publisher-name>Princeton University Press</publisher-name></element-citation></ref><ref id="bib50"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Stephens</surname> <given-names>DW</given-names></name><name><surname>Krebs</surname> <given-names>JR</given-names></name></person-group><year iso-8601-date="1987">1987</year><source>Foraging Theory</source><publisher-loc>New Jersey, United States</publisher-loc><publisher-name>Princeton University Press</publisher-name></element-citation></ref><ref id="bib51"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sterken</surname> <given-names>MG</given-names></name><name><surname>Snoek</surname> <given-names>LB</given-names></name><name><surname>Kammenga</surname> <given-names>JE</given-names></name><name><surname>Andersen</surname> <given-names>EC</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>The laboratory domestication of <italic>Caenorhabditis elegans</italic></article-title><source>Trends in Genetics</source><volume>31</volume><fpage>224</fpage><lpage>231</lpage><pub-id pub-id-type="doi">10.1016/j.tig.2015.02.009</pub-id><pub-id pub-id-type="pmid">25804345</pub-id></element-citation></ref><ref id="bib52"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Stiernagle</surname> <given-names>T</given-names></name></person-group><year iso-8601-date="2006">2006</year><article-title>Maintenance of <italic>C. elegans</italic></article-title><source>WormBook</source><fpage>1</fpage><lpage>11</lpage><pub-id pub-id-type="doi">10.1895/wormbook.1.101.1</pub-id><pub-id pub-id-type="pmid">18050451</pub-id></element-citation></ref><ref id="bib53"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sugi</surname> <given-names>T</given-names></name><name><surname>Ito</surname> <given-names>H</given-names></name><name><surname>Nishimura</surname> <given-names>M</given-names></name><name><surname>Nagai</surname> <given-names>KH</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title><italic>C. elegans</italic> collectively forms dynamical networks</article-title><source>Nature Communications</source><volume>10</volume><fpage>1</fpage><lpage>9</lpage><pub-id pub-id-type="doi">10.1038/s41467-019-08537-y</pub-id></element-citation></ref><ref id="bib54"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Viney</surname> <given-names>M</given-names></name><name><surname>Harvey</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>Reimagining pheromone signalling in the model nematode <italic>Caenorhabditis elegans</italic></article-title><source>PLOS Genetics</source><volume>13</volume><elocation-id>e1007046</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.1007046</pub-id></element-citation></ref><ref id="bib55"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>von Reuss</surname> <given-names>SH</given-names></name><name><surname>Bose</surname> <given-names>N</given-names></name><name><surname>Srinivasan</surname> <given-names>J</given-names></name><name><surname>Yim</surname> <given-names>JJ</given-names></name><name><surname>Judkins</surname> <given-names>JC</given-names></name><name><surname>Sternberg</surname> <given-names>PW</given-names></name><name><surname>Schroeder</surname> <given-names>FC</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Comparative metabolomics reveals biogenesis of ascarosides, a modular library of small-molecule signals in <italic>C. elegans</italic></article-title><source>Journal of the American Chemical Society</source><volume>134</volume><fpage>1817</fpage><lpage>1824</lpage><pub-id pub-id-type="doi">10.1021/ja210202y</pub-id><pub-id pub-id-type="pmid">22239548</pub-id></element-citation></ref><ref id="bib56"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Wajnberg</surname> <given-names>E</given-names></name><name><surname>Bernstein</surname> <given-names>C</given-names></name><name><surname>van Alphen</surname> <given-names>J</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>Behavioral ecology of insect parasitoids: from theoretical approaches to field applications</article-title><source>ChoiceReviews</source><volume>46</volume><fpage>56</fpage><lpage>83</lpage><pub-id pub-id-type="doi">10.5860/choice.46-0883</pub-id></element-citation></ref><ref id="bib57"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Watanabe</surname> <given-names>YY</given-names></name><name><surname>Ito</surname> <given-names>M</given-names></name><name><surname>Takahashi</surname> <given-names>A</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Testing optimal foraging theory in a penguin–krill system</article-title><source>Proceedings of the Royal Society B: Biological Sciences</source><volume>281</volume><elocation-id>20132376</elocation-id><pub-id pub-id-type="doi">10.1098/rspb.2013.2376</pub-id></element-citation></ref><ref id="bib58"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Webster</surname> <given-names>MM</given-names></name><name><surname>Rutz</surname> <given-names>C</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>How STRANGE are your study animals?</article-title><source>Nature</source><volume>582</volume><fpage>337</fpage><lpage>340</lpage><pub-id pub-id-type="doi">10.1038/d41586-020-01751-5</pub-id><pub-id pub-id-type="pmid">32541916</pub-id></element-citation></ref><ref id="bib59"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>White</surname> <given-names>JQ</given-names></name><name><surname>Nicholas</surname> <given-names>TJ</given-names></name><name><surname>Gritton</surname> <given-names>J</given-names></name><name><surname>Truong</surname> <given-names>L</given-names></name><name><surname>Davidson</surname> <given-names>ER</given-names></name><name><surname>Jorgensen</surname> <given-names>EM</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>The sensory circuitry for sexual attraction in <italic>C. elegans</italic> males</article-title><source>Current Biology</source><volume>17</volume><fpage>1847</fpage><lpage>1857</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2007.09.011</pub-id><pub-id pub-id-type="pmid">17964166</pub-id></element-citation></ref><ref id="bib60"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Wyatt</surname> <given-names>TD</given-names></name></person-group><year iso-8601-date="2014">2014</year><source>Pheromones and Animal Behavior: Chemical Signals and Signature Mixes</source><publisher-loc>Cambridge, United Kingdom</publisher-loc><publisher-name>Cambridge University Press</publisher-name></element-citation></ref></ref-list><app-group><app id="appendix-1"><title>Appendix 1</title><sec id="s8" sec-type="appendix"><title>Foraging model</title><boxed-text><p>We assume that two types of food patches exist. Food patches marked with pheromones, which have a high average value (they are capable of sustaining worm growth and are easy to find). Unmarked food patches, which have a low average value as they are more difficult to find.</p><p>Initially, individuals are distributed across the pheromone-marked patches. Let <inline-formula><mml:math id="inf43"><mml:mi>K</mml:mi></mml:math></inline-formula> be the number of patches, <inline-formula><mml:math id="inf44"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> the number of individuals in the <inline-formula><mml:math id="inf45"><mml:mi>i</mml:mi></mml:math></inline-formula>-th patch (for <inline-formula><mml:math id="inf46"><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1,2</mml:mn><mml:mo>…</mml:mo><mml:mi>K</mml:mi></mml:math></inline-formula>), and <inline-formula><mml:math id="inf47"><mml:mi>N</mml:mi></mml:math></inline-formula> the total number of individuals (so <inline-formula><mml:math id="inf48"><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:msubsup><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:msubsup><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula>). For simplicity, here we assume that all food patches are identical. We will show below that removing this assumption does not change our results qualitatively.</p><p><bold>Box 1</bold>. Notation index.</p><p><inline-formula><mml:math id="inf49"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> : Initial amount of food in the food patches</p><p><inline-formula><mml:math id="inf50"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>t</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> : Amount of food at the <inline-formula><mml:math id="inf51"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>-th food patch at time <inline-formula><mml:math id="inf52"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>.</p><p><inline-formula><mml:math id="inf53"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi>D</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> : Amount of food left in a food patch when instantaneous feeding rate matches <inline-formula><mml:math id="inf54"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>g</mml:mi><mml:mi>D</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> (<inline-formula><mml:math id="inf55"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi>D</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>τ</mml:mi><mml:msub><mml:mi>g</mml:mi><mml:mi>D</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula>)</p><p><inline-formula><mml:math id="inf56"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mi>E</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> : Effective amount of food in a food patch (amount of food that worms will extract from the food patch, above what they would obtain by dispersing from the beginning).</p><p><inline-formula><mml:math id="inf57"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>: Cost of switching</p><p><inline-formula><mml:math id="inf58"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>g</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>t</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> : Instantaneous feeding rate</p><p><inline-formula><mml:math id="inf59"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>g</mml:mi><mml:mi>D</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> : Average instantaneous feeding rate after dispersal</p><p><inline-formula><mml:math id="inf60"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>G</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> : Total food intake.</p><p><inline-formula><mml:math id="inf61"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> : Payoff (total food intake minus cost)</p><p><inline-formula><mml:math id="inf62"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mo>⟨</mml:mo><mml:mi>H</mml:mi><mml:mo>⟩</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> : Expected payoff</p><p><inline-formula><mml:math id="inf63"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> : Benefit of switching, <inline-formula><mml:math id="inf64"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mo>⟨</mml:mo><mml:mi>H</mml:mi><mml:mo>⟩</mml:mo></mml:mrow><mml:mrow><mml:mi>s</mml:mi><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mi>t</mml:mi><mml:mi>c</mml:mi><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mo>⟨</mml:mo><mml:mi>H</mml:mi><mml:mo>⟩</mml:mo></mml:mrow><mml:mrow><mml:mi>R</mml:mi><mml:mi>e</mml:mi><mml:mi>m</mml:mi><mml:mi>a</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula></p><p><inline-formula><mml:math id="inf65"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> : Number of food patches</p><p><inline-formula><mml:math id="inf66"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>m</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> : Number of worms in the <inline-formula><mml:math id="inf67"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>-th food patch after the switch (so for any <inline-formula><mml:math id="inf68"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>t</mml:mi><mml:mo>&gt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>). In the ESS these numbers remain constant until worms start to disperse.</p><p><inline-formula><mml:math id="inf69"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> : Initial number of worms in the <inline-formula><mml:math id="inf70"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>-th food patch (before any worm switches or disperses)</p><p><inline-formula><mml:math id="inf71"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> : Total number of worms (<inline-formula><mml:math id="inf72"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:msubsup><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msubsup><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>)</p><p><inline-formula><mml:math id="inf73"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>: Probability of switching at <inline-formula><mml:math id="inf74"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>.</p><p><inline-formula><mml:math id="inf75"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mo>∗</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> : Value of <inline-formula><mml:math id="inf76"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> at the ESS.</p><p><inline-formula><mml:math id="inf77"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> : Inverse of feeding rate</p><p>At any time, individuals can take three possible actions: <bold>Remain</bold> in the current patch, <bold>switch</bold> to another pheromone-marked patch (so they leave the patch and follow pheromones), or <bold>disperse</bold> and search for an unmarked patch (so they leave the patch and avoid pheromones).</p><p>Individuals’ instantaneous feeding rate <inline-formula><mml:math id="inf78"><mml:mi>g</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced></mml:math></inline-formula> depends on their choices. Let's start with the choice of dispersal. To model this decision we borrowed the results of classical foraging models from which the Marginal Value Theorem was derived (<xref ref-type="bibr" rid="bib8">Charnov, 1976</xref>). These models describe an individual depleting a food patch, whose environment contains other food patches that remain stationary (i.e., on average the other food patches are not being depleted over time). Accordingly, we assume that the unmarked food patches remain stationary. In these conditions, one can compute an average expected intake rate from dispersing and searching for unmarked patches, which we will call <inline-formula><mml:math id="inf79"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. This average intake rate takes into account the average quality of the unmarked food patches and the time needed to find and consume them. The optimal strategy is to remain in the current food patch until the instantaneous feeding rate (<inline-formula><mml:math id="inf80"><mml:mi>g</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula>) falls below <inline-formula><mml:math id="inf81"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> (<xref ref-type="bibr" rid="bib8">Charnov, 1976</xref>). Following these models, we assume that any individual that disperses will experience a constant instantaneous feeding rate <inline-formula><mml:math id="inf82"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>.</p><p>While we can use the formalism of classical foraging models for the dispersal decision, we cannot do the same for the switching decision, because the pheromone-marked food patches are non-stationary (they all get depleted at roughly the same time, a feature characteristic of species with a boom-and-burst life cycle such as <italic>C. elegans</italic>). We will therefore model explicitly food depletion in all pheromone-marked patches.</p><p>We assume that individuals at a pheromone-marked food patch feed at a rate proportional to the amount of food left in the patch: <inline-formula><mml:math id="inf83"><mml:mi>g</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mi>A</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>/</mml:mo><mml:mi>τ</mml:mi></mml:math></inline-formula>, where <inline-formula><mml:math id="inf84"><mml:mi>A</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced></mml:math></inline-formula> is the amount of food available at the food patch at time <inline-formula><mml:math id="inf85"><mml:mi>t</mml:mi></mml:math></inline-formula>, and <inline-formula><mml:math id="inf86"><mml:mi>τ</mml:mi></mml:math></inline-formula> is a constant that determines the feeding rate. Therefore, food patches get depleted over time as <inline-formula><mml:math id="inf87"><mml:mi>A</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula>, where <inline-formula><mml:math id="inf88"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> is the initial food density in the pheromone-marked patches and <inline-formula><mml:math id="inf89"><mml:mi>m</mml:mi></mml:math></inline-formula> is the number of individuals in the patch. (Proof: If <inline-formula><mml:math id="inf90"><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow/></mml:msub></mml:math></inline-formula> worms occupy a patch, and each worm feeds at a rate <inline-formula><mml:math id="inf91"><mml:mi>g</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mi>A</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>/</mml:mo><mml:mi>τ</mml:mi></mml:math></inline-formula>, then the food will be depleted at a rate <inline-formula><mml:math id="inf92"><mml:mfrac><mml:mrow><mml:mi>d</mml:mi><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:mi>A</mml:mi></mml:math></inline-formula>. Assuming that <inline-formula><mml:math id="inf93"><mml:mi>m</mml:mi></mml:math></inline-formula> remains constant over time, the solution to this differential equation is <inline-formula><mml:math id="inf94"><mml:mi>A</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula>, where <inline-formula><mml:math id="inf95"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> is the initial food density.). Therefore, instantaneous feeding rate in a food patch will be<disp-formula id="equ5"><label>[S1]</label><mml:math id="m5"><mml:mi>g</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup></mml:math></disp-formula></p><p>Individuals that switch pay a cost <inline-formula><mml:math id="inf96"><mml:mi>c</mml:mi></mml:math></inline-formula> for switching. We assume that switching is fast compared to the depletion rate of the food patches, so switching is instantaneous in our model. Individuals that switch will then arrive to any pheromone-marked food patch with equal probability (including their initial one).</p><p>We now consider the total food intake, which is the integral of the instantaneous intake rate (<inline-formula><mml:math id="inf97"><mml:mi>g</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced></mml:math></inline-formula>) over a long period of time. The exact length of this period does not actually matter, because in all relevant cases we will be comparing strategies that end with dispersal, and therefore get the same intake rate at the end. We will always work with differences between the payoffs of these strategies, so these final periods will cancel out.</p><p>Finally, we assume that individuals have strong sensory constraints: They only perceive their instantaneous feeding rate (<inline-formula><mml:math id="inf98"><mml:mi>g</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced></mml:math></inline-formula>), not having information about any of the other parameters (number of patches, number of individuals per patch, etc.). However, their behavior can be adapted to be optimal with respect to the average values of these parameters over the species' evolutionary history.</p><p>In these conditions, the following Evolutionary Stable Strategy (<xref ref-type="bibr" rid="bib35">Maynard Smith, 1982</xref>; <xref ref-type="bibr" rid="bib46">Smith and Maynard Smith, 1974</xref>) exists: At time <inline-formula><mml:math id="inf99"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>, all individuals have a probability <inline-formula><mml:math id="inf100"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula> of switching (so a fraction <inline-formula><mml:math id="inf101"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula> of the individuals will switch). Then they all remain in the food patches until their instantaneous feeding rate falls below <inline-formula><mml:math id="inf102"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, at which point they disperse. In the experiment we observed <italic>C. elegans</italic> individuals leaving the food patch continuously, while our model predicts that they should all switch at <inline-formula><mml:math id="inf103"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>. This difference is due to the simplicity of the model, which neglects factors such as inter-individual differences and stochasticity. Despite this simplicity, the model captures the key feature that individual worms leave their initial food patch before it is depleted (switching behavior), which is a counterintuitive idea in the context of optimal foraging.</p><sec id="s9"><title>Proof</title><p>We will prove each part of the Evolutionary Stable Strategy separately.</p><p>1. <italic>Individuals will not disperse until the occupied food patches are nearly depleted</italic></p><p>Dispersing gives an instantaneous average payoff of <inline-formula><mml:math id="inf104"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, so individuals should never disperse if their instantaneous intake rate is above <inline-formula><mml:math id="inf105"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> (i.e., if the food density in their current patch is <inline-formula><mml:math id="inf106"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>A</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mo>&gt;</mml:mo><mml:mi>τ</mml:mi><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula>). We define<disp-formula id="equ6"><label>[S2]</label><mml:math id="m6"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi>τ</mml:mi><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo></mml:math></disp-formula>which is the amount of food left in the food patch when the instantaneous feeding rate equals <inline-formula><mml:math id="inf107"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>.</p><p>2. <italic>The probability to switch (p) has a stable equilibrium (p*)</italic></p><p>If all individuals follow the Evolutionary Stable Strategy, at time <inline-formula><mml:math id="inf108"><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> a fraction <inline-formula><mml:math id="inf109"><mml:mi>p</mml:mi></mml:math></inline-formula> of them switches, changing the distribution of individuals across food patches. Let <inline-formula><mml:math id="inf110"><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi/><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>…</mml:mo><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> be the number of individuals in each food patch after the switch. These numbers are related to the initial distribution as<disp-formula id="equ7"><label>[S3]</label><mml:math id="m7"><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac><mml:mo>,</mml:mo></mml:math></disp-formula>which is the number of individuals that remained in the <inline-formula><mml:math id="inf111"><mml:mi>i</mml:mi></mml:math></inline-formula>-th patch plus the number of individuals that arrive to the <inline-formula><mml:math id="inf112"><mml:mi>i</mml:mi></mml:math></inline-formula>-th patch after the switch. Here we are assuming that worms that switch have equal probability to arrive to any occupied food patch (including the initial one).</p><p>After the switch, all individuals will remain in their new food patch until the instantaneous feeding rate reaches <inline-formula><mml:math id="inf113"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. From <xref ref-type="disp-formula" rid="equ5">Equation S1</xref>, this will happen at time<disp-formula id="equ8"><label>[S4]</label><mml:math id="m8"><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mi>τ</mml:mi><mml:mrow><mml:mrow><mml:mi mathvariant="normal">log</mml:mi></mml:mrow><mml:mo>⁡</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math></disp-formula>for the <inline-formula><mml:math id="inf114"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>-th food patch.</p><p>We are ready to compute the total intake over a period <italic>T</italic> for an individual at the <italic>i</italic>-th patch. It's convenient to split this in the two periods before and after dispersal, so we have<disp-formula id="equ9"><label>[S5]</label><mml:math id="m9"><mml:msub><mml:mrow><mml:mi>G</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mi>g</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mrow><mml:mo>+</mml:mo><mml:mrow><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mrow></mml:math></disp-formula>where we have used <xref ref-type="disp-formula" rid="equ5">Equation S1</xref> for the period inside the food patch, and the constant feeding rate <inline-formula><mml:math id="inf115"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> for the period after dispersal. Solving these two integrals and replacing <inline-formula><mml:math id="inf116"><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> for its expression in <xref ref-type="disp-formula" rid="equ8">Equation S4</xref> gives<disp-formula id="equ10"><label>[S6]</label><mml:math id="m10"><mml:msub><mml:mrow><mml:mi>G</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mo>-</mml:mo><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="normal">log</mml:mi></mml:mrow><mml:mo>⁡</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mrow></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mi>T</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>We now define the effective amount of food in the food patch as<disp-formula id="equ11"><label>[S7]</label><mml:math id="m11"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mo>-</mml:mo><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="normal">log</mml:mi></mml:mrow><mml:mo>⁡</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>This effective amount of food represents the benefit that worms can extract from the food patch: <inline-formula><mml:math id="inf117"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> is the amount of food they will eat from the food patch, and <inline-formula><mml:math id="inf118"><mml:msub><mml:mrow><mml:mo>-</mml:mo><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="normal">log</mml:mi></mml:mrow><mml:mo>⁡</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mrow></mml:math></inline-formula> is a correction for the amount of food they would had been eating over the same period if they had dispersed from the beginning. We then have<disp-formula id="equ12"><label>[S8]</label><mml:math id="m12"><mml:msub><mml:mrow><mml:mi>G</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mi>T</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>Now we can compute the expected payoff for each decision (<inline-formula><mml:math id="inf119"><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:math></inline-formula>), which is the expected total food intake minus any costs incurred by the behavior. Individuals that switch have an equal probability of ending up in any of the food patches, so their expected payoff is simply the average of the payoffs across the food patches minus the cost of switching:<disp-formula id="equ13"><label>[S9a]</label><mml:math id="m13"><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mi>t</mml:mi><mml:mi>c</mml:mi><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mi>T</mml:mi><mml:mo>-</mml:mo><mml:mi>c</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>In contrast, individuals that remain have a probability <inline-formula><mml:math id="inf120"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>/</mml:mo><mml:mi>N</mml:mi></mml:math></inline-formula> of being in the <inline-formula><mml:math id="inf121"><mml:mi>i</mml:mi></mml:math></inline-formula>-th patch, so their expected payoff is<disp-formula id="equ14"><label>[S9b]</label><mml:math id="m14"><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>R</mml:mi><mml:mi>e</mml:mi><mml:mi>m</mml:mi><mml:mi>a</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mi>T</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>We now compute the benefit of switching,<disp-formula id="equ15"><label>[S10]</label><mml:math id="m15"><mml:mo>∆</mml:mo><mml:mi>H</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mi>t</mml:mi><mml:mi>c</mml:mi><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mfenced close="⟩" open="⟨" separators="|"><mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mi>R</mml:mi><mml:mi>e</mml:mi><mml:mi>m</mml:mi><mml:mi>a</mml:mi><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>-</mml:mo><mml:mi>c</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>Note that this benefit of switching is identical to what we would obtain using <xref ref-type="disp-formula" rid="equ3 equ4">Equations 3a and 3b</xref> in the main text instead of <xref ref-type="disp-formula" rid="equ13 equ14">Equations S9a and S9b</xref>. For this reason, this model and the simplified model presented in the main text are mathematically equivalent.</p><p>It is now convenient to define<disp-formula id="equ16"><label>[S11]</label><mml:math id="m16"><mml:mo>∆</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mi>N</mml:mi><mml:mo>/</mml:mo><mml:mi>K</mml:mi><mml:mo>,</mml:mo></mml:math></disp-formula>which is the deviation in the initial number of individuals from the average number of individuals in every food patch. We also substitute <inline-formula><mml:math id="inf122"><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> according to <xref ref-type="disp-formula" rid="equ7">Equation S3</xref>, getting<disp-formula id="equ17"><label>[S12]</label><mml:math id="m17"><mml:mo>∆</mml:mo><mml:mi>H</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mo>∆</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>-</mml:mo><mml:mi>c</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>The equilibrium value of <inline-formula><mml:math id="inf123"><mml:mi>p</mml:mi></mml:math></inline-formula>, or <inline-formula><mml:math id="inf124"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula> will be such that <inline-formula><mml:math id="inf125"><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>, so<disp-formula id="equ18"><label>[S13]</label><mml:math id="m18"><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mo>∆</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mi>N</mml:mi><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>-</mml:mo><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>We did not find a simple analytical expression for the value of <inline-formula><mml:math id="inf126"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula>, but we can make several observations:</p><p>1. <inline-formula><mml:math id="inf127"><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> are zero, the first term of <inline-formula><mml:math id="inf128"><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi></mml:math></inline-formula> is always zero, so <inline-formula><mml:math id="inf129"><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi><mml:mo>≤</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> and switching is never advantageous (therefore, <inline-formula><mml:math id="inf130"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>). This makes intuitive sense: If all <inline-formula><mml:math id="inf131"><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> are zero, the individuals were initially distributed in the optimal way (equally distributed across the food patches), so switching cannot bring any benefit.</p><p>2. If <inline-formula><mml:math id="inf132"><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>, then <inline-formula><mml:math id="inf133"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula> regardless of the value of the rest of the parameters (this can be checked by substitution in <xref ref-type="disp-formula" rid="equ18">Equation S13</xref>). Therefore, if switching is costless all individuals should switch regardless of the values of the other parameters.</p><p>3. When <inline-formula><mml:math id="inf134"><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula>, <inline-formula><mml:math id="inf135"><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi><mml:mi/><mml:mo>=</mml:mo><mml:mi/><mml:mo>-</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula></p><p>4. When <inline-formula><mml:math id="inf136"><mml:mi>p</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>, <inline-formula><mml:math id="inf137"><mml:mo>∆</mml:mo><mml:mi>H</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:mo>∆</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>-</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula></p><p>5. <inline-formula><mml:math id="inf138"><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi></mml:math></inline-formula> decreases monotonically as <inline-formula><mml:math id="inf139"><mml:mi>p</mml:mi></mml:math></inline-formula> increases, for any values of the parameters.</p><p>(Proof: <inline-formula><mml:math id="inf140"><mml:mfrac><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:mo>∆</mml:mo><mml:msubsup><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow/></mml:msubsup><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mfrac><mml:mrow><mml:mo>∆</mml:mo><mml:msubsup><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:msup><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>p</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:mrow></mml:mrow></mml:math></inline-formula>. This is always negative as long as <inline-formula><mml:math id="inf141"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub><mml:mo>&gt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>, because <inline-formula><mml:math id="inf142"><mml:mi>N</mml:mi></mml:math></inline-formula> is always positive and all terms inside the sum are squared.).</p><p>Therefore, <inline-formula><mml:math id="inf143"><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi></mml:math></inline-formula> decreases monotonically between <inline-formula><mml:math id="inf144"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub><mml:mi>N</mml:mi></mml:mfrac><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mfrac><mml:mo>−</mml:mo><mml:mi>c</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> and <inline-formula><mml:math id="inf145"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mo>−</mml:mo><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, and the value of <inline-formula><mml:math id="inf146"><mml:mi>p</mml:mi></mml:math></inline-formula> at which <inline-formula><mml:math id="inf147"><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> the equilibrium <inline-formula><mml:math id="inf148"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula> of our Evolutionary Stable Strategy (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>). If <inline-formula><mml:math id="inf149"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>c</mml:mi><mml:mo>&lt;</mml:mo><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub><mml:mi>N</mml:mi></mml:mfrac><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mfrac></mml:mrow></mml:mstyle></mml:math></inline-formula>, then <inline-formula><mml:math id="inf150"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula> is greater than 0 and a fraction of the population will switch. If <inline-formula><mml:math id="inf151"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>c</mml:mi><mml:mo>&gt;</mml:mo><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub><mml:mi>N</mml:mi></mml:mfrac><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mfrac></mml:mrow></mml:mstyle></mml:math></inline-formula>, then <inline-formula><mml:math id="inf152"><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>.</p><p>In the equilibrium, no mutant has an incentive to deviate from its strategy, since both switching and remaining give the same payoff. Furthermore, the equilibrium is stable: When <inline-formula><mml:math id="inf153"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mo>&gt;</mml:mo><mml:msup><mml:mi>p</mml:mi><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> <inline-formula><mml:math id="inf154"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi></mml:mrow><mml:mi>H</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> becomes negative, meaning that individuals that switched get lower payoff than individuals that remained, and pushing the population toward lower <inline-formula><mml:math id="inf155"><mml:mi>p</mml:mi></mml:math></inline-formula>. Conversely, when <inline-formula><mml:math id="inf156"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mo>&lt;</mml:mo><mml:msup><mml:mi>p</mml:mi><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math></inline-formula>, individuals that switched have an advantage and the system is pushed toward higher <inline-formula><mml:math id="inf157"><mml:mi>p</mml:mi></mml:math></inline-formula>.</p><p><italic>3. Individuals must not switch more than once</italic></p><p>Individuals that switched at <inline-formula><mml:math id="inf158"><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> have the same probability of being in every food patch. A new switch will leave these probabilities unchanged—we assume that the population is large enough so that a single mutant does not alter the distributions significantly., so will not affect the expected payoff. Therefore, individuals have no incentive to switch more than once.</p><p><italic>4. Individuals must switch at t=0.</italic></p><p>A mutant that delays the switch to some later time <inline-formula><mml:math id="inf159"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mo>&gt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> will spend its time before the switch in an overcrowded patch (on average) and will therefore get lower final payoff than the wild-type that switches at time <inline-formula><mml:math id="inf160"><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>. Let's see it mathematically, comparing the expected payoff for switching at <inline-formula><mml:math id="inf161"><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> and the expected payoff for switching at <inline-formula><mml:math id="inf162"><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>:<disp-formula id="equ19"><label>[S14]</label><mml:math id="m19"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mtable columnalign="center center" columnspacing="1em" rowspacing="4pt"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mo>⟨</mml:mo><mml:mi>H</mml:mi><mml:mo>⟩</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mi>t</mml:mi><mml:mi>c</mml:mi><mml:mi>h</mml:mi><mml:mi>a</mml:mi><mml:mi>t</mml:mi><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mo>⟨</mml:mo><mml:mi>H</mml:mi><mml:mo>⟩</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mi>t</mml:mi><mml:mi>c</mml:mi><mml:mi>h</mml:mi><mml:mi>a</mml:mi><mml:mi>t</mml:mi><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mn>1</mml:mn><mml:mi>K</mml:mi></mml:mfrac><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfrac><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>m</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup><mml:mi>d</mml:mi><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mn>1</mml:mn><mml:mi>K</mml:mi></mml:mfrac><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfrac><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>m</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup><mml:mi>d</mml:mi><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mn>1</mml:mn><mml:mi>K</mml:mi></mml:mfrac><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:munderover><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mi>d</mml:mi><mml:mi>t</mml:mi><mml:mo>−</mml:mo><mml:mi>c</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mo>−</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>N</mml:mi></mml:mfrac><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfrac><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>m</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup><mml:mi>d</mml:mi><mml:mi>t</mml:mi><mml:mo>−</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mn>1</mml:mn><mml:mi>K</mml:mi></mml:mfrac><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfrac><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>m</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup><mml:mi>d</mml:mi><mml:mi>t</mml:mi><mml:mo>−</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mfrac><mml:mn>1</mml:mn><mml:mi>K</mml:mi></mml:mfrac><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:munderover><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub><mml:mi>d</mml:mi><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mi>c</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:mstyle></mml:math></disp-formula></p><p>Most of the terms cancel out, leaving</p><p><inline-formula><mml:math id="inf163"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mrow><mml:mo>⟨</mml:mo><mml:mi>H</mml:mi><mml:mo>⟩</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mi>t</mml:mi><mml:mi>c</mml:mi><mml:mi>h</mml:mi><mml:mi>a</mml:mi><mml:mi>t</mml:mi><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:msub><mml:mrow><mml:mo>⟨</mml:mo><mml:mi>H</mml:mi><mml:mo>⟩</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mi>w</mml:mi><mml:mi>i</mml:mi><mml:mi>t</mml:mi><mml:mi>c</mml:mi><mml:mi>h</mml:mi><mml:mi>a</mml:mi><mml:mi>t</mml:mi><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mfrac><mml:mn>1</mml:mn><mml:mi>K</mml:mi></mml:mfrac><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>N</mml:mi></mml:mfrac></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:munderover><mml:mo>∫</mml:mo><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfrac><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>m</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:mi>t</mml:mi></mml:mrow></mml:msup><mml:mi>d</mml:mi><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mfrac><mml:mn>1</mml:mn><mml:mi>K</mml:mi></mml:mfrac><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>N</mml:mi></mml:mfrac></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>m</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow><mml:msub><mml:mi>m</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mfrac><mml:mo>,</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> which is always positive.</p><p>(Proof: <inline-formula><mml:math id="inf164"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:msubsup><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mi>K</mml:mi></mml:mfrac><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>n</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mi>n</mml:mi></mml:mfrac><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>m</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:mi>t</mml:mi><mml:mi>s</mml:mi></mml:mrow></mml:msup></mml:mrow><mml:msub><mml:mi>m</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mfrac><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:msubsup><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:msubsup><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi>n</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>α</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>,</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> where <inline-formula><mml:math id="inf165"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi></mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> is defined as in Equation S11, and we define <inline-formula><mml:math id="inf166"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>α</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mfrac><mml:msub><mml:mi>m</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mi>τ</mml:mi></mml:mfrac><mml:mi>t</mml:mi><mml:mi>s</mml:mi></mml:mrow></mml:msup></mml:mrow><mml:msub><mml:mi>m</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mfrac></mml:mrow></mml:mstyle></mml:math></inline-formula> We will show first that <inline-formula><mml:math id="inf167"><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> and <inline-formula><mml:math id="inf168"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>α</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> are perfectly anticorrelated (i.e. if <inline-formula><mml:math id="inf169"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi></mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&gt;</mml:mo><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi></mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> , then <inline-formula><mml:math id="inf170"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>α</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&lt;</mml:mo><mml:msub><mml:mi>α</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> for any <inline-formula><mml:math id="inf171"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>). Then, we will show that this implies that <inline-formula><mml:math id="inf172"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:msubsup><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi>n</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>α</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> must be negative. <inline-formula><mml:math id="inf173"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mi mathvariant="bold">Δ</mml:mi></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">n</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> and <inline-formula><mml:math id="inf174"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">α</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> are perfectly anticorrelated: Both <inline-formula><mml:math id="inf175"><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> and <inline-formula><mml:math id="inf176"><mml:msub><mml:mrow><mml:mi>α</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> depend on <inline-formula><mml:math id="inf177"><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. Let’s see that their derivatives with respect to it have opposite signs: From <xref ref-type="disp-formula" rid="equ16">Equation S11</xref>, <inline-formula><mml:math id="inf178"><mml:mfrac><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula>, so it’s positive. From Equation S3, <inline-formula><mml:math id="inf179"><mml:mfrac><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula>, so <inline-formula><mml:math id="inf180"><mml:mfrac><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>α</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math></inline-formula> has the same sign as <inline-formula><mml:math id="inf181"><mml:mfrac><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>α</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup><mml:mfenced separators="|"><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:mfrac></mml:math></inline-formula>. Given that <inline-formula><mml:math id="inf182"><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:math></inline-formula> and <inline-formula><mml:math id="inf183"><mml:msubsup><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msubsup></mml:math></inline-formula> are always positive, this has the same sign as <inline-formula><mml:math id="inf184"><mml:mfenced separators="|"><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:mfenced></mml:math></inline-formula>, which is always negative it’s zero for <inline-formula><mml:math id="inf185"><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>, and <inline-formula><mml:math id="inf186"><mml:mfrac><mml:mrow><mml:mo>∂</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mfenced separators="|"><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:msup><mml:mrow><mml:mo>-</mml:mo><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:mfenced><mml:mo>≤</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> as long as <inline-formula><mml:math id="inf187"><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>S</mml:mi></mml:mrow></mml:msub><mml:mo>≥</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> and <inline-formula><mml:math id="inf188"><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>τ</mml:mi></mml:mrow></mml:mfrac><mml:mo>≥</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>, which is always true. Therefore, <inline-formula><mml:math id="inf189"><mml:mfrac><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>α</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math></inline-formula> is always negative.).</p><p>Therefore, switching at <inline-formula><mml:math id="inf190"><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> is advantageous.</p><p><italic>5. Individuals must disperse once their current food patch is depleted.</italic></p><p>Once <inline-formula><mml:math id="inf191"><mml:mi>g</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, remaining in the same patch will lead to an instantaneous feeding rate below <inline-formula><mml:math id="inf192"><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, because <inline-formula><mml:math id="inf193"><mml:mi>g</mml:mi><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> decreases over time. Therefore, worms should not remain. And neither they should switch, as we saw in sections 3 and 4. Therefore, they should disperse.</p></sec><sec id="s10"><title>Food patches of different sizes and qualities</title><p>The above calculations assume that all food patches are identical, having an initial density <inline-formula><mml:math id="inf194"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> and the same sizes. In reality, food patches will differ both in their initial density and their size.</p><p>Differences in the initial density (<inline-formula><mml:math id="inf195"><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>) lead to effects that have been thoroughly discussed in the optimal foraging literature (<xref ref-type="bibr" rid="bib49">Stephens and Krebs, 1986</xref>). Higher density translates into higher feeding rate, which can be detected by the worms as they exploit the patches. Worms that estimate that their current patch has lower quality than the environmental average should leave it and search for a more profitable one, and the key challenge is the estimation of this environmental average quality. This effect will be superimposed to the one described by our model, but we don’t expect any qualitatively new effect emerging from this interaction. Part of the merit of our work is to show that even in the absence of these differences in initial density, worms may benefit from leaving a non-depleted food patch.</p><p>Differences in patch size are more interesting from our point of view. A larger food patch will not give a higher instantaneous feeding rate, but will be depleted more slowly. So the amount of food in the patch will be<disp-formula id="equ20"><label>[S15]</label><mml:math id="m20"><mml:msub><mml:mrow><mml:mi>a</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mi>m</mml:mi><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>τ</mml:mi><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:msup><mml:mo>,</mml:mo></mml:math></disp-formula>where <inline-formula><mml:math id="inf196"><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> is the size of the <inline-formula><mml:math id="inf197"><mml:mi>i</mml:mi></mml:math></inline-formula>-th food patch. We assume that worms cannot detect the size of their current food patch (the only way to do so would be by measuring depletion rate, which is more difficult than measuring instantaneous feeding rate and requires waiting for a long enough period of time for depletion to be significant). Therefore, the behaviors available to the worms are the same as before, and they still have an equal probability of arriving to any food patch when they decide to switch. Repeating the calculations made above but using <xref ref-type="disp-formula" rid="equ20">Equation S15</xref> as instantaneous density, the benefit of switching becomes<disp-formula id="equ21"><label>[S16]</label><mml:math id="m21"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>H</mml:mi><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mi>N</mml:mi></mml:mfrac><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfrac><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mi>N</mml:mi><mml:mi>p</mml:mi></mml:mrow><mml:mi>K</mml:mi></mml:mfrac></mml:mrow></mml:mfrac><mml:mo>−</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:mstyle></mml:math></disp-formula>with an equilibrium probability given by<disp-formula id="equ22"><label>[S17]</label><mml:math id="m22"><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac><mml:mrow><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:munderover><mml:mrow><mml:mo>∆</mml:mo><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>A</mml:mi></mml:mrow><mml:mrow><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mfrac><mml:mrow><mml:mi>N</mml:mi><mml:msup><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mi>K</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfrac></mml:mrow></mml:mrow><mml:mo>-</mml:mo><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn><mml:mo>.</mml:mo></mml:math></disp-formula></p><p>Unlike the case with identical food patches, even for <inline-formula><mml:math id="inf198"><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> the equilibrium probability can be different than 1, and it depends on the initial distribution of individuals, and the distribution of patch sizes. In fact, it is possible to start in a situation in which switching is detrimental: If large patches contain more individuals at the beginning, remaining in the patches will produce a more balanced depletion than switching to equalize the number of individuals per patch. However, this good match between patch size and number of individuals is unlikely. In nature one would expect little or no correlation between patch size and initial number of individuals. In this case, the average result is very similar to the case with identical food patches (<xref ref-type="fig" rid="fig2s2">Figure 2—figure supplement 2</xref>).</p></sec></boxed-text></sec></app></app-group></back><sub-article article-type="decision-letter" id="sa1"><front-stub><article-id pub-id-type="doi">10.7554/eLife.58144.sa1</article-id><title-group><article-title>Decision letter</article-title></title-group><contrib-group><contrib contrib-type="editor"><name><surname>Celani</surname><given-names>Antonio</given-names></name><role>Reviewing Editor</role><aff><institution>ICTP</institution><country>Italy</country></aff></contrib></contrib-group></front-stub><body><boxed-text><p>In the interests of transparency, eLife publishes the most substantive revision requests and the accompanying author responses.</p></boxed-text><p><bold>Acceptance summary:</bold></p><p>This paper will be of interest to scientists in the field of animal behaviour, especially those working on foraging, navigation and the integration of sensory cues. Experimental data obtained with <italic>C. elegans</italic> convincingly demonstrate an inversion of preferences depending on the presence of other individuals. The authors interpret this behaviour as an optimal foraging strategy and suggest a model that might represent a first step towards a theoretical understanding of these observations.</p><p><bold>Decision letter after peer review:</bold></p><p>Thank you for submitting your article &quot;Inversion of pheromone preference optimizes foraging in <italic>C. elegans</italic>&quot; for consideration by <italic>eLife</italic>. Your article has been reviewed by three peer reviewers, and the evaluation has been overseen by a Reviewing Editor and Christian Rutz as the Senior Editor. The reviewers have opted to remain anonymous.</p><p>The reviewers have discussed their reviews with one another, and the Reviewing Editor has drafted this decision letter to help you prepare a revised submission.</p><p>We would like to draw your attention to changes in our revision policy that we have made in response to COVID-19 (https://elifesciences.org/articles/57162). Specifically, when editors judge that a submitted work as a whole belongs in <italic>eLife</italic> but that some conclusions require a modest amount of additional new data, as they do with your paper, we are asking that the manuscript be revised to either limit claims to those supported by data in hand, or to explicitly state that the relevant conclusions require additional supporting data.</p><p>Our expectation is that you will eventually carry out the additional experiments and report on how they affect the relevant conclusions either in a preprint on bioRxiv or medRxiv, or if appropriate, as a Research Advance in <italic>eLife</italic>, either of which would be linked to the original paper.</p><p>Summary:</p><p>The authors present an analysis of the foraging dynamics of <italic>C. elegans</italic> in patchy food environments and show how they bias their decisions depending on feeding history and sensory cues that reflect the density of worms. Navigational preference for these sensory cues is found to change from attractive to repulsive depending on the time at which worms leave a food patch, and additional experiments that condition worms under different combinations of conditions indicate that associative learning is involved in this inversion of preference. This behavior is illuminated by a mathematical model that points to the conclusion that this inversion represents an optimal, evolutionarily stable foraging strategy.</p><p>Essential revisions:</p><p>Overall, the results are interesting and clearly presented but could be better supported by experiments and modeling. The paper is of high quality and would be of interest to the readership of <italic>eLife</italic> provided that the following crucial remarks on experiments and modeling are duly addressed by a major revision.</p><p>Experiments:</p><p>Regarding the interpretation of the data in Figure S2, which was designed to test for associative learning in the preference for specific pheromone molecules (synthetic ascarosides). You state in the main text that the results in Figure 3 of associative learning experiments with the 'pheromone blend' (i.e., supernatant from worms in liquid culture) could be 'recapitulated' with these pure forms of the pheromone molecules, but the data appear to contradict this statement. It appears that difference in navigational preference for these pheromone molecules exist between worms conditioned in the +food and -food conditions, regardless of whether the pheromone molecules are present during the conditioning. Thus, it appears as if the preference for these pheromones might be explained by feeding status only, without associative learning. Have we missed something here? The results of Figure 3 are still consistent with associative learning, but the results of Figure S2 appear to suggest that the cues involved in the associative learning are different from the specific pheromones tested within Figure S2, and must in fact override the feeding-state dependent preference to these specific ascaroside molecules. This leaves us wondering whether it is fair to conclude that the sensory cues involved in the associative learning are really pheromone molecules. Can you rule out that the learning is a response to other substances in the supernatant, e.g. (in their own words) &quot;other products of worm metabolism, compounds deriving from the decomposition of dead worms and bacteria, and perhaps other unknown substances&quot;?</p><p>You may want to consider conducting additional experiments (to find other pheromone molecules that do demonstrate evidence for associative learning), or to just change relevant wording to avoid committing to what appears to be at present a weakly supported conclusion.</p><p>Mathematical modeling:</p><p>Although conceptually appealing, the modeling appears to be an add-on to the experimental results. It also seems to suffer from weaknesses that should be addressed as detailed below. First, it would seem that at least some of the analysis results (e.g., that equal petitioning would be optimal) might depend on the assumption that all patches are of equal size. This does seem a strong assumption if the model is to be considered relevant to natural ecology. Which of the model-based conclusions are still valid if this assumption is removed? Second, how reasonable is the assumption that all worms start in all patches at the same time? Naively, it would seem more realistic that a small founder population would arrive at a patch, and that these foraging dynamics would play out in a context that involves not only food depletion but also population growth. Would the main conclusions of the model (about optimal foraging and evolutionary stability) still hold in a more realistic model that considers such expected natural population dynamics? Third, the key conceptual assumption is that all patches are either colonized together or left unoccupied. It would be helpful to provide references supporting this assumption. Fourth, the statement at line 135 that &quot;worms have no way to tell if they are in the overcrowded or under-crowded environment&quot; seems at first sight to be inconsistent with the very idea of pheromone signalling. Can you please clarify? Since the mathematical model -- currently relegated to the supplement -- forms an important part of the manuscript, we think that it should be clearly summarized in the main text with an accompanying figure, taking into account all the concerns raised above.</p><p>- Why was the natural isolate MY1 used? Would the results change with a different strain? Would it be feasible to consider a mutant with blocked pheromone sensing as a null control?</p><p>- Could the observed behavior be related to recent observations of nontrivial collective behavior in <italic>C. elegans</italic> (e.g., &quot;<italic>C. elegans</italic> collectively forms dynamical networks&quot;, Sugi et al., 2019, Nat. Comm.; &quot;Shared behavioral mechanisms underlie <italic>C. elegans</italic> aggregation and swarming&quot;, Ding et al., 2019, <italic>eLife</italic>)?</p><p>- The worms are described in the text to be constantly leaving the patch but the supplement states that each worm only leaves when the food intake decreases below a certain threshold value. Could you please explain the seemingly contradictory statements?</p><p>- You might want to consider citing &quot;Information socialtaxis and efficient collective behavior emerging in groups of information-seeking agents&quot; by Karpas et al., (2017, PNAS), and related work, on how optimal foraging is different in group as opposed to individual contexts.</p><p>- You might also want to consider the following reference, perhaps relevant for the discussion: &quot;Measuring <italic>Caenorhabditis elegans</italic> Spatial Foraging and Food Intake Using Bioluminescent Bacteria&quot; (Ding et al., 2020, Genetics).</p><p>[Editors' note: further revisions were suggested prior to acceptance, as described below.]</p><p>Thank you for submitting your article &quot;Inversion of pheromone preference optimizes foraging in <italic>C. elegans</italic>&quot; for consideration by <italic>eLife</italic>. Your article has been reviewed by three peer reviewers, and the evaluation has been overseen by a Reviewing Editor and Christian Rutz as the Senior Editor. The following individual involved in the review of your submission has agreed to reveal their identity: Sreekanth H Chalasani (Reviewer #4).</p><p>The reviewers have discussed their reviews with one another, and the Reviewing Editor has drafted this decision letter to help you prepare a revised submission.</p><p>Summary:</p><p>The reviewers concur that this article offers an interesting conclusion regarding optimal foraging and chemosensory valence. However, they also agree that it would benefit from a second round of revision, aiming at an improved precision of language and a better discussion of the assumptions of the model and experimental conclusions.</p><p>Essential Revisions:</p><p>1) A summary of the model and its most important parameters appears to be necessary. The revised version is still unsatisfactory from this point of view.</p><p>2) The paper still requires some improvement on the precision of language.</p><p>3) The discussion of the assumptions of the model and experimental conclusions could be further improved.</p><p>For more detail about these points, please read the Recommendations by the Reviewers.</p><p><italic>Reviewer #1:</italic></p><p>Many aspects of the manuscript have improved in this revision but unfortunately, I feel that the authors still haven't adequately incorporated the model details into the manuscript. I do feel strongly that one shouldn't show model predictions (Figure 2) without a summary of the model and its most important parameters. Such a summary is necessary so that readers can reasonable judge the modeling choices. I also disagree with the authors own assessment &quot;The model is now extensively described in the main text (lines 123-159)&quot;. One cannot read these lines and easily recreate any sense of the model. There are many more details given in the &quot;Foraging model&quot; section of the supplement, but these details are also not presented in such a way so that the model architecture is clear.</p><p>One small comment for the abstract:</p><p>Line 22 consider removing &quot;model&quot; or changing to &quot;animal model&quot; to distinguish from the computational model</p><p><italic>Reviewer #2:</italic></p><p>The authors present experiments that demonstrate how <italic>C. elegans</italic> worms bias their foraging decisions depending on feeding history and sensory cues (here, called pheromones) that reflect the density of worms. Navigational preference for these sensory cues is found to change from attractive to repulsive depending on the time at which worms leave a food patch, and additional experiments that condition worms under different combinations of conditions (with/without the sensory cues, with/without food, with/without repellent) indicate that associative learning is involved in this inversion of preference. A mathematical model is provided to argue that this inversion represents an optimal foraging strategy that is also evolutionarily stable.</p><p>I am satisfied that the edits made by the authors sufficiently addressed concerns I raised in the previous round.</p><p><italic>Reviewer #4:</italic></p><p>The authors use the nematode <italic>C. elegans</italic> to reveal how animals associate social signals with specific contexts and modify their behaviors. Specifically, they show that <italic>C. elegans</italic> leaving a food patch are attracted to pheromonal cues, while those leaving later are repelled from pheromones. The authors using a behavioral model to suggest that the switch from attraction to repulsion is likely due to a change in learning. This study links learning with social signals providing a framework for further analysis into the underlying neuronal pathways.</p><p>Line 36 + 46: The word decision is used but lacks definition. Decision-making in <italic>C. elegans</italic> is controversial and should require precise language in using. If there is a decision to be made regarding exploitation of a food patch, what are the possible actions that the animal can choose to take?</p><p>Line 58: Similarly, the term associative learning requires definition.</p><p>Line 99: As stated in the rebuttal, MY1 was used as (1) it was deemed to be more natural/ethological and (2) it is known to respond to synthetic pheromones. It is unclear whether or not the use of N2 in these experiments would change the results. If these results do not hold in N2, this is of note because it could lead to interesting follow-up experiments aiming to identify the biology underlying the MY1-specific behavior. The use of MY1 is cause for concern in truly placing these results within the full body of <italic>C. elegans</italic> literature. It seems prudent that the use of this strain be further addressed in the discussion.</p><p>How far do pheromones diffuse to (within the detectable limit of a <italic>C. elegans</italic>)? Is it clear that the decision to leave a patch is made without knowledge of other food patches? Or is it possible that the animals are receiving pheromonal cues about other patches even while residing on a food patch bathed in pheromones. This distinction seems important to both the conclusions of the paper and the model and are not discussed in the body of the text. Can the diffusion of pheromones be experimentally defined or modeled to support the assumptions of the foraging model?</p><p>Is this foraging model ethological? Would worms not have a much lower payoff of leaving their patch in their natural boom-and-bust environment? Specifically, would patch density not be significantly lower in a natural environment such that switching patches is not beneficial until much later in food depletion (which could presumably be generations later)? Consider the spatial scale of a <italic>C. elegans</italic> to a rotting fruit.</p><p>Line 218: This brings up an interesting discussion point. The model and experiments assume stationarity of the pheromone blend over time with an inversion of valence occurring due to associative learning and satiety. However, would the pheromone blend not change throughout the course of the experiment? Could the specific combination of pheromones in the blend possibly be cause for the valence change?</p><p>Overall, I think this paper offers an interesting conclusion regarding optimal foraging and chemosensory valence. However, I do think it would benefit from precision of language and better discussion of the assumptions of the model and experimental conclusions.</p><p>[Editors' note: further revisions were suggested prior to acceptance, as described below.]</p><p>Thank you for resubmitting your work entitled &quot;Inversion of pheromone preference optimizes foraging in <italic>C. elegans</italic>&quot; for further consideration by <italic>eLife</italic>. Your revised article has been evaluated by Christian Rutz (Senior Editor), Antonio Celani (Reviewing Editor), and two reviewers.</p><p>Summary:</p><p>This paper will be of interest to scientists in the field of animal behaviour with a focus on foraging, navigation and the integration of sensory cues. Experimental data obtained with <italic>C. elegans</italic> convincingly demonstrate an inversion of preferences depending on the presence of other individuals. The authors interpret this behaviour as an optimal foraging strategy but the modelling in support of this conclusion could be improved.</p><p>Del Bello et al., present experiments that demonstrate how <italic>C. elegans</italic> worms bias their foraging decisions depending on feeding history and sensory cues (pheromones) that reflect the density of worms. Navigational preference for these sensory cues is found to change from attractive to repulsive depending on the time at which worms leave a food patch, and additional experiments that condition worms under different combinations of conditions (with/without the sensory cues, with/without food, with/without repellent) indicate that associative learning is involved in this inversion of preference. A mathematical model is provided to argue that this inversion represents an optimal foraging strategy that is also evolutionarily stable.</p><p>The paper offers an interesting conclusion regarding optimal foraging and chemosensory valence that is mostly supported by the data. However, the modelling part is comparatively weaker. Below is a list of the issues that still need to be addressed:</p><p>– How reasonable is the assumption that all worms start in all patches at the same time? Naively, it would seem more realistic that a small founder population would arrive at a patch, and that these foraging dynamics would play out in a context that involves not only food depletion but also population growth. Would the main conclusions of the model (about optimal foraging and evolutionary stability) still hold in a more realistic model that considers such expected natural population dynamics?</p><p>– How far do pheromones diffuse to (within the detectable limit of a <italic>C. elegans</italic>)? Is it clear that the decision to leave a patch is made without knowledge of other food patches? Or is it possible that the animals are receiving pheromonal cues about other patches even while residing on a food patch bathed in pheromones. This distinction seems important to both the conclusions of the paper and the model and is not discussed in the main text. Can the diffusion of pheromones be experimentally defined or modeled, to support the assumptions of the foraging model?</p><p>– Is this foraging model ethological? Would worms not have a much lower payoff of leaving their patch in their natural boom-and-bust environment? Specifically, would patch density not be significantly lower in a natural environment such that switching patches is not beneficial until much later in food depletion (which could presumably be generations later)?</p><p>– The model and experiments assume stationarity of the pheromone blend over time with an inversion of valence occurring due to associative learning and satiety. However, would the pheromone blend not change throughout the course of the experiment? Could the specific combination of pheromones in the blend possibly be cause for the valence change?</p><p>– Finally, we wish to draw your attention to the STRANGE framework for animal behaviour research, which is currently being adopted by <italic>eLife</italic> and seems relevant to your study: https://doi.org/10.1038/d41586-020-01751-5</p><p><italic>Reviewer #1:</italic></p><p>I am now satisfied with the improved presentation of model details.</p><p>I do note a typo in the caption of Figure 2: &quot;During the first phase, worms equalize occupancy the occupied patches.&quot;</p><p><italic>Reviewer #4:</italic></p><p>Gore et al., show that <italic>C. elegans</italic> leaving food patches at different times and different preferences to pheromones. Animals leaving early are attracted, while those leaving later are repelled from pheromones. I have no concerns with the data. Most of my concerns are with the model.</p><p>It remains unclear whether the inversion is due the association of pheromones with food odorants or due to food-deprivation. I would recommend either testing these two possibilities or clarifying this in the manuscript with specific predictions for each outcome.</p><p>Line 192 – Evolutionary Stable Strategy is introduced for the first time, but is neither defined nor cited. Further, small typo exists with the word &quot;the&quot; on this line.</p></body></sub-article><sub-article article-type="reply" id="sa2"><front-stub><article-id pub-id-type="doi">10.7554/eLife.58144.sa2</article-id><title-group><article-title>Author response</article-title></title-group></front-stub><body><disp-quote content-type="editor-comment"><p>Essential revisions:</p><p>Overall, the results are interesting and clearly presented but could be better supported by experiments and modeling. The paper is of high quality and would be of interest to the readership of eLife provided that the following crucial remarks on experiments and modeling are duly addressed by a major revision.</p><p>Experiments:</p><p>Regarding the interpretation of the data in Figure S2, which was designed to test for associative learning in the preference for specific pheromone molecules (synthetic ascarosides). You state in the main text that the results in Figure 3 of associative learning experiments with the 'pheromone blend' (i.e., supernatant from worms in liquid culture) could be 'recapitulated' with these pure forms of the pheromone molecules, but the data appear to contradict this statement. It appears that difference in navigational preference for these pheromone molecules exist between worms conditioned in the +food and -food conditions, regardless of whether the pheromone molecules are present during the conditioning. Thus, it appears as if the preference for these pheromones might be explained by feeding status only, without associative learning. Have we missed something here? The results of Figure 3 are still consistent with associative learning, but the results of Figure S2 appear to suggest that the cues involved in the associative learning are different from the specific pheromones tested within Figure S2, and must in fact override the feeding-state dependent preference to these specific ascaroside molecules. This leaves us wondering whether it is fair to conclude that the sensory cues involved in the associative learning are really pheromone molecules. Can you rule out that the learning is a response to other substances in the supernatant, e.g. (in their own words) &quot;other products of worm metabolism, compounds deriving from the decomposition of dead worms and bacteria, and perhaps other unknown substances&quot;?</p></disp-quote><p>We apologize that we were not more clear regarding the similarities and differences between the experiments with the two synthetic ascarosides (ascr#5 and icas#9, Figure S2 – now Figure 3 —figure supplement 1) as compared to those done with the pheromone blend (Figure 3). As we now specify in our revised version of the main text (see below), the experiments with the synthetic ascarosides were performed at high worm density for practical reasons and their results mimic those with the pheromone blend done at high worm density (inset Figure 3B). Animals conditioned without ascarosides (with and without food) could be exposed to the cocktail of pheromones excreted during the conditioning period. This is a confounding factor that prevented us from collecting definitive evidence that associative learning was the only mechanism driving the change in preference for both ascarosides. Nonetheless, our experiments do indicate that <italic>C. elegans</italic> can change its preference for two of its pheromones, demonstrating that these ascarosides are among the signaling molecules involved in the optimization of foraging behavior. We have therefore replaced the previous discussion with the following paragraph to the main text (lines 220-236):</p><p>“In addition to a cocktail of ascaroside pheromones, the pheromone blend contains other products of worm metabolism, compounds deriving from the decomposition of dead worms and bacteria, and perhaps other unknown substances. Worms could in principle learn and change preference for any of these compounds and thus forage efficiently as indicated by our model. To probe whether specific pheromones are involved in the foraging optimization we asked two questions: 1. Can <italic>C. elegans</italic> attraction to ascarosides be turned into repulsion? 2. Can <italic>C. elegans</italic> learn with ascarosides? To address these questions, we conducted the conditioning experiments with two synthetic ascarosides, ascr#5 and icas#9, instead of the pheromone blend. We found that <italic>C. elegans</italic> can change its preference for both ascarosides (Figure 3 —figure supplement 1), suggesting that ascaroside pheromones are likely contributing to the response to the pheromone blend found previously. However, these experiments were performed at high worm density, meaning that accumulation of secreted pheromones during the conditioning period prevents a definitive quantification of the relative importance of associative learning versus feeding status (as in Figure 3 inset with the pheromone blend). Nonetheless, these results show that <italic>C. elegans</italic> can alter its preference for ascarosides, highlighting the flexible role of pheromones in foraging optimization.”</p><p>In addition, we have changed the caption of Figure 3 —figure supplement 1 (previous Figure S2), which now reads:</p><p>“Attraction towards two ascarosides, ascr#5 and icas#9, can be turned into repulsion. A. Schematic of the conditioning experiment. Worms grow at high density and with plenty of food until they are young adults. Animals are then transferred to conditioning plates, where they spend 5 hours, before being assayed for chemotaxis to the pure ascaroside. B. Chemotaxis index (CI) is shown for the four different conditioning scenarios: + food + ascaroside (blue bars); – food + ascaroside (yellow bars); + food– ascaroside (red bars); – food – ascaroside (turquoise bars). Points indicate the outcome of each independent replicated experiment (n=4 for each ascaroside) while bars indicate the CI ± SEM across independent experiments. If attraction is turned into repulsion by the feeding status only, we expect the blue and red bars not to differ and the CI to be positive, while the yellow and turquoise bars not to differ and the CI to be either negative or equal to zero. In the experiment with ascr#5 (on the left), the CI is positive in the + food + ascaroside and the + food– ascaroside scenarios, but it differs in the two conditions without food, being negative in the – food + ascaroside scenario and not differing from zero in the – food – ascaroside scenario. These results are consistent with a combination of associative learning and feeding status driving the change in preference for ascr#5. In the experiment with icas#9 (on the right), the CI in the two conditions with food does not differ, mostly because of the large variability among the repetitions of the + food– ascaroside scenario (red points). The CI in the two conditions without food is instead negative. The most parsimonious explanation for the change in preference for icas#9 is the different feeding status rather than associative learning, although the accumulation of secreted pheromones during the conditioning period (due to the high worm density in the conditioning plates) may once again obscure the evidence of associative learning (as in the inset of Figure 3).”</p><p>We have also added a paragraph in the discussion (lines 370-382):</p><p>“Although we could not exclude the influence of the worms’ feeding status in driving the change of preference for specific ascaroside pheromones, we showed that <italic>C. elegans</italic> attraction to two ascarosides can be turned into repulsion. Ascr#5 and icas#9 are potent signaling cues that are usually detected in <italic>C. elegans</italic> exudates (Von Reuss et al., 2012), but other ascarosides can be abundant and the list of newly discovered compounds of the worm metabolism acting as signaling molecules is continuously expanding (Von Reuss et al., 2012). The ability to assign a positive or negative preference to the pheromone blend through associative learning might depend also on other byproducts of worm metabolism or derive from the presence of multiple ascaroside molecules acting synergistically (Srinivasan et al., 2012). More studies are required to establish a link between associative learning and the composition of the pheromone blend, which is known to vary among developmental stages (Kaplan et al., 2011), sexes (Izrayelit et al., 2012) and strains (Diaz et al., 2014), ultimately allowing the discovery of novel roles for <italic>C. elegans</italic> pheromones (Viney and Harvey, 2017).”</p><disp-quote content-type="editor-comment"><p>You may want to consider conducting additional experiments (to find other pheromone molecules that do demonstrate evidence for associative learning), or to just change relevant wording to avoid committing to what appears to be at present a weakly supported conclusion.</p></disp-quote><p>We agree that experiments performed at low worm density or experiments using different ascarosides could help strengthen our findings. However, given the current situation, we decided to change our wording and tone down the conclusion that particular pheromones are the only molecules involved in the observed associative learning (lines 220-236). We also added a paragraph in the discussion detailing why the complex cocktail of pheromones is, as a whole, the most plausible sensory cue driving associative learning, although more studies would be required to establish the link between the composition of the pheromone blend and associative learning phenomena (lines 370-382). See previous point.</p><disp-quote content-type="editor-comment"><p>Mathematical modeling:</p><p>Although conceptually appealing, the modeling appears to be an add-on to the experimental results. It also seems to suffer from weaknesses that should be addressed as detailed below. First, it would seem that at least some of the analysis results (e.g., that equal petitioning would be optimal) might depend on the assumption that all patches are of equal size. This does seem a strong assumption if the model is to be considered relevant to natural ecology. Which of the model-based conclusions are still valid if this assumption is removed?</p></disp-quote><p>We agree with the reviewers that, under natural conditions, food patches can exhibit different initial bacterial density and/or size. Differences in the initial density of food have been thoroughly discussed in the optimal foraging literature and are usually reflected by differences in feeding rates. We don’t expect any qualitatively new effect emerging from this. In this revision, we focused on differences in patch size, which, instead, translate into changes in the time that it takes to deplete them. By adjusting the instantaneous feeding rate to reflect this, we could show that introducing food patches with different sizes does not qualitatively change our results. Behaviors available to worms (remaining in the current patch, switching to another pheromone-marked patch or dispersing in search for unmarked patches) are still the same. While it is true that remaining in the patches is better than switching in the case in which the largest patches contain larger numbers of individuals, on average, it is still optimal to switch before the patch is depleted following pheromone cues. We discuss the details of this important addition to the model in the Supplementary material (lines 808-855), providing the changes introduced in the equations and showing the results in an additional figure (Figure 2 —figure supplement 2):</p><p>“Food patches of different sizes and qualities</p><p>The above calculations assume that all food patches are identical, having an initial density <inline-formula><mml:math id="inf199"><mml:msub><mml:mi>A</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula> and the same sizes. In reality, food patches will differ both in their initial density and their size.</p><p>[…]</p><p>Unlike the case with identical food patches, even for <inline-formula><mml:math id="inf200"><mml:mrow><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:math></inline-formula> the equilibrium probability can be different than 1, and it depends on the initial distribution of individuals, and the distribution of patch sizes. In fact, it is possible to start in a situation in which switching is detrimental: If large patches contain more individuals at the beginning, remaining in the patches will produce a more balanced depletion than switching to equalize the number of individuals per patch. However, this good match between patch size and number of individuals is unlikely. In nature one would expect little or no correlation between patch size and initial number of individuals. In this case, the average result is very similar to the case with identical food patches (Figure 2—figure supplement 2).”</p><p>We specify in the main text that incorporating different patch sizes does not change results at lines 145-147, which now reads:</p><p>“This result is independent of any other parameters, such as number of patches, their size or initial distribution of worms (see Supplement).”</p><disp-quote content-type="editor-comment"><p>Second, how reasonable is the assumption that all worms start in all patches at the same time? Naively, it would seem more realistic that a small founder population would arrive at a patch, and that these foraging dynamics would play out in a context that involves not only food depletion but also population growth. Would the main conclusions of the model (about optimal foraging and evolutionary stability) still hold in a more realistic model that considers such expected natural population dynamics?</p></disp-quote><p>It would indeed be very interesting to study the effects of population growth, but we believe it is not a basic feature of our setting and would add unnecessary complication in our model. Indeed, patch-leaving in <italic>C. elegans</italic>, both in our experiments and also in its habitat, occurs in a timescale of a few hours, which is insufficient for significant population growth.</p><disp-quote content-type="editor-comment"><p>Third, the key conceptual assumption is that all patches are either colonized together or left unoccupied. It would be helpful to provide references supporting this assumption.</p></disp-quote><p>This was unclear in our previous version, as it is not strictly required that all food patches are colonized at the same time. The only requirement of our model is that all food patches are depleted at roughly the same time, which is a characteristic of boom-and-burst life cycles. The starting time of our model could be understood as the time at which the worms colonize the food patches, but it can also be understood as any other later time in which the distribution of individuals is unequal across the food patches, and this is compatible with a progressive colonization. We have eliminated the part of the sentence in the discussion that previously stated that the food patches were colonized at the same time (lines 328-329), which now reads:</p><p>“The third key factor in our model is non-stationarity: we assume that all pheromone-marked food patches will be depleted at roughly the same time.”</p><p>Fourth, the statement at line 135 that &quot;worms have no way to tell if they are in the overcrowded or under-crowded environment&quot; seems at first sight to be inconsistent with the very idea of pheromone signalling. Can you please clarify?</p><p>We agree with the reviewers that sentence was unclear and inconsistent with the idea of pheromone signaling. What we meant is that even if an individual can assess the density of its conspecifics (using pheromones) in its current food patch, it has no reliable information about the colonization status of other patches. As such, it cannot tell whether it is in the more crowded or less crowded patch. We have corrected the statement in the main text (lines 137-139), which now reads:</p><p>“Worms have no way to tell whether they are in the overcrowded or in the undercrowded patch because, even if they can assess worm density in their current food patch, they have no reliable information about the other.”</p><disp-quote content-type="editor-comment"><p>Since the mathematical model -- currently relegated to the supplement -- forms an important part of the manuscript, we think that it should be clearly summarized in the main text with an accompanying figure, taking into account all the concerns raised above.</p></disp-quote><p>We expanded the current Figure 2, which was already about the model results, adding a panel showing the expected payoff for each strategy and the equilibrium switching probabilities. The model is now extensively described in the main text (lines 123-159). Equations, proofs and details about the different conditions under examination are instead in the Supplement.</p><p>Here is how it reads in the new version of the main text:</p><p>“The scenario described in our model implies that there are two types of food patches, those that are occupied by worms and those that are not. We assumed that the occupied patches are easier to find as a result of either being nearby or because of the accumulation of pheromones secreted by the worms. Dispersing away from the occupied food patches in search for unoccupied ones therefore gives a low average payoff (<inline-formula><mml:math id="inf201"><mml:msub><mml:mi>g</mml:mi><mml:mi>D</mml:mi></mml:msub></mml:math></inline-formula>), not being advantageous until the occupied food patches are depleted (see Supplement). However, these patches will generically be occupied in a non-equal manner, meaning that one patch will be consumed before the other. Under these conditions, we asked which strategy maximizes individual food intake. For the sake of illustration, in Figure 2 we depict the simplest scenario, with two patches that are colonized by worms and another that is uncolonized.</p><p>Initially, worms should stay in the occupied patches, but they can either remain in their initial one or switch to the other occupied patch (by leaving their current patch and following pheromones to the neighboring patch) (Figure 2A). If all worms remain in their initial patch the overcrowded food patch will be depleted faster, so worms occupying it will benefit from switching to another occupied patch (Figure 2B). Worms have no way to tell whether they are in the overcrowded or in the undercrowded patch because, even if they can assess worm density in their current food patch, they have no reliable information about the other. However, since the majority of individuals are in the overcrowded patch, every individual has a higher probability of being there. Therefore, all worms have an incentive to switch to the other occupied patch during the initial phase (blue area in Figure 2B).</p><p>How many worms should then switch? If we assume that worms attempting to switch may in fact end up in any of the occupied patches (including the initial one) with equal probability, then all worms should attempt to switch (Figure 2C, blue). This result is independent of any other parameters, such as number of patches, their size or initial distribution of worms (see Supplement). If we assume that switching to other occupied patches is costly, then the optimal switching probability will be lower (Figure 2C, orange), but the predictions of the model remain qualitatively unaltered (see Supplement). This model therefore predicts an Evolutionary Stable Strategy in which some worms leave a patch before it is depleted and follow the pheromone cue (Figure 2A). This initial phase helps equalize worm occupancy and feeding across food patches.</p><p>Once worm numbers are equalized in the two easy-to-find food patches, worms feed until the food becomes scarce. At this point, worms benefit from leaving the depleted patches (gray area in Figure 2B) and avoiding pheromones, since pheromones now mark depleted food patches. The inversion of pheromone preference therefore helps worms to disperse to unoccupied food patches. This simple model thus predicts both different leaving times and the inversion of pheromone preference and highlights that, together, these phenomena might maximize food intake of worms foraging in a patchy environment.”</p><disp-quote content-type="editor-comment"><p>- Why was the natural isolate MY1 used? Would the results change with a different strain? Would it be feasible to consider a mutant with blocked pheromone sensing as a null control?</p></disp-quote><p>We chose a natural isolate because we wanted to assess behavioral patterns that could be as close as possible to those exhibited by <italic>C. elegans</italic> in its natural habitat. We now specify this at lines 97-99, which read:</p><p>“We used young adult hermaphrodites of the natural isolate MY1 (Lingen, Germany) to assess behavioral patterns that could be as close as possible to those exhibited by <italic>C. elegans</italic> in its natural habitat.”</p><p>In addition, a recent study found that MY1, compared to other natural isolates, responds to synthetic pheromones (Greene et al., 2016). In the initial phases of this project, we explored changes in the behavioral response to the pheromone blend in the standard lab strain N2 — which mimicked those of MY1 at high worm density — and in a daf-22 mutant. However, we later focused just on MY1, which is the only strain for which we have a detailed analysis of foraging and changes in the behavioral responses to pheromones.</p><disp-quote content-type="editor-comment"><p>- Could the observed behavior be related to recent observations of nontrivial collective behavior in <italic>C. elegans</italic> (e.g., &quot;<italic>C. elegans</italic> collectively forms dynamical networks&quot;, Sugi et al., 2019, Nat. Comm.; &quot;Shared behavioral mechanisms underlie <italic>C. elegans</italic> aggregation and swarming&quot;, Ding et al., 2019, eLife)?</p></disp-quote><p>We don’t think it is strongly related because the aggregation and swarming phenomena described by the above-mentioned papers seem to require longer timescales compared to those examined in our experiments and have been studied on homogeneous bacterial lawns. In a similar setting, however, it has been shown that some ascaroside pheromones are able to promote aggregation in <italic>C. elegans</italic> (e.g. Greene et al., 2016 and data collected by the authors). Despite our belief that these phenomena don’t seem to apply to our results, we mentioned the potential link between our results and aggregation behavior in the discussion referring to these relevant studies (lines 363-369).</p><p>“Our findings establish an interesting parallel between mechanisms promoting dispersal over short and long temporal scales and highlight the important role that non-dauer stages play in exploiting transient bacterial patches. They also point to the emergence of interesting group dynamics promoted by this synergistic interaction between food and pheromones, adding to the wealth of studies addressing aggregation behaviors in <italic>C. elegans</italic> (Ding et al., 2019; Greene et al., 2016; Sugi et al., 2019).”</p><disp-quote content-type="editor-comment"><p>- The worms are described in the text to be constantly leaving the patch but the supplement states that each worm only leaves when the food intake decreases below a certain threshold value. Could you please explain the seemingly contradictory statements?</p></disp-quote><p>We have added a clarifying statement in the Supplement (lines 723-728) which reads:</p><p>“In the experiment we observed <italic>C. elegans</italic> individuals leaving the food patch continuously, while our model predicts that they should all switch at t=0. This difference is due to the simplicity of the model, which neglects factors such as inter-individual differences and stochasticity. Despite this simplicity, the model captures the key feature that individual worms leave their initial food patch before it is depleted (switching behavior), which is a counterintuitive idea in the context of optimal foraging.”</p><disp-quote content-type="editor-comment"><p>- You might want to consider citing &quot;Information socialtaxis and efficient collective behavior emerging in groups of information-seeking agents&quot; by Karpas et al., (2017, PNAS), and related work, on how optimal foraging is different in group as opposed to individual contexts.</p></disp-quote><p>Thanks for the suggestion. We have integrated this reference and others about collective foraging in the introduction.</p><disp-quote content-type="editor-comment"><p>- You might also want to consider the following reference, perhaps relevant for the discussion: &quot;Measuring <italic>Caenorhabditis elegans</italic> Spatial Foraging and Food Intake Using Bioluminescent Bacteria&quot; (Ding et al., 2020, Genetics).</p></disp-quote><p>We thank the reviewers for the suggestion. We added a sentence to discuss the findings of this relevant paper in the discussion (lines 303-309).</p><p>“A recent paper on <italic>C. elegans</italic> foraging contradicts this general assumption of diminishing returns, showing a near-linear depletion of food patches (Ding et al., 2020). This result was obtained in laboratory conditions, with very rich and uniform food patches, which may not reflect natural ones, but at least indicates that the general assumption of diminishing returns is relatively easy to break, and opens the question of whether more care should be put in assessing the conditions in which current optimal foraging models are applicable.”</p><p>[Editors' note: further revisions were suggested prior to acceptance, as described below.]</p><disp-quote content-type="editor-comment"><p>Essential Revisions:</p><p>1) A summary of the model and its most important parameters appears to be necessary. The revised version is still unsatisfactory from this point of view.</p><p>2) The paper still requires some improvement on the precision of language.</p><p>3) The discussion of the assumptions of the model and experimental conclusions could be further improved.</p></disp-quote><p>We thank the Editor and Reviewers for the positive evaluation as well as for the suggestions and the summary of requested changes. Please see below for how we have modified the manuscript to address each of the detailed comments.</p><disp-quote content-type="editor-comment"><p>For more detail about these points, please read the Recommendations by the Reviewers.</p><p>Reviewer #1:</p><p>Many aspects of the manuscript have improved in this revision but unfortunately, I feel that the authors still haven't adequately incorporated the model details into the manuscript. I do feel strongly that one shouldn't show model predictions (Figure 2) without a summary of the model and its most important parameters. Such a summary is necessary so that readers can reasonable judge the modeling choices. I also disagree with the authors own assessment &quot;The model is now extensively described in the main text (lines 123-159)&quot;. One cannot read these lines and easily recreate any sense of the model. There are many more details given in the &quot;Foraging model&quot; section of the supplement, but these details are also not presented in such a way so that the model architecture is clear.</p></disp-quote><p>We understand the concern of the reviewer and we further expanded the description of the model implementation (lines 122-192). To improve readability, in the main text we describe a simpler model with three food patches (two unevenly occupied and one unoccupied by worms) and provide a more complex version with n food patches and patches of different sizes in the supplement. We now detail the assumptions about the actions available to worms (switching to another occupied food patch or remaining in the current one) and include the derivation of the equations for the calculation of the expected payoff associated with both actions (Equation 3a and 3b), based on the per capita food intake achieved in each food patch (Equation 2) and the probability of reaching either of the two patches after switching (Equation 1). Finally, we describe how the model gives an evolutionary stable strategy. We have also improved Figure 2. Panel B highlights how the expected payoff for each strategy changes with the proportion of worms deciding to switch. Panel C is a heatmap showing the dependence of the equilibrium probability to switch (p*) on the cost of switching and the initial fraction of worms in the more crowded patch. We think that these improvements will allow the reader to get a concrete sense of the model.</p><p>The main text now reads (lines 122-192 and Figure 2):</p><p>“A simple model shows that the inversion of the preference for pheromones can be a strategy that optimizes foraging</p><p>Inside rotting fruits and stems where <italic>C. elegans</italic> forage, bacterial food is patchily distributed (Frézal and Félix, 2015; Schulenburg and Félix, 2017). We might then expect that the timing of dispersal from existing food patches and the strategies that optimize food intake are crucial for worm survival. A natural question then arises: can the behaviors we observed in our experiments provide any benefit to <italic>C. elegans</italic> foraging? We addressed this question with a simple theoretical model exploring the optimality of the inversion in pheromone preference in the context of foraging in a heterogeneous environment. […] Our model recapitulates the two key experimental observations highlighted in Figure 1: First, a fraction of worms will switch at the beginning, leaving the food patch before it is depleted and following pheromones to reach another occupied food patch. Second, once the food patches are depleted all worms will disperse, avoiding depleted food patches by reversing their preference for pheromones (which now mark depleted food patches). Here we have illustrated these results with a simplified model, with two identical food patches and in which worms can only switch or disperse at particular times. A more general model in which individuals can move at any time between any number of food patches of equal or different sizes gives the same the Evolutionary Stable Strategy (see Supplement).”</p><p>We have changed the notation in the supplement to be consistent with the equations included in the main text. Finally, we have added a paragraph in the discussion about the Evolutionary Stable Strategy found by our model (lines 366-374).</p><p>“It’s interesting to note that the Evolutionary Stable Strategy found by our model does not give any benefit at the level of the species, and may even be deleterious. If we compute the average expected payoff across the whole population using the same rational as for Equation 3, we get <inline-formula><mml:math id="inf202"><mml:mrow><mml:msub><mml:mrow><mml:mo form="prefix" stretchy="true">⟨</mml:mo><mml:mi>H</mml:mi><mml:mo form="postfix" stretchy="true">⟩</mml:mo></mml:mrow><mml:mtext mathvariant="normal">all</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>2</mml:mn><mml:msub><mml:mi>A</mml:mi><mml:mi>E</mml:mi></mml:msub></mml:mrow><mml:mi>N</mml:mi></mml:mfrac><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mi>c</mml:mi></mml:mrow></mml:math></inline-formula>. Therefore, increasing the probability of switching (<inline-formula><mml:math id="inf203"><mml:mi>p</mml:mi></mml:math></inline-formula>) has no effect on this population-level payoff when it’s costless, and decreases it when it’s costly. This Evolutionary Stable Strategy therefore emerges from intra-specific competition: Individuals benefit from paying the cost of switching to prevent being outcompeted by other individuals within the population, even if the end result is deleterious for the population as a whole.”</p><disp-quote content-type="editor-comment"><p>One small comment for the abstract:</p><p>Line 22 consider removing &quot;model&quot; or changing to &quot;animal model&quot; to distinguish from the computational model</p></disp-quote><p>Following the reviewer’s suggestion, we have modified the sentence to specify that we are using <italic>C. elegans</italic> is the animal model (line 22).</p><p>“To study how social information transmitted via pheromones can aid foraging decisions, we investigated the behavioral responses of the model animal <italic>Caenorhabditis elegans</italic> to food depletion and pheromone accumulation in food patches.”</p><disp-quote content-type="editor-comment"><p>Reviewer #4:</p><p>The authors use the nematode <italic>C. elegans</italic> to reveal how animals associate social signals with specific contexts and modify their behaviors. Specifically, they show that <italic>C. elegans</italic> leaving a food patch are attracted to pheromonal cues, while those leaving later are repelled from pheromones. The authors using a behavioral model to suggest that the switch from attraction to repulsion is likely due to a change in learning. This study links learning with social signals providing a framework for further analysis into the underlying neuronal pathways.</p><p>Line 36 + 46: The word decision is used, but lacks definition. Decision-making in <italic>C. elegans</italic> is controversial and should require precise language in using. If there is a decision to be made regarding exploitation of a food patch, what are the possible actions that the animal can choose to take?</p></disp-quote><p>We understand the reviewer’s concern about the controversies around the word “decision”. We decided to rephrase the paragraph and add a few sentences to explain the behavioral choices/actions available to an animal when feeding in a food patch that gives diminishing returns 32-48.</p><p>“Foraging for food is among the most critical activities for an animal's survival (Calhoun et al., 2014). It is also among the most challenging, because food is usually patchily distributed in space and time, and other individuals are attempting to find and consume the same resources (Abu Baker and Brown, 2014; Driessen and Bernstein, 1999; Stephens and Krebs, 1987).</p><p>An important factor, which has been the focus of considerable effort in models of foraging behavior, is for how long to exploit a food patch. At any given time, an individual feeding in a food patch has to choose between leaving to search for a better patch or staying. Leaving incurs the cost of exploring an unknown territory, while staying results in the cost of feeding in a depleting food patch. Most models addressing this “dilemma” involve patch assessment by individuals and postulate that the leaving time depends on local estimates of foraging success (Charnov, 1976; Oaten, 1977; Stephens and Krebs, 1987). As such, foragers are predicted to depart from a food patch when the instantaneous intake rate drops below the average intake rate expected from the environment, a phenomenon that has been observed in several animals, from insects (Wajnberg et al., 2008) to birds (Cowie, 1977; Krebs et al., 1974) and large mammals (Searle et al., 2005). The presence of other animals, however, affects individual foraging success so that different leaving times can be expected (Aubert-Kato et al., 2015; Couzin et al., 2005; Giraldeau and Caraco, 2000; Karpas et al., 2017).”</p><p>In addition, in the extended description of the model, we put these actions in the specific context of <italic>C. elegans</italic> feeding in a patchy environment (lines 134-145).</p><p>“Worms have three possible choices: (1) remain in their current food patch, (2) switch to another occupied food patch, and (3) disperse away from the occupied patches, in search for an unoccupied one. Switching means that a worm will leave its initial food patch and follow pheromone cues in order to find another occupied food patch. Dispersing means that the worm will leave its current food patch and avoid pheromones to maximize the probability of finding an unoccupied food patch. We assume that unoccupied food patches are hard to find, because they are not marked by pheromones and may be on average further away. Therefore, dispersal will not be advantageous until the occupied food patches are nearly depleted. A proof of this result, which closely resembles the marginal value theorem (Charnov, 1976), can be found in the supplement; here we will simply assume that worms will not disperse until the occupied food patches are depleted. Therefore, initially the individuals will choose between remaining or switching.”</p><disp-quote content-type="editor-comment"><p>Line 58: Similarly, the term associative learning requires definition.</p></disp-quote><p>We added the definition of associative learning. Now the sentence (lines 59-62) reads:</p><p>Moreover, it is not clear if the ability to use associative learning—the capacity to learn and remember the features of the environment that are associated with positive or aversive stimuli (Ardiel and Rankin, 2010)—to change the valence of pheromones could improve foraging success.</p><disp-quote content-type="editor-comment"><p>Line 99: As stated in the rebuttal, MY1 was used as (1) it was deemed to be more natural/ethological and (2) it is known to respond to synthetic pheromones. It is unclear whether or not the use of N2 in these experiments would change the results. If these results do not hold in N2, this is of note because it could lead to interesting follow-up experiments aiming to identify the biology underlying the MY1-specific behavior. The use of MY1 is cause for concern in truly placing these results within the full body of <italic>C. elegans</italic> literature. It seems prudent that the use of this strain be further addressed in the discussion.</p></disp-quote><p>We see the point raised by the reviewer. Based from our initial exploration, N2 could change its response to pheromones. However, since we did not perform the experiments at low density and with the repellent, we could not conclusively distinguish between feeding status and associative learning in driving the inversion of the pheromone preference. Although it is likely that the results of the above-mentioned experiments with N2 agree with MY1 observations, we agree with the reviewer that at the moment it is prudent to discuss the use of MY1 as a possible limitation of the generality of this study (see below). It is worth highlighting, however, that several natural strains show responses to pheromones very similar to MY1, mitigating the limitations deriving from the absence of experiments with N2.</p><p>The paragraph in the discussion (lines 429-437) reads:</p><p>“In conclusion, our study establishes a link between learning and social signals, providing a framework for further analysis unravelling the neuronal origin of the observed behaviors. However, the experiments presented here were performed with the natural isolate MY1. Thus, it remains to be tested if the same responses occur in the canonical lab strain N2, whose social behavior has changed due to laboratory domestication (Sterken et al., 2015), and in other natural strains with a social life more similar to MY1 (Greene et al., 2016). Nonetheless, by working with a natural isolate rather than N2, we could provide insights into the ecological significance of the inversion in the preference for pheromones and respond to the pressing need to further our knowledge of <italic>C. elegans</italic> ecology (Petersen et al., 2015).”</p><disp-quote content-type="editor-comment"><p>How far do pheromones diffuse to (within the detectable limit of a <italic>C. elegans</italic>)? Is it clear that the decision to leave a patch is made without knowledge of other food patches? Or is it possible that the animals are receiving pheromonal cues about other patches even while residing on a food patch bathed in pheromones. This distinction seems important to both the conclusions of the paper and the model and are not discussed in the body of the text. Can the diffusion of pheromones be experimentally defined or modeled to support the assumptions of the foraging model?</p></disp-quote><p>While these questions are very interesting, we believe that diffusion of the pheromone between patches is not a leading factor in our experiments or model: We focus on the behavior while worms are inside food patches, and in this case the concentration of pheromones coming from other worms in the patch is much higher than that coming from anywhere else. Given that it’s impossible to tell the origin of a detected molecule of pheromone, the higher concentration from the focal patch will mask emissions from any other food patches, even if diffusion is strong.</p><p>For example, consider a point source of pheromone with rate P. In three dimensions, the concentration profile at steady state is c(r) = P / (4*pi*D*r), where D is the diffusion constant of the pheromone and r is the distance to the source of the pheromone (e.g., the center of the occupied patch). We see that within a patch the concentration (and gradient) is always dominated by the local patch rather than a distant patch so long as the worm is closer to the patch that it is on rather than to any other patches. For example, the concentration of pheromone from the local patch is larger by a factor that is equal to the ratio of the distances, which will typically be larger than an order of magnitude. The ratio of gradients caused by the two patches is equal to the square of the ratio of distances, which is many orders of magnitude. Note that these conclusions are independent of the diffusion constant of the pheromone.</p><disp-quote content-type="editor-comment"><p>Is this foraging model ethological? Would worms not have a much lower payoff of leaving their patch in their natural boom-and-bust environment? Specifically, would patch density not be significantly lower in a natural environment such that switching patches is not beneficial until much later in food depletion (which could presumably be generations later)? Consider the spatial scale of a <italic>C. elegans</italic> to a rotting fruit.</p></disp-quote><p>From what we know about the ecology/ethology of <italic>C. elegans</italic>, it appears that adults do not travel from one apple to another because this type of dispersal depends on the dauer larva (see for example Frezal and Félix, <italic>eLife</italic> 2015; 4:e05849. DOI: 10.7554/<italic>eLife</italic>.05849). Therefore, in our model we are considering what happens, for example, inside one rotten apple, where food patches are bacterial colonies growing in different points of the apple. Patches on the same apple can have high density, get depleted over a timescale of hours or days, and travel between them occurs over a timescale of minutes or hours. This would justify the low cost associated with switching between food patches. We have clarified this in lines 139-141 of the revised manuscript.</p><p>“We assume that unoccupied food patches are hard to find, because they are not marked by pheromones and may be on average further away. Therefore, dispersal will not be advantageous until the occupied food patches are nearly depleted.”</p><disp-quote content-type="editor-comment"><p>Line 218: This brings up an interesting discussion point. The model and experiments assume stationarity of the pheromone blend over time with an inversion of valence occurring due to associative learning and satiety. However, would the pheromone blend not change throughout the course of the experiment? Could the specific combination of pheromones in the blend possibly be cause for the valence change?</p></disp-quote><p>In all the conditioning treatments in which we are adding the pheromone blend we can safely assume stationarity. The pheromone blend comes from a 9-day high-density liquid culture and thus is saturated with pheromones. Given that, the amount of pheromone leaked by the individual worms during the conditioning period (5 hours) is negligible and should not alter the pheromone blend. Accumulation of a pheromone cocktail different from the pheromone blend in the treatments without the addition of the pheromone blend was the reason why we performed the experiments at low worm density. However, temporal and spatial changes in the pheromone cocktail might be relevant in nature. Indeed, we cannot exclude that the composition of the pheromone cocktail plays a role in its valence as we state in the Discussion section at lines 413-420.</p><p>“The ability to assign a positive or negative preference to the pheromone blend through associative learning might depend also on other byproducts of worm metabolism or derive from the presence of multiple ascaroside molecules acting synergistically (Srinivasan et al., 2012). More studies are required to establish a link between associative learning and the composition of the pheromone blend, which is known to vary among developmental stages (Kaplan et al., 2011), sexes (Izrayelit et al., 2012) and strains (Diaz et al., 2014), ultimately allowing the discovery of novel roles for <italic>C. elegans</italic> pheromones (Viney and Harvey, 2017).”</p><disp-quote content-type="editor-comment"><p>Overall, I think this paper offers an interesting conclusion regarding optimal foraging and chemosensory valence. However, I do think it would benefit from precision of language and better discussion of the assumptions of the model and experimental conclusions.</p></disp-quote><p>We thank the reviewer for the valuable comments/ points of discussions and for appreciating our work.</p><p>[Editors' note: further revisions were suggested prior to acceptance, as described below.]</p><disp-quote content-type="editor-comment"><p>The paper offers an interesting conclusion regarding optimal foraging and chemosensory valence that is mostly supported by the data. However, the modelling part is comparatively weaker. Below is a list of the issues that still need to be addressed:</p><p>– How reasonable is the assumption that all worms start in all patches at the same time? Naively, it would seem more realistic that a small founder population would arrive at a patch, and that these foraging dynamics would play out in a context that involves not only food depletion but also population growth. Would the main conclusions of the model (about optimal foraging and evolutionary stability) still hold in a more realistic model that considers such expected natural population dynamics?</p><p>– How far do pheromones diffuse to (within the detectable limit of a <italic>C. elegans</italic>)? Is it clear that the decision to leave a patch is made without knowledge of other food patches? Or, is it possible that the animals are receiving pheromonal cues about other patches even while residing on a food patch bathed in pheromones. This distinction seems important to both the conclusions of the paper and the model, and is not discussed in the main text. Can the diffusion of pheromones be experimentally defined or modeled, to support the assumptions of the foraging model?</p><p>– Is this foraging model ethological? Would worms not have a much lower payoff of leaving their patch in their natural boom-and-bust environment? Specifically, would patch density not be significantly lower in a natural environment such that switching patches is not beneficial until much later in food depletion (which could presumably be generations later)?</p><p>– The model and experiments assume stationarity of the pheromone blend over time with an inversion of valence occurring due to associative learning and satiety. However, would the pheromone blend not change throughout the course of the experiment? Could the specific combination of pheromones in the blend possibly be cause for the valence change?</p><p>– Finally, we wish to draw your attention to the STRANGE framework for animal behaviour research, which is currently being adopted by eLife and seems relevant to your study: https://doi.org/10.1038/d41586-020-01751-5</p></disp-quote><p>We thank the editor for highlighting the STRANGE framework to us.</p><p>Experience is listed among the STRANGE-related biases affecting the generality of behavioral studies. Indeed, a central finding in our work is that <italic>C. elegans’</italic> responses to pheromones depend on past experience and food and therefore should not be considered innate (as stated in the literature as a general finding). We have added a reference to STRANGE in the paragraph about this statement (lines 428-435 in the discussion).</p><p>“As a final remark, our results suggest that <italic>C. elegans</italic> preference for pheromones might not be innate, as it was previously stated (Greene et al., 2016; Macosko et al., 2009; Pungaliya et al., 2009; Simon and Sternberg, 2002; Srinivasan et al., 2012, 2008) and question what it means to be a naive worm (see also Webster and Rutz, 2020). Worms that we call “naive” are directly assayed for chemotaxis after being simultaneously exposed to both bacterial food and ascaroside pheromones, which are continuously excreted by the animals during their growth (Kaplan, 2011). Hence, it is possible that the attraction that “naive” worms exhibit is due to the positive association with food that they learn to make during growth on the plate.”</p><disp-quote content-type="editor-comment"><p>Reviewer #1:</p><p>I am now satisfied with the improved presentation of model details.</p><p>I do note a typo in the caption of Figure 2: &quot;During the first phase, worms equalize occupancy the occupied patches.&quot;</p></disp-quote><p>Thanks. We have fixed it.</p><disp-quote content-type="editor-comment"><p>Reviewer #4:</p><p>Gore et al., show that <italic>C. elegans</italic> leaving food patches at different times and different preferences to pheromones. Animals leaving early are attracted, while those leaving later are repelled from pheromones. I have no concerns with the data. Most of my concerns are with the model.</p><p>It remains unclear whether the inversion is due the association of pheromones with food odorants or due to food-deprivation. I would recommend either testing these two possibilities or clarifying this in the manuscript with specific predictions for each outcome.</p></disp-quote><p>We apologize for not having stated this more clearly in the previous version of the manuscript. Our theoretical results show what features of <italic>C. elegans’</italic> environment might lead to the emergence of the observed behaviors, while remaining agnostic to the mechanism underpinning the behaviors. That is, the observed behaviors could have been triggered by associative learning or starvation, as hypothesized, as well as other factors. We used the experiments to establish which mechanism is the most plausible.</p><p>We added a paragraph at lines 196-200, which reads:</p><p>“Our theoretical results show what features of <italic>C. elegans</italic> environment may lead to the evolution of the observed behaviors, regardless of how the behaviors are implemented. In particular, the inversion in pheromone preference may be triggered by several different factors, and our model cannot distinguish between them. In the following, we will examine experimental evidence related to these mechanisms.”</p><disp-quote content-type="editor-comment"><p>Line 192 – Evolutionary Stable Strategy is introduced for the first time, but is neither defined nor cited. Further, small typo exists with the word &quot;the&quot; on this line.</p></disp-quote><p>We have added a definition of the term Evolutionary Stable Strategy following Maynard Smith at lines 130-133 when we introduce the model.</p><disp-quote content-type="editor-comment"><p>This model uses the tools of Game Theory to find the strategy that maximizes the food eaten by a worm, taking into account that other worms will also follow the same strategy. This strategy is called Evolutionary Stable Strategy, and should have been selected by evolution (Maynard Smith, 1982).</p></disp-quote><p>We have corrected the typo at line 195.</p></body></sub-article></article>