All problems

Watching Smoothing Save a Zero

mediumPythonNaive Bayes

A reviewer at Halyard Mail is unconvinced that crediting every word with an extra sighting is worth the distortion it introduces, so the team wants a side-by-side readout for one word under one label. The plain figure is the word's share of the sightings recorded under this label with nothing added anywhere -- the vocabulary does not come into it at all. The credited figure is the one the filter actually uses. Then the readout has to say in words whether the credit rescued anything for this particular word.

Task: Print the plain figure, the credited figure, and the verdict.

Input

One line holding three integers separated by single spaces: how many times the word was recorded under this label, the total sightings recorded under this label, and the number of distinct words in the vocabulary.

Output

Three lines, in this order. unsmoothed and the plain figure, to 4 decimal places. smoothed and the credited figure, to 4 decimal places. Then avoided zero if the plain figure is truly zero, or no zero issue if it is not -- the verdict reads the real value, not the rounded one printed above it.

Example:

Input:
0 100 50

Output:
unsmoothed 0.0000
smoothed 0.0067
avoided zero

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…