Live data from Hacker News

How many flies are in my apartment?

saml98.github.io

131–140 of 158 posts

Re: How many flies are in my apartment?

#131
post #40

In my statistics class we were taught a technique for estimating the number of flies in a barn. You capture a fixed size sample of flies, e.g. 100, and give them each a little white dot on the back, then release them all back in the barn. Leave them to mingle for a while, then capture another fixed number of flies, e.g. 100. If 5 of them have a white dot on them, then you estimate that the 100 flies you captured orig…

But how do you catch flies!?!?!

Re: How many flies are in my apartment?

#132

Earlier quoted context omitted.

Another fun thing you can do with flies, and also bees and wasps, apart from vacuuming them up, is put them on a leash. But first you have to freeze them. Catch one in a cup or plastic bag and stick it in the freezer for about 10 minutes. When you take it out it will look dead, but it's not (unless you leave it in too long.) Being careful not to rip it's wings off, tie a small string or fishing line to one of it's le…

That’s animal abuse.

*insect abuse

I think repeatidly slapping them with a pretty soft plastic attraption until they stop moving is even harsher though.

Or slapping them outta the air, trying to electrocute them but having too little power on the shitty device so only their wings get burned.

Or vacuuming them up

Or flushing them down the drain.

Honestly, whatever people usually do to them it's way way crueller

Re: How many flies are in my apartment?

#133

Earlier quoted context omitted.

This reminds me of the time I found two flies in my house despite the windows being closed. I vacuumed them up (more fun that way) and the next day there were two identical looking flies in the house. Did they get out of the vacuum cleaner? I vacuumed them up again. The next day, same story. The flies were now appearing throughout the day. They all looked the same. Where the hell were they coming from? The windows we…

That's scary. I used to be a hardcore insectaphobe, but I got over it over the last couple years. Now I don't care that much when I see insects in my house. But it is within reason! I wouldn't want bugs reproducing in my house, that sounds like a slippery slope!

> I wouldn't want bugs reproducing in my house, that sounds like a slippery slope!

Don’t Google dust mites.

Re: How many flies are in my apartment?

#134
post #46
post #40

In my statistics class we were taught a technique for estimating the number of flies in a barn. You capture a fixed size sample of flies, e.g. 100, and give them each a little white dot on the back, then release them all back in the barn. Leave them to mingle for a while, then capture another fixed number of flies, e.g. 100. If 5 of them have a white dot on them, then you estimate that the 100 flies you captured orig…

Reminds me of how the Allies estimated the production capacity of German tanks during WW2: https://medium.com/dataseries/how-data-science-gave-the-alli...

My intuitive answer to that problem was to say that if we assume the captured serial numbers are randomly distributed, and the numbering starts at 1, then they will have the same average as all the numbers, so the estimate should be the average of captured serial numbers times 2. Which gives a result close to the formula used in this article, but not the same. I'm not sure where is the flaw.

Re: How many flies are in my apartment?

#135

Earlier quoted context omitted.

That’s animal abuse.

*insect abuse I think repeatidly slapping them with a pretty soft plastic attraption until they stop moving is even harsher though. Or slapping them outta the air, trying to electrocute them but having too little power on the shitty device so only their wings get burned. Or vacuuming them up Or flushing them down the drain. Honestly, whatever people usually do to them it's way way crueller

> I think repeatedly slapping them with a pretty soft plastic contraption until they stop moving is even harsher

It's soft to you, not to the fly. You don't slap a fly "until it stops moving". When you swat a fly, it explodes.

Re: How many flies are in my apartment?

#136
post #76

Earlier quoted context omitted.

I found two flies in my house, marked them, then later found two more flies without marks. I think this means the population of flies in my house is infinite.

You want to consider, based on a distribution of potential fly populations, what the odds are that sampling two of them will fail to capture two specific ones. For example, you can state with certainty that the population is above 3. Closely related (though not quite the identical problem): https://www.johndcook.com/blog/2010/03/30/statistical-rule-o... Applying that directly, we would estimate that the odds of a fly…

