Simple Math Puzzle

Your boss shows you a random number of boxes. Each contains a random number of 14kg whatzits or 15kg whoozits, with no mixing. Whatzits and whoozits look exactly the same. He asks you to make as few weight measurements as possible to determine what is in each box. The scale is just big enough that its maximum limit is higher than needed for the problem. You cannot tell a 14kg weight from a 15kg weight just by picking it up. The weights are exact. Can you determine what is in each box, using only one weighing?

I think I’m missing something…
[ul]
[li]There are a random number of boxes. (I take it you mean an indeterminate number.)[/li][li]In each of those boxes are a random number (indeterminate) of whatzits or whoozits. Question: are they mixed, or are whatzits only in whatzit boxes and whoozits only in whoozits boxes?[/li][li]Is the scale a balance scale or an absolute scale that will tell you the mass of what is on it?[/li][/ul]

I guess until you have a box with 15x the 14Kg Whatzits or a box with 14x 15Kg Whoozits, you could easily calculate which are which. follow the 14 times table… 14, 28, 42, 56, 70, 84, 98, 112, 126, 140, 154, 168, 182, 196, 210. Any other weights would be the 15Kg Whoozits… you know, 15,30 45 etc. Problem is at 210Kg, it could be either.

This may be cheating, because it depends what you mean by “one weighing”, but…

Put all the boxes on the scale. Take them off one at a time. The boxes that reduce the weight by 14X (where X is the random number of thingies in each box - I assume each box has the same random number of thingies) contain whatzits, and the boxes that reduce the weight by 15X have whoozits.

I imagine there’s something there that I’m not getting, but what the heck.

Clarification, if above was unclear.

You have a known number of boxes, but it could be 3 or it could be 20 or could be 200. It does not affect the answer, and is not indeterminate.

All the boxes look the same, and contain just whoozits or just whatzits. Every box is full with lots of whoozits or lots of whatzits. No box contains both whoozits and whatzits. The number of things in any given box is large, but the actual number of things in any box is not really needed, providing there are enough, which there are. Should have said “a big random number” of things in each box.

You could weigh one item, one at a time from each box and see if it was 14 or 15kg. If you weigh each box, one at a time, you are basically doing this but get confused at any multiple of 210kg. Removing weights is taking more than one weighing, so is not really the elegant answer I had in mind.

I don’t know if this is the solution you’re looking for because it requires minimum numbers of objects in each box and the boxes must be open. IIRC, there is a way to do this with smaller numbers of objects and a different pattern for picking the objects, but I can’t remember it.

[ul][li]Arrange the boxes in some order. By increasing number (estimated) of objects would be best.[/li][li]Take 1 object from the first box, 2 from the second, 4 from the third, and so on, multiplying the number taken by two each time.[/li][li]Weigh all the objects you took.[/li][li]If n is the number of boxes, the number of objects you removed is 2[sup]n[/sup] - 1. Call this number r. Compute x = weight - r * 14.[/li]Convert x to base 2. Read the digits starting from the right. Each binary digit corresponds to the arrangement of boxes. 0 indicates a box of whatzits, 1 indicates a box of whoozits.[/ul]Hope I got the math right.

I garbled that a bit. Replace it with this sentence: “The rightmost digit corresponds to the first box, the next digit to the left corresponds to the second box, and so forth.”

That’s essentially the answer I was looking for. Very good.