When Violin Beats Box: Bimodal Data
The Ravensworth Group suspects one of its score sets is really two populations wearing one coat -- a cluster of routine jobs and a cluster of emergency ones -- and a box plot cannot show that, because it only reports the middle and the quarters. The team therefore runs a blunt automatic check alongside the chart before anyone argues about the shape.
Task: Print bimodal if the scores contain a wide empty gap, and unimodal if they do not.
Input
The first line holds one integer n, the number of scores, where 1 <= n <= 1000. Then come n lines, one score each, in no particular order.
Output
One line holding exactly bimodal or unimodal, lower case. Put the scores in increasing order and look at the distance between each score and the next. If any of those distances is strictly greater than 20, print bimodal; otherwise print unimodal. A distance of exactly 20 is not wide enough. Every gap counts, including the ones near the two ends.
Example:
Input:
6
1
2
3
50
51
52
Output:
bimodal
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