Mostly because I thought it was fun, a worked example where you mark 100 different flies and then catch 100 unmarked flies (releasing each fly individually immediately after catching it; maybe you caught the same fly 100 times):

By the rule of three, we estimate the probability that a fly in your house is marked at p We can also model the probability that a fly in your house is marked as 100/n, where n is the number of flies in your house.

Then 100/n 100*100/3 = 3,333. There are probably more than 3333 flies in your house.

Re: How many flies are in my apartment?

#138
post #134
post #46

Earlier quoted context omitted.

Reminds me of how the Allies estimated the production capacity of German tanks during WW2: https://medium.com/dataseries/how-data-science-gave-the-alli...

My intuitive answer to that problem was to say that if we assume the captured serial numbers are randomly distributed, and the numbering starts at 1, then they will have the same average as all the numbers, so the estimate should be the average of captured serial numbers times 2. Which gives a result close to the formula used in this article, but not the same. I'm not sure where is the flaw.

If there are 100 tanks, and you get 1, 2, 5, and 99, your method would give 54 tanks ((1 + 2 + 5 + 99)/4 * 2), which is obviously wrong.

Your error is in stating "if we assume the captured serial numbers are randomly distributed" - you're assuming they're -uniformly- distributed. Randomly distributed != uniformly distributed.

Their method would give you 125 as a guess. It's including the known info (i.e., adding "m") to take into account the fact that they're not necessarily evenly distributed.

On that note, if you continued to get tanks at low numbers (3, 4, 6, etc), averaging gets -less- accurate, because that 99 becomes more and more of an outlier. Their method gets MORE accurate, again, because they're taking advantage of all data that is known (we know it goes at least to 99), and averaging doesn't. The new low numbers we've added mean that there are less likely to be many tanks, and the formula in the link takes that into account with m/k.

Both methods will be accurate if you have 100% of the data, but taking twice the average ignores known data, so the sparser the data the less likely it is to be correct.

Re: How many flies are in my apartment?

#139

Earlier quoted context omitted.

This reminds me of the time I found two flies in my house despite the windows being closed. I vacuumed them up (more fun that way) and the next day there were two identical looking flies in the house. Did they get out of the vacuum cleaner? I vacuumed them up again. The next day, same story. The flies were now appearing throughout the day. They all looked the same. Where the hell were they coming from? The windows we…

I admire your perception. I'm personally unable to distinguish different fly specimens, they all look the same to me.

It's only the size and age of them that makes one fly distinguishable from another. When they're all being born at the same time there's absolutely nothing that makes them distinct, and that's your clue that eggs have been laid somewhere in the vicinity.

Re: How many flies are in my apartment?

#140
post #134

Earlier quoted context omitted.

My intuitive answer to that problem was to say that if we assume the captured serial numbers are randomly distributed, and the numbering starts at 1, then they will have the same average as all the numbers, so the estimate should be the average of captured serial numbers times 2. Which gives a result close to the formula used in this article, but not the same. I'm not sure where is the flaw.

If there are 100 tanks, and you get 1, 2, 5, and 99, your method would give 54 tanks ((1 + 2 + 5 + 99)/4 * 2), which is obviously wrong. Your error is in stating "if we assume the captured serial numbers are randomly distributed" - you're assuming they're -uniformly- distributed. Randomly distributed != uniformly distributed. Their method would give you 125 as a guess. It's including the known info (i.e., adding "m")…

Hmmm, on the other hand, suppose you first find a tank with the serial number 1234.

Then the next 50 tanks you find are all from the range [1, 100].

Is it more reasonable to assume that there are around 1258 tanks, or that there are probably closer to 100 tanks, and that first one with the very large serial number was not a sequentially numbered tank?

Post reply on HN