TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How many flies are in my apartment?

228 pointsby maverickleopardalmost 4 years ago

25 comments

m12kalmost 4 years ago
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 originally and marked make up 5% of the total population, meaning your estimate of the total population must be 2000 flies.
评论 #27550638 未加载
评论 #27549529 未加载
评论 #27549578 未加载
评论 #27549535 未加载
评论 #27550094 未加载
评论 #27551841 未加载
评论 #27553863 未加载
评论 #27549452 未加载
lolcalmost 4 years ago
All these models ignore how insects actually zero in on a smell. For a fly outside, the source of the smell is the gap in the window. What looks like random direction changes is actually a search pattern for that source.
评论 #27549409 未加载
评论 #27549552 未加载
评论 #27549297 未加载
评论 #27551812 未加载
评论 #27553094 未加载
评论 #27551468 未加载
ahartmetzalmost 4 years ago
From experience: about 5x as many as you think<p>Story: I was living in a large flatshare that was plagued by flies from nearby horse stables. We were organizing a decent sized party (maybe 40 guests). In the afternoon, we had 15ish items of food that needed to be stored for a few hours until guests arrived. At first we considered covering all the food (creating work and waste of aluminum or plastic foil), then I had the idea to kill all the flies in that room and close the door. We saw about four flies. In the end we killed about 20 before we declared the situation good enough. I don&#x27;t recall if there was a last fly that we eventually killed, or that we eventually gave up on killing. It took half an hour or so.
madethemcryalmost 4 years ago
This reminds me of the flocking boids algorithm by Craig Reynolds [0] which is based on three principles:<p><pre><code> + separation: steer to avoid crowding local flockmates + alignment: steer towards the average heading of local flockmates + cohesion: steer to move towards the average position (center of mass) of local flockmates </code></pre> The algorithm was used to animate the bat swarms in Batman Returns (1992) [1].<p>I love this algorithm, it&#x27;s easy to develop and experiment with and the results feel beautiful &amp; natural.<p><pre><code> [0]: https:&#x2F;&#x2F;www.red3d.com&#x2F;cwr&#x2F;boids&#x2F; [1]: https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Boids</code></pre>
qwertoxalmost 4 years ago
Next step is to set up a grid of ESP32s with MEMS microphones and a FFT routine, stream that data to a server and apply some neural network to get to know the real amount of flies by tracking them individually. Then compare this to the model, and keep improving it until it fits.
评论 #27552516 未加载
0xBA5EDalmost 4 years ago
A tip if you have an annoying fly in your house that&#x27;s hard to swat. Turn off all the lights except the bathroom. In a few minutes it&#x27;ll fly in. Close the door and it&#x27;s mano-a-mano.
评论 #27551259 未加载
评论 #27551916 未加载
knbknbalmost 4 years ago
In the NetLogo Models Library there are quite a few similar models already, &quot;Moths&quot;, &quot;Ants&quot;, &quot;Gaslab Maxwells Demon&quot;, and more variations (adaptive&#x2F;nonadaptive, single&#x2F;flocking etc)<p><a href="http:&#x2F;&#x2F;ccl.northwestern.edu&#x2F;netlogo&#x2F;docs&#x2F;" rel="nofollow">http:&#x2F;&#x2F;ccl.northwestern.edu&#x2F;netlogo&#x2F;docs&#x2F;</a>
solarkraftalmost 4 years ago
If you’re already interested in flies, check out how they behave in nature. They can be quite territorial about their leaf or stick and fights between these agile little beasts are fascinating to watch (extremely quickly orbiting each other).
crispyambulancealmost 4 years ago
Well, there was at least one startup that addressed the issue of flies&#x2F;mosquitoes indoors. Bzigo. <a href="https:&#x2F;&#x2F;bzigo.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bzigo.com&#x2F;</a><p>It&#x27;s a machine vision system that tracks mosquitoes and aims a laser pointer on them (so you can swat them). Don&#x27;t know if this company still exists. It was&#x2F;is an Israeli start-up and apparently not an April Fool&#x27;s day joke.<p>It seems to me the best solution is to use screens, but that is not as sexy as machine vision.
评论 #27554862 未加载
pharmakomalmost 4 years ago
Is it better to leave windows open so flies can escape or closed so they never come in?
评论 #27549330 未加载
评论 #27550065 未加载
评论 #27548819 未加载
评论 #27548829 未加载
评论 #27552794 未加载
OJFordalmost 4 years ago
Based on my experience, those flies need to be less like jittery dots, and more like kamikaze pilots, hurtling themselves from one side of the simulation to the other, repeatedly.
mannykannotalmost 4 years ago
Lévy flight foraging hypothesis: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;L%C3%A9vy_flight_foraging_hypothesis" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;L%C3%A9vy_flight_foraging_hypo...</a><p>The scent-tracking mode used here seems to be a sort of variant, in which the long legs are not chosen randomly.<p>WRT the insect density decreasing as some fly away: in reality, others will arrive at approximately the same rate, keeping the density approximately the same, so it is probaby more realistic to put a box around the simulation, e.g. by reversing the direction of those that have moved away to the point that they would be several time-slices away from entering the window even if they flew back in a straight line.
kzrdudealmost 4 years ago
I tried showing the flies using matplotlib.animation.FuncAnimation in a notebook, animating even 1000 frames is slow and it warns the animation becomes too large. Maybe there&#x27;s a better way to do it? Preferably in a notebook interface.
评论 #27549102 未加载
评论 #27552771 未加载
dmitriidalmost 4 years ago
This sounds like the &quot;how many balls can fit in a bus&quot; interview question, but somehow more entertaining. Possibly because it addresses a real-world situation.
评论 #27552033 未加载
mig39almost 4 years ago
Really interesting work. I love the different models of how a fly moves around. This jumped out at me, though:<p>&gt;If we take a look at the animation now, we can see the flies look slightly more realistic (if not still a bit spazzy)<p>Is &quot;spazzy&quot; a word that&#x27;s used in different regional dialects of English as a term to just mean jittery? In most of the places I&#x27;ve lived, it&#x27;s an offensive word.
评论 #27551683 未加载
评论 #27551834 未加载
评论 #27553155 未加载
评论 #27552344 未加载
评论 #27551542 未加载
pacman2almost 4 years ago
A fly is unlikely to fly randomly.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;L%C3%A9vy_flight" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;L%C3%A9vy_flight</a>
NorwegianDudealmost 4 years ago
I was really confused about where this was going when I started reading as I thought the title sad files, not flies...
评论 #27558418 未加载
mhbalmost 4 years ago
Fly salt guns:<p><a href="https:&#x2F;&#x2F;www.bugasalt.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.bugasalt.com&#x2F;</a>
Lioalmost 4 years ago
For some reason this reminds me of the Damien Hirst art work A Thousand Years[1].<p>Next step for me would be to turn the attractor into an Insectecuter.<p>1. <a href="https:&#x2F;&#x2F;damienhirst.com&#x2F;a-thousand-years" rel="nofollow">https:&#x2F;&#x2F;damienhirst.com&#x2F;a-thousand-years</a>
mrlonglongalmost 4 years ago
There are two hanging around and I&#x27;ve named them after people I hate. I keep the windows open in the hope they&#x27;ll just fly off.
aetherspawnalmost 4 years ago
This would be an interesting thing to prove with OpenCV
评论 #27548966 未加载
tenderfaultalmost 4 years ago
&gt; The perfect question for a Sunday afternoon when you have no friends<p>I have one, we both read your post and we just befriended you without authorization
jdowneralmost 4 years ago
Maxwell&#x27;s kinetic theory of flies?
评论 #27549177 未加载
jjfinealmost 4 years ago
go to the store and buy a removable screen dude. i got one in chinatown for like 5 bucks.
twphysicsphd99almost 4 years ago
very cool<p>it would be fun to add static attractors -ie fruit to see how it biases the trajectories
评论 #27556615 未加载