15 ms·
I found two identical packs of Skittles among 468 packs
- justaaron 8y agothat is a seriously skewed candy budget... do you have any teeth left?
- atdrummond 8y agoOP didn't eat them, per the post.
- heavymark 8y agoHe said, "Yeah, I learned from this experiment that I don’t actually like Skittles, which is probably good, so a lot of Skittles were bagged and handed off to relatives." To learn from this experiment that he doesnt like them, that means he must have started out eating them. But yes, he didn't eat them all (thank goodness for his teeth!)
- joelrunyon 8y agoAnyone do the math on this?
- Rebelgecko 8y agoThe cheapest 36 packs of 2.17oz bags I can find on Amazon are $20.99[1], which would cost $272.87 (plus tax?) for the 13 boxes used in the study. [1]: https://www.amazon.com/Skittles-Original-Candy-2-17-Pack/dp/B072J9CHRZ/ https://www.amazon.com/Skittles-Original-Candy-2-17-Pack/dp/...
- pcurve 8y agoas one gets older, cavity becomes less common. sigh
- pseudolus 8y agoJust out of curiosity, did you actually consume them?
- m45t3r 8y agoOP said in the comments of his blog that he didn't actually consumed them, instead he gave to relatives.
- pseudolus 8y agoThanks, I skipped over the comments. Apparently, though, it appears that the OP may not have started immediately handing them out to his/her relatives: "Yeah, I learned from this experiment that I don’t actually like Skittles, which is probably good, so a lot of Skittles were bagged and handed off to relatives. "
- pentestjosh 8y agoSo much diabetes
- z3t4 8y agoI like practical statistics, for example when betting red/black in a casino, what is the chance that you would lose 10 times in a row ? Just keep doubling they say, but eventually you will get a bad streak and wont have enough money or you'll hit the limit.
- e1g 8y agoIf it landed on red 10 times in a row so far, the odds of landing another red on the next round are almost 50%. Gambler's fallacy is so much fun to observe at the tables though :)
- LanceH 8y agoUnder the assumption that it is a fair table. So what is the likelihood that it is a fair table knowing that 1% of tables play 80% red?
- jachee 8y agoAlso: Don't forget green. The 0 and 00 slices of the wheel are green because that's where the house makes their money.
- DanBC 8y agoIn The Newtonian Casino (Might be called something else in the US) students who built computers in their shoes (in the 1970s!) to predict the outcome of roulette wheels discovered that lots of wheels had pretty severe tilts (which affected outcome) and that skilled croupiers had a "signature" -- they knew that particular wheel very well, and had practiced many times, and could increase their chance of hitting a particular number. (This is described in the chapter titled "Lady Luck"). It's a good book! https://www.amazon.co.uk/Newtonian-Penguin-Science-29-Aug-1991-Paperback/dp/B011T8CHQG https://www.amazon.co.uk/Newtonian-Penguin-Science-29-Aug-19...
- joshvm 8y agoIt's supposedly possible to predict to a reasonable degree of accuracy where a roulette ball will land if you know its speed (ie time it hits the wheel, and time to pass a predefined marker). https://www.insidescience.org/news/physics-knowledge-can-tilt-odds-roulette https://www.insidescience.org/news/physics-knowledge-can-til...
- megous 8y ago60kg.
- dmitryminkovsky 8y agoStats is the science of sciences in my opinion, and anyone who brings it to life like this is awesome.
- robertAngst 8y agoHave you seen Efficiency Is Everything's data on food? https://efficiencyiseverything.com/food/ https://efficiencyiseverything.com/food/
- dmitryminkovsky 8y agoNope hadn’t seen that before. Thank you! Ironically I am not a big efficiency person but where I am very interested in efficiency is foods. Like what food has the best amino acid profile for the dollar, that kind of thing. And this appears to be that.
- ed312 8y agoThat site is amazing and engrossing. Thank you for this link - I think I'm going to loose myself in excel for a few hours. Nutrients/calorie and nutrients/dollar are incredibly useful metrics for anyone while shopping!
- hopler 8y agoIt's not really useful. It's extremely easy to get plenty of nutrients and calories extremely cheaply, but that's not what people are paying for when they shop for food.
- city41 8y agoI wonder if it would have been worth it to build a device to scan the skittles for you. edit: would love an explanation for the downvotes
- omarchowdhury 8y agoA device seems like overkill. Write code to apply machine vision to this grid: https://possiblywrong.files.wordpress.com/2019/04/skittles_all.png https://possiblywrong.files.wordpress.com/2019/04/skittles_a...
- HeWhoLurksLate 8y agoYou'd probably want a jig for that, wouldn't you? Hence, building.
- marmshallow 8y agoI think the fastest and most accurate process would be to: * empty a pack of skittles onto white paper and take a photo * use some existing image recognition libraries to count each color * export to csv or smn and do excel magic
- laurent123456 8y agoEven without an image recognition library, it should be possible to simply count the pixels and how close to red, green, blue, etc. they are to know how many skittles there are in the picture.
- phjesusthatguy3 8y agoI didn't downvote you but he did have a threshold for "this misshapen lump isn't a skittle"
- city41 8y agoThanks. I also think people are latching onto the word "device" strongly. I really just meant some form of automation.
- fouc 8y ago>So, what’s the point? Why bother with nearly three months of effort to collect this data? One easy answer is that I simply found it interesting. But I think a better answer is that this seemed like a great opportunity to demonstrate the predictive power of mathematics. A few months ago, we did some calculations on a cocktail napkin, so to speak, predicting that we should be able to find a pair of identical packs of Skittles with a reasonably– and perhaps surprisingly– small amount of effort. Actually seeing that effort through to the finish line can be a vivid demonstration for students of this predictive power of what might otherwise be viewed as “merely abstract” and not concretely useful mathematics.
- Johnny555 8y agoI'd think that he could have also proven this with a lot less work by writing a simulation.
- deleted 8y ago[deleted]
- spydum 8y agoSimulation proves only the theory - sampling and experimentation proves the implementation. Otherwise it might be entirely possible for the packaging process to fill an exact match at a far higher rate - and for the mix to NOT be random.
- Johnny555 8y agoRight, so he didn't really prove the implementation, he'd need to repeat his experiment a number of times. Trivial in a simulation, less so if you have to buy and count them.
- whatshisface 8y agoIt would not have been practical to design a simulation of a Skittles packaging machine, as the design of those machines is not public information.
- praeconium 8y agoBig fan of skittles - never crossed my mind. Very cool! Perhaps try different kinds as another follow up? Machine learning and openCV can do the trick for counting without sorting.
- tlrobinson 8y agoIt's interesting this person can program, but chose to manually count 27,740 Skittles instead of automate it in some way. It feels like an almost-trivial computer vision problem.
- tayo42 8y agocomputer vision is trivial? when did that happen?and how was it made trivial?
- tlrobinson 8y agohttp://opencv.org/ http://opencv.org/ Counting the number of round colored objects on a white background is not a hard problem. I think I've found a project for this evening...
- dekhn 8y agoI've done a few computer vision projects lately and it's really amazing what you can get done with opencv for relatively clean data. In this case you're trying to identify circles and classify their color into one of several groups. This is pretty common, the main challenge is cleaning up the raw data so that the hough transform runs quickly and accurately, and the color cluster identifier is robust. If you're pretty good with Tensorflow, you could do it with an object detector. I've built absurdly accurate object detectors using the TF Object Detector tutorial and just a little hand labelled data plus some good synthetic augmentation. For this project's scope and scale it's probably not worth automating unless you're going to be repeatedly running the process.
- vortico 8y agoHe's saying detecting skittle colors is "trivial" in the field of computer vision, and he would be correct. A 50 line Python script with a popular classifier library would solve this problem with high accuracy. This is perhaps the easiest problem to solve with CV and would be a great first tutorial for such libraries.
- heavymark 8y agoHard to imagine that process would be trivial especially since as he noted in the article he had to have criteria on when to count a skittle such as if it were too small, appeared unedible and other such characteristics. But after completing the manual way would be interesting to running programs on it to see how close they are from the actual numbers.
- subcosmos 8y ago..... Let's get this guy some cancer microscopy data!
- bakul 8y agoThis guy missed an excuse to build a Lego sorting machine....
- deleted 8y ago[deleted]
- pixl97 8y agoSorting machine?, this is hacker news, a visual AI that would count each color is the rage these days.
- DCoder 8y agoLego Mindstorms has a color sensor, so theoretically you can build that AI in Lego.
- Evidlo 8y agoI think he means something to count a pack dumped on the table.
- metaphor 8y agoI suspect the parent's suggestion is more along the lines of 1 snapshot that captures all Skittles in a pack, then ML object detection to classify and count outcome...processes an entire pack in a single shot, as opposed to 1 Skittle at a time.
- SlowRobotAhead 8y agoExcept one of his criteria for whether or not to count a defect was if it was uniformly costed or not. So now you’re back to the sorting machine with a tumbler or multiple cameras.
- metaphor 8y agoWith that additional requirement, consider the following naive 2-camera solution flow: 1. load packet contents on transparent substrate 2. short vibration to randomly disperse 3. image capture top and bottom 4. ML processing 5. dispose of load 6. goto step (1) Cameras for this class of application are cheap, but if 1 camera is an explicit design requirement, then a simple motor with 90-degree camera mount to capture top, rotate 180-deg, capture bottom is simple enough as well (albeit less reliable given the introduction of a precision electromotive element to the system). If alignment is critical, then error budget can be appreciably extended by marking corners of transparent rectangular platter with distinct color/shape on top and bottom to serve as fiducials in computer-aided skew correction/alignment, compensating for inevitable drift over time; it could also supplement human validation of archived images so orientation is easily determined.
- dekhn 8y agoI'm so glad to see there are people who think like me. I have spent thousands of hours doing various projects like this. The only difference is, I normally spend my time automating the process with computer vision (a skittle sorter/counter wouldn't be that hard to build; opening the bag is harder than identifying colors). And then I never really finish the project.
- deleted 8y ago[deleted]
- __m 8y agoWell opening the packs is probably not that much of an effort compared to sorting/counting 27,000 skittles. Instead of 3 month you could break it down to one or two days
- daveFNbuck 8y agoIf you have to put the bag in the machine, it's not much more effort to tear it open. If you do that over a large funnel, that should work to get all the skittles into the counter most of the time. I was thinking that time could be saved by not sorting the skittles so nicely. Just take a picture of the skittles from each bag spread out randomly. You should be able to figure out the color distribution just by counting pixels within each color range.
- dotancohen 8y agoYou do not even need to count the pixels. OpenCV will identify the objects, then their dominant colour can be determined.
- dekhn 8y agoactually ripping a small bag filled with stuff open reliably is a bit harder than you might think.
- fencepost 8y agoactually ripping a small bag filled with stuff open reliably is a bit harder than you might think. "That's why we built Loppy the Chopper over there."
- Zenst 8y agoIt's nice to read science like this without it being reduced to a once a year period of https://www.improbable.com/ig/ https://www.improbable.com/ig/ related links.
- joemaller1 8y agoThis was really hard to read through because I kept dreaming up systems and applications which might automate the whole process.
- User23 8y agoFun article. The Birthday Paradox was my introduction to recreational mathematics.
- mindfulplay 8y agoWhat a time to be alive!
- HNLurker2 8y agoThis is 2 minutes paper. And I am your host.
- mindfulplay 8y agoHaha. So this ingenious method started with packet number 1 and examined thank you to the Patreon supporters John Jim and Richard now onto Packet number 456 where the color red was found. Thank you and please subscribe like and share.
- nerdSniped 8y agoThis is some fucking nerd sniping, if I've ever seen such a thing.
- metaphor 8y ago> From 12 January through 4 April, I worked my way through 13 boxes, for a total of 468 packs, at the approximate rate of six packs per day. Honestly thought I was going to read a "just cause" blog on machine vision and process automation, e.g. 3 months to develop a functional prototype and train the system, 3 days to process 468 packs...and automated repeatability at the end of it all.
- SlowRobotAhead 8y agoI assume most people read the title and we’re expecting machine vision. I definitely did within the first two seconds of reading.
- Insanity 8y agoYeah as soon as I saw the title I made the assumption that it'd be automated. I can't imagine doing this manually - though it'd take me more time to write a Machine Vision solution rather than just doing it manually. :P
- personjerry 8y agoNo ones mentioned this, but it's unlikely skittles are "randomly distributed". Instead it's likely in the Skittles factory there's some system that attempts to reasonably distribute colours so no one bag is too skewed. So the whole premise is faulty.
- jdreaver 8y agoNo one has mentioned it? Did you read the article? The article discusses exactly what you just said.
- Chinjut 8y agoWhere? I don't see it anywhere. There's some discussion of total volume perhaps being non-independent from box to box, so an underfilled box is followed by an overfilled one, but this isn't the point the grandparent is making. The grandparent is making the point that there are probably systems in place to prevent a box from being 80% red, say, so that the assumption each individual skittle in a box is independently uniformly drawn from each possible color does not likely accurately model the dynamics.
- possiblywrong 8y agoAuthor of the article here; you have a point that there is no explicit discussion of validating this assumption, beyond the variability shown in the colored curves in the "count per pack" plot. Having said that, this small sample is indeed reasonably consistent (or at least not inconsistent) with that iid assumption for the color of each individual Skittle. We would not expect to see any 80+% red packs even assuming that color was perfectly uniformly iid, because the probability of observing such a pack is so small (less than 10^(-19)). However, still assuming this model, we should expect to see packs with very small proportion of reds... and we do, with one pack having just 3 red Skittles, for example. The entire distribution of proportion of red follows the assumed binomial distribution very closely.
- deleted 8y ago[deleted]
- atrn 8y agoThis is important and high quality research. It deserves an Ig Noble nomination.
- samstave 8y agoI would have loved to see all the counts of each in piechart form with slices for each color :-)
- jackvalentine 8y agoI love this and it demonstrates the kind of statistics I wish I was a lot better at. I've just ordered a huge box of fun sized M&M packets and will try using computer vision to count them to copy this study from start to finish for learning purposes.
- deleted 8y ago[deleted]
- krick 8y agoUh, congrats, I guess...
- eriktrautman 8y agoThe experiment is great hands on math but I would have enjoyed a discussion of variance versus expected value and the difference between short and long term averages... it’s too easy to infer that everything is great because he was lucky enough to get within the target range but the likelihood of that occurring is not actually that high and was only implied by the shape of the Monte Carlo distribution in his previous post. When such experimental results are this conveniently “accurate”, amateurs in the audience may take away the kinds of wrong inferences which create “it’s a hot day so must be global warming” type of logical inaccuracies.
- possiblywrong 8y agoAuthor of the article here; this is a great point. This experiment initially stemmed from a nice analytical solution to the problem of computing the expected value (via generating functions as described in the post). Computing other moments, let alone the entire distribution, required some Monte Carlo simulation, as shown at the end of the first article (https://possiblywrong.wordpress.com/2019/01/09/identical-packs-of-skittles/ https://possiblywrong.wordpress.com/2019/01/09/identical-pac...) before I started the experiment. And even this histogram assumes a distribution of total number of Skittles per pack (that varies) that I had to guess at beforehand. In hindsight, the final sample distribution suggests that I probably initially overestimated the true variance, and thus also overestimated the expected number of packs I would need to inspect. In other words, this experiment arguably took longer than "average." So you're right-- this experiment could have extended into 700 packs, 800 packs... and still have been consistent with the assumed model, but I would have simply been in an unfortunate 90-th percentile possible universe where it took much longer than "average."
- externalreality 8y agoYou have nothing better to do do you?
- mikorym 8y agoCool thing to do. This is similar tot the birthday problem: How many people do you need to have a probability of > x% that two are born on the same day? It's something like 50 people to have a probability of > 80%. You can conduct this experiment at a school, using each class as a sample experiment to see if there are two pupils born on the same day.
- bookofjoe 8y ago"In a room of just 23 people there’s a 50-50 chance of at least two people having the same birthday. In a room of 75 there’s a 99.9% chance of at least two people matching." https://betterexplained.com/articles/understanding-the-birthday-paradox/ https://betterexplained.com/articles/understanding-the-birth...
- possiblywrong 8y agoAuthor of the article here-- right! This was the key "real world" motivation for this experiment as an attempt at a pedagogical tool; from the article: > As an aside, I think the fact that this particular concrete application happens to be recreational, or even downright frivolous, is beside the point. For one thing, recreational mathematics is fun. But perhaps more importantly, there are useful, non-recreational, “real-world” applications of the same underlying mathematics. Cryptography is one such example application; this experiment is really just a birthday attack in slightly more complicated form.
- mikorym 8y agoSometimes I find these concrete investigations necessary for our brains to make peace with the unreasonable effectiveness of mathematics, as it's been called. I would say one of the first great discoveries for a person is the exponential series (a real world examples: population growth). Another is the divergence of the harmonic series 1/n and convergence of 1/n^2 (my preferred real world example: pizza slices that converge to 1 pizza or diverge to infinitely many). E.g. give me 1/n slices for the rest of my life and I'll pay you $100 (-: When travelling, I also have go-to experiments that I like doing (e.g., elementary proofs that the earth is round/spherical such as: great circles; N-E-S-W always at 90 degrees; shadow angles [Erastothenes]; seasons; etc.) There are other things to investigate that are not really "proofs" or "combinatorial evidence", but equally interesting. One example is using music (esp. the piano) as a physical logarithm device. The music "sounds" additive but the frequencies are multiplicative.
- rorykoehler 8y agoKind of disappointed at the methodology. It would have been more impressive to turn this around in a day with ML.
- kerouanton 8y agoThe dataset itself is nice, but if weighting each pack would have been part of the procedure it would have been even more interesting, no? Anyway, this dataset is already in my favorite examples of illustrating a birthday attack for my crypto lectures ;)
- dblohm7 8y agoDon't care. Kill green apple and bring back lime!
- thebouv 8y agoThis is the real truth here.
- lanius 8y agoWhat's the likelihood of getting a potato chip bag with only one chip?
- always4getpass 8y agoZero because QA :)
- xxs 8y agohmm, I'd disagree. There is no formal definition of "a potato chip bag". Hence it's possible to "just" create "a single potato chip bag"...
- lordnacho 8y agoThis is brilliant. Takes a theory, iid colors, it turns out to be wrong, but still gets a hell of a lot of conclusions out of it. Since this is a nerd site, the next step is to use this: https://www.planet-gbc.com/ https://www.planet-gbc.com/ Build a Lego contraption to push some skittles through a sensor that counts them.
- cshimmin 8y agoI don't think the author presented any evidence that invalidates the assumption of IID colors. They show a histogram of the different counts of each color, which seems more or less consistent with a uniform distribution. There are some fluctuations but they're not surprising; the Poisson error bars would be roughly +/- 0.16 in that figure. With error bars that large, it would be surprising if the data were in more exact agreement with the flat line; it's actually related to the same question that the author is examining ("what are the odds to observe all 5 colors at exactly their expected rate of 1/5 within measurement error?"). They do speculate that the number of candies per pack is not IID, i.e., that there are (anti)correlations from one pack to the next. But without knowing more about the packing process, and presumably also having some lot/serial number information for each pack, it would be pretty hard to establish this.
- jordn 8y agoJesus Christ, apple and grape?!? Poor Americans... in the UK that's Lime and Blackcurrant.
- kosievdmerwe 8y agoWhy poor Americans? It's purely a matter of taste. Apple is culturally significant and Blackcurrants are banned in the US (due to then carrying a disease that would devastate one of the forests). So one is more important than lime and the other is totally unfamiliar.
- SmellyGeekBoy 8y agoBlackcurrants are banned in the US? Do they not even have Ribena over there!?
- avaika 8y agoYou can consume blackcurrants in US. You can't grow it (in some states nowadays). Read more at https://en.wikipedia.org/wiki/Blackcurrant#History https://en.wikipedia.org/wiki/Blackcurrant#History
- skykooler 8y agoTo be fair, in America green skittles used to be Lime, too. I remember being quite disappointed when they switched to apple.
- maffydub 8y agoMaybe I just have a really bad sense of taste, but I thought they were just "green" and "purple" (also in the UK).
- tentakull 8y agothis is the most autistic post I’ve seen on hacker news
- bookofjoe 8y agoI posted it. I'm a 70-year-old retired (38 years experience) neurosurgical anesthesiologist. This is the first time in my life anyone has ever alluded to the possibility that I might be on the spectrum. Better late than never!
- ngcc_hk 8y agoI love this. Hacking is not always practical. Let us have some fun. Or sweet!!!
- gibspaulding 8y agoThis immediately made me wonder what the odds are of getting a bag of all the same skittles. My stats are rusty so feel free to correct me, but here's what I got: (1/5)^59 = 1/1.73*10^41 Apparently ~200 million skittles are made daily, so at that rate, we might expect to get a monochrome bag of skittles after ~10^33 years.
- towndrunk 8y agoSo if I'm a statistical stupid what books do you recommend for the beginner?
- RobertDeNiro 8y agoAndrew Gelman has some pretty good books/lectures, but it might be too advanced.
- MentallyRetired 8y agoI've always wanted to write an app that can take a picture of a poured out bag of skittles or M&Ms and not only count how much of each color, but use the relative color difference to tell you what brand (skittles/m&m) or sub-brand (regular, tropical, peanut, etc) and how many calories are on the table. No reason, no monetary plan.
- mtw 8y agoI hope he uses all the Skittles to decorate a wall or something :) otherwise it's a lot of wasted food
- acct1771 8y agoHigh fructose corn syrup is barely food.
- zie1ony 8y agoThe best justification ever for making Skittles-based vodka :)
- elif 8y agoI would recommend openCV to anyone considering a similar experiment. A few hours with a blob detection tutorial would have saved hours of tedium.
- OnlyRepliesToBS 8y agoADMIT YOU WERE PAID
- Spectral 8y agoThe picture he shows of all the Skittles' counts looks like something I would've seen at the local museum. He missed his chance of taking an ultra high resolution photo of it and putting it on display: https://possiblywrong.wordpress.com/2019/04/06/follow-up-i-found-two-identical-packs-of-skittles-among-468-packs-with-a-total-of-27740-skittles/#jp-carousel-3199 https://possiblywrong.wordpress.com/2019/04/06/follow-up-i-f...