All problems

Does This Split Actually Help?

easyPythonDecision Trees

Before Ashby Mutual's build tool commits to a split it asks one last question: is the rule-book actually better off afterwards? Two impurity figures are already in hand — how mixed the group was before the split, and how mixed the two sides are left after it once each side is counted by the claims it holds. A split earns its branch only if the second figure is genuinely lower than the first. Equal is not lower: a rule that leaves the mixture exactly as it found it has added a condition to the rule-book and bought nothing at all.

Task: Report whether this split is worth making.

Input

One line holding two decimal numbers separated by a space: the impurity before the split, then the impurity left after it.

The two figures do not have to have been measured the same way. The before figure is usually carried down from when the group was formed, while the after figure may be re-measured, estimated, or taken on claims deliberately held back from the build. So the after figure can arrive higher than the before figure, and this check has to give a verdict on it rather than treat it as impossible.

Output

One line. Print exactly split helps if the after figure is strictly lower than the before figure, and exactly split does not help otherwise. Any improvement counts, however small, and any figure that is not an improvement — equal or higher, by any margin — does not.

Example:

Input:
0.5 0.3

Output:
split helps

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…