Hacker News new | ask | show | jobs
by mcpherrinm 5158 days ago
I think the most interesting part of this post was the comment about how they use multiple scales with chips to get closest to the desired value.

This is really a neat hack that probably allows for much less precise chip dumpers. I'm reminded of how awesome randomized algorithms in CS can seem, but in real life it is just extra magical.

2 comments

True. Straightforward application of the Knapsack problem: http://en.wikipedia.org/wiki/Knapsack_problem
More a case of discrete chip mass.

You could have very accurate chip scales, load cells are cheap and very accurate - but how do you select exact 'N' grams of random sized potato chips?

Having a set of pans, where the first has eg. 17chips with a mass of 4.5g, the next has 19chips with a mass of 5.9g etc and then selecting from 4 of them them to hit the 20g bag size is very clever.

Exactly. It allows for less-precise (i.e. more variability) chip size, not chip scales. :)

Simplifying the scenario might clarify what's happening. Imagine any given chip could weigh 1-2oz. And you are trying to fill a 2oz (minimum guaranteed content) bag. You already have 1 chip in the bag, weighing 1oz. The next chip you add (think "marginal" from econ class) weighs anywhere from 1-2oz and could tip the scale all the way up to 3oz, when you are only looking for 2oz in the bag. But if you use two scales, you have now a choice of TWO chips to put in the bag, so you pick the one that weighs closest to 1oz. And ultimately this allows you to fill more 2oz bags with the same quantity of chips.