In an effort to think about something other than Covid-19, as I was taking socks out of the dryer the other day, the following problem crossed my mind. Suppose that we have n pairs of socks, and that individual socks are removed from the dryer according to a random permutation of the 2n socks. At any given time during this process, some number of socks will be unmatched (i.e. one of the pair is out of the dryer and the other is still in). In the unlikely event that no socks have been lost, what is the typical maximum number of unmatched socks when n is large? I solved this first with a system of differential equations, by thinking about each pair as having a state of 0, 1, or 2 socks removed so far. These three classes of pairs can be thought of as susceptible, infected, and recovered… oh wait. Then I found a much simpler solution. Best, Cris Moore moore@santafe.edu In the forgetting of what has scarcely transpired there resonates the fury of one who must first talk himself out of what everyone knows, before he can then talk others out of it as well. — Theodor Adorno
The brute force solution is easy, and then I reasoned as follows: According to time reversal symmetry, f(t)=f(1-t), f'(0) = 1, and f'(1/2)=0. The simplest possible solution is f(t)=t-t^2, which predicts that f(1/2) =1/4, relative to total sample size, and this is apparently correct. To be sure, at any time t, we sample from (1-t) with f possible matches and (1-t-f) possible mismatches, so f' = (1-t-f)/(1-t) - f/(1-t), or (1-t-f)-f-(1-t)f' =0, and it is trivial to check this equation against f=t-t^2: Expand[((1 - t - f) - f - (1 - t)*fp) /. {f -> t - t^2, fp -> D[t - t^2, t]}] Out[]=0. The other thread about population dynamics of annual insects is also implicitly inspired by SIR equations. There the analogy should be stronger due to exponential behavior turning on and off. The situation with the dryer as a reservoir is similar to that of hiding larvae, but there is no specified mechanism for removing multiple socks at the same time, thus we get more simplistic growth. Meanwhile, the example of Popillia japonica (one of the chiral scarabs) has quashed my hope that adult lifetimes would be easy to estimate or bound from looking at the tail of population graphs: https://www.inaturalist.org/taxa/67760-Popillia-japonica I calculated an 11 day (1/E)-life, though I have seen statistics saying 1-2 months for adult lifetime. This is more inline with FWHM of the "seasonality" plot. --Brad On Sun, Mar 29, 2020 at 1:40 PM Cris Moore via math-fun <math-fun@mailman.xmission.com> wrote:
In an effort to think about something other than Covid-19, as I was taking socks out of the dryer the other day, the following problem crossed my mind. Suppose that we have n pairs of socks, and that individual socks are removed from the dryer according to a random permutation of the 2n socks. At any given time during this process, some number of socks will be unmatched (i.e. one of the pair is out of the dryer and the other is still in). In the unlikely event that no socks have been lost, what is the typical maximum number of unmatched socks when n is large?
I solved this first with a system of differential equations, by thinking about each pair as having a state of 0, 1, or 2 socks removed so far. These three classes of pairs can be thought of as susceptible, infected, and recovered… oh wait.
Then I found a much simpler solution.
Best,
Cris Moore moore@santafe.edu
In the forgetting of what has scarcely transpired there resonates the fury of one who must first talk himself out of what everyone knows, before he can then talk others out of it as well. — Theodor Adorno
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
And for my next trick, I will pull 6611 Japanese beetles out of an imaginary clothes dryer. Say that we change the step function so that when we have N mismatched socks, we draw N from the dryer (or we count N consecutive draws in one step of time). This changes the shape of the distribution significantly. For example, on 50,000 socks we get: {1, 2, 4, 8, 16, 32, 64, 128, 255, 506, 996, 1932, 3634, 6430, 10084, 12484, 9819, 3344, 259, 1, 0} with fewer than 25 steps. If we reverse this data, pad correctly and compare with appropriately binned japonica data from iNaturalist, we then get: https://0x0.st/iMcj.png socks = {0, 0, 0, 0, 0, 0, 0, 0, 1, 259, 3344, 9819, 12484, 10084, 6430, 3634, 1932, 996, 506, 255, 128, 64, 32, 16, 8} (*blue*) beetles = {1, 3, 2, 4, 2, 1, 2, 9, 4, 39, 286, 1006, 1691, 1478, 933, 538, 361, 179, 51, 9, 3, 3, 3, 2, 1} (*green*) Normalize list-functions and take a dot product, to find 98.9% agreement: N[Normalize[socks].Normalize[beetles]] Out[] = 0.989449 This is a nice little magic trick, and I have no idea why it worked so well! A possible answer is that both sock & beetle functions look like Poisson distributions. Cheers, --Brad On Sun, Mar 29, 2020 at 3:11 PM Brad Klee <bradklee@gmail.com> wrote:
The brute force solution is easy, and then I reasoned as follows:
According to time reversal symmetry, f(t)=f(1-t), f'(0) = 1, and f'(1/2)=0. The simplest possible solution is f(t)=t-t^2, which predicts that f(1/2) =1/4, relative to total sample size, and this is apparently correct. To be sure, at any time t, we sample from (1-t) with f possible matches and (1-t-f) possible mismatches, so f' = (1-t-f)/(1-t) - f/(1-t), or (1-t-f)-f-(1-t)f' =0, and it is trivial to check this equation against f=t-t^2:
Expand[((1 - t - f) - f - (1 - t)*fp) /. {f -> t - t^2, fp -> D[t - t^2, t]}] Out[]=0.
The other thread about population dynamics of annual insects is also implicitly inspired by SIR equations. There the analogy should be stronger due to exponential behavior turning on and off. The situation with the dryer as a reservoir is similar to that of hiding larvae, but there is no specified mechanism for removing multiple socks at the same time, thus we get more simplistic growth.
Meanwhile, the example of Popillia japonica (one of the chiral scarabs) has quashed my hope that adult lifetimes would be easy to estimate or bound from looking at the tail of population graphs:
https://www.inaturalist.org/taxa/67760-Popillia-japonica
I calculated an 11 day (1/E)-life, though I have seen statistics saying 1-2 months for adult lifetime. This is more inline with FWHM of the "seasonality" plot.
--Brad
On Sun, Mar 29, 2020 at 1:40 PM Cris Moore via math-fun <math-fun@mailman.xmission.com> wrote:
In an effort to think about something other than Covid-19, as I was taking socks out of the dryer the other day, the following problem crossed my mind. Suppose that we have n pairs of socks, and that individual socks are removed from the dryer according to a random permutation of the 2n socks. At any given time during this process, some number of socks will be unmatched (i.e. one of the pair is out of the dryer and the other is still in). In the unlikely event that no socks have been lost, what is the typical maximum number of unmatched socks when n is large?
I solved this first with a system of differential equations, by thinking about each pair as having a state of 0, 1, or 2 socks removed so far. These three classes of pairs can be thought of as susceptible, infected, and recovered… oh wait.
Then I found a much simpler solution.
Best,
Cris Moore moore@santafe.edu
In the forgetting of what has scarcely transpired there resonates the fury of one who must first talk himself out of what everyone knows, before he can then talk others out of it as well. — Theodor Adorno
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
This explains why I’ve been finding so many unmatched beetles in my dryer! Cris
On Mar 29, 2020, at 6:25 PM, Brad Klee <bradklee@gmail.com> wrote:
And for my next trick, I will pull 6611 Japanese beetles out of an imaginary clothes dryer.
Say that we change the step function so that when we have N mismatched socks, we draw N from the dryer (or we count N consecutive draws in one step of time). This changes the shape of the distribution significantly. For example, on 50,000 socks we get:
{1, 2, 4, 8, 16, 32, 64, 128, 255, 506, 996, 1932, 3634, 6430, 10084, 12484, 9819, 3344, 259, 1, 0}
with fewer than 25 steps. If we reverse this data, pad correctly and compare with appropriately binned japonica data from iNaturalist, we then get:
socks = {0, 0, 0, 0, 0, 0, 0, 0, 1, 259, 3344, 9819, 12484, 10084, 6430, 3634, 1932, 996, 506, 255, 128, 64, 32, 16, 8} (*blue*)
beetles = {1, 3, 2, 4, 2, 1, 2, 9, 4, 39, 286, 1006, 1691, 1478, 933, 538, 361, 179, 51, 9, 3, 3, 3, 2, 1} (*green*)
Normalize list-functions and take a dot product, to find 98.9% agreement:
N[Normalize[socks].Normalize[beetles]] Out[] = 0.989449
This is a nice little magic trick, and I have no idea why it worked so well! A possible answer is that both sock & beetle functions look like Poisson distributions.
Cheers,
--Brad
On Sun, Mar 29, 2020 at 3:11 PM Brad Klee <bradklee@gmail.com> wrote:
The brute force solution is easy, and then I reasoned as follows:
According to time reversal symmetry, f(t)=f(1-t), f'(0) = 1, and f'(1/2)=0. The simplest possible solution is f(t)=t-t^2, which predicts that f(1/2) =1/4, relative to total sample size, and this is apparently correct. To be sure, at any time t, we sample from (1-t) with f possible matches and (1-t-f) possible mismatches, so f' = (1-t-f)/(1-t) - f/(1-t), or (1-t-f)-f-(1-t)f' =0, and it is trivial to check this equation against f=t-t^2:
Expand[((1 - t - f) - f - (1 - t)*fp) /. {f -> t - t^2, fp -> D[t - t^2, t]}] Out[]=0.
The other thread about population dynamics of annual insects is also implicitly inspired by SIR equations. There the analogy should be stronger due to exponential behavior turning on and off. The situation with the dryer as a reservoir is similar to that of hiding larvae, but there is no specified mechanism for removing multiple socks at the same time, thus we get more simplistic growth.
Meanwhile, the example of Popillia japonica (one of the chiral scarabs) has quashed my hope that adult lifetimes would be easy to estimate or bound from looking at the tail of population graphs:
https://www.inaturalist.org/taxa/67760-Popillia-japonica
I calculated an 11 day (1/E)-life, though I have seen statistics saying 1-2 months for adult lifetime. This is more inline with FWHM of the "seasonality" plot.
--Brad
On Sun, Mar 29, 2020 at 1:40 PM Cris Moore via math-fun <math-fun@mailman.xmission.com> wrote:
In an effort to think about something other than Covid-19, as I was taking socks out of the dryer the other day, the following problem crossed my mind. Suppose that we have n pairs of socks, and that individual socks are removed from the dryer according to a random permutation of the 2n socks. At any given time during this process, some number of socks will be unmatched (i.e. one of the pair is out of the dryer and the other is still in). In the unlikely event that no socks have been lost, what is the typical maximum number of unmatched socks when n is large?
I solved this first with a system of differential equations, by thinking about each pair as having a state of 0, 1, or 2 socks removed so far. These three classes of pairs can be thought of as susceptible, infected, and recovered… oh wait.
Then I found a much simpler solution.
Best,
Cris Moore moore@santafe.edu
In the forgetting of what has scarcely transpired there resonates the fury of one who must first talk himself out of what everyone knows, before he can then talk others out of it as well. — Theodor Adorno
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
Cris Moore moore@santafe.edu
participants (2)
-
Brad Klee -
Cris Moore