r/adventofcode • • Dec 07 '17

Help "exactly one program is the wrong weight" - ambiguous?

Did I missing something in the problem description? Since we're not given whether the program with wrong weight is too light or too heavy, this is ambiguous if the program with wrong weight is on top of a program with "two children", right?

Example prog (10) has two children prog1 (11) and prog2 (12). It's impossible to tell which one has the wrong weight (or should we interpret this as a situation where "2 problems have a wrong weight"?)

After thinking for a while I reasoned "you will be given an input where there is a single problem with the wrong weight and it is possible to determine it unambiguously" (in other words, the problem with wrong weight must be the child of a program with 3 or more programs).

Did anyone else find it confusing?

10 Upvotes

11 comments sorted by

View all comments

13

u/topaz2078 (AoC creator) Dec 07 '17

It's still possible to determine unambiguously; the wrongly-weighted node is never on a layer with only two nodes.

11

u/xiaowuc1 Dec 07 '17

In general though, it's possible for the wrongly-weighted node to be ambiguous, and yet for the final weight to be unambiguous.

Example graph: a has two children, b and c. b has two children each with weight 5. b has weight 7. c has two children each with weight 6. c has weight 3.

If we're only allowed to change one node, if we change b, it would have weight 5. If we change c, it would also have weight 5.

2

u/pedrosorio Dec 07 '17

"It's still possible to determine unambiguously; the wrongly-weighted node is never on a layer with only two nodes."

Is this fact somewhere in the problem statement or just an unstated property of all the inputs that were provided?

7

u/topaz2078 (AoC creator) Dec 07 '17

The latter. It's true of all inputs for all puzzles on AoC